-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add slider, progress indicator update cc version
- Loading branch information
1 parent
91f985c
commit 8dd9617
Showing
7 changed files
with
236 additions
and
6 deletions.
There are no files selected for viewing
Binary file renamed
BIN
+156 KB
...nnect-npm-1.0.1-64a8b81268-1fceaee828.zip → ...nnect-npm-1.0.2-c160202f86-28de9e3070.zip
Binary file not shown.
43 changes: 43 additions & 0 deletions
43
packages/react/code-connect/ProgressIndicator/ProgressIndicator.figma.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* Copyright IBM Corp. 2016, 2024 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { ProgressIndicator } from '@carbon/react'; | ||
// import { ProgressIndicatorSkeleton } from '@carbon/react'; | ||
import figma from '@figma/code-connect'; | ||
|
||
figma.connect( | ||
ProgressIndicator, | ||
'https://www.figma.com/design/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?node-id=3925-58667&m=dev', | ||
{ | ||
props: { | ||
children: figma.children(['_Progress indicator item']), | ||
vertical: figma.enum('Direction', { | ||
Vertical: true, | ||
}), | ||
}, | ||
example: ({ children, vertical }) => ( | ||
<ProgressIndicator vertical={vertical}>{children}</ProgressIndicator> | ||
), | ||
} | ||
); | ||
|
||
// figma.connect( | ||
// ProgressIndicatorSkeleton, | ||
// 'https://www.figma.com/design/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?node-id=3925-58667&m=dev', | ||
// { | ||
// variant: need nested variant selector here, https://github.com/figma/code-connect/issues/91 | ||
// props: { | ||
// vertical: figma.enum('Direction', { | ||
// Vertical: true, | ||
// }), | ||
// }, | ||
// example: ({ children, vertical }) => ( | ||
// <ProgressIndicatorSkeleton vertical={vertical} /> | ||
// ), | ||
// } | ||
// ); |
37 changes: 37 additions & 0 deletions
37
packages/react/code-connect/ProgressIndicator/ProgressStep.figma.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
* Copyright IBM Corp. 2016, 2024 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
// @ts-nocheck | ||
import React from 'react'; | ||
import { ProgressStep } from '@carbon/react'; | ||
import figma from '@figma/code-connect'; | ||
|
||
figma.connect( | ||
ProgressStep, | ||
'https://www.figma.com/design/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?node-id=3377-31707&m=dev', | ||
{ | ||
props: { | ||
complete: figma.enum('State', { | ||
Completed: true, | ||
}), | ||
current: figma.enum('State', { | ||
Current: true, | ||
}), | ||
disabled: figma.enum('State', { | ||
Disabled: true, | ||
}), | ||
invalid: figma.enum('State', { | ||
Error: true, | ||
}), | ||
secondaryLabel: figma.boolean('Optional label', { | ||
true: figma.textContent('Optional label'), | ||
}), | ||
label: figma.string('Label text'), | ||
}, | ||
example: ({ ...props }) => <ProgressStep {...props} />, | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
/** | ||
* Copyright IBM Corp. 2016, 2024 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
// @ts-nocheck | ||
import React from 'react'; | ||
import { Slider, SliderSkeleton } from '@carbon/react'; | ||
import figma from '@figma/code-connect'; | ||
|
||
//single | ||
figma.connect( | ||
Slider, | ||
'https://www.figma.com/design/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?node-id=3673-40574&m=dev', | ||
{ | ||
props: { | ||
slider: figma.nestedProps('_Slider base', { | ||
labelText: figma.textContent('Label'), | ||
}), | ||
invalidText: figma.string('Error text'), | ||
warnText: figma.string('Warning text'), | ||
disabled: figma.enum('Status', { | ||
Disabled: true, | ||
}), | ||
invalid: figma.enum('Status', { | ||
Error: true, | ||
}), | ||
readOnly: figma.enum('Status', { | ||
'Read-only': true, | ||
}), | ||
warn: figma.enum('Status', { | ||
Warning: true, | ||
}), | ||
textInput: figma.nestedProps('Text input - Default', { | ||
value: figma.string('Input text'), | ||
}), | ||
}, | ||
example: ({ slider, textInput, ...props }) => ( | ||
<Slider value={textInput.value} labelText={slider.labelText} {...props} /> | ||
), | ||
} | ||
); | ||
|
||
//two handle | ||
figma.connect( | ||
Slider, | ||
'https://www.figma.com/design/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?node-id=41061-1531&m=dev', | ||
{ | ||
props: { | ||
max: figma.string('Max range text'), | ||
min: figma.string('Min range text'), | ||
invalidText: figma.string('Error text'), | ||
warnText: figma.string('Warning text'), | ||
labelText: figma.string('Label text'), | ||
hideTextInput: figma.boolean('Inputs', { | ||
false: true, | ||
true: false, | ||
}), | ||
invalidText: figma.string('Error text'), | ||
warnText: figma.string('Warning text'), | ||
disabled: figma.enum('State', { | ||
Disabled: true, | ||
}), | ||
invalid: figma.enum('State', { | ||
'Hover + Error': true, | ||
'Active + Error': true, | ||
'Focused + Error': true, | ||
}), | ||
readOnly: figma.enum('State', { | ||
'Read-only': true, | ||
}), | ||
warn: figma.enum('State', { | ||
'Hover + Warning': true, | ||
'Active + Warning': true, | ||
'Focused + Warning': true, | ||
}), | ||
}, | ||
example: ({ ...props }) => <Slider twoHandles {...props} />, | ||
} | ||
); | ||
|
||
//single | ||
figma.connect( | ||
SliderSkeleton, | ||
'https://www.figma.com/design/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?node-id=3673-40574&m=dev', | ||
{ | ||
variant: { Status: 'Skeleton' }, | ||
example: () => <SliderSkeleton />, | ||
} | ||
); | ||
|
||
//two handle | ||
figma.connect( | ||
SliderSkeleton, | ||
'https://www.figma.com/design/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?node-id=41061-1531&m=dev', | ||
{ | ||
variant: { State: 'Skeleton' }, | ||
example: () => <SliderSkeleton twoHandles />, | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// /** | ||
// * Copyright IBM Corp. 2016, 2024 | ||
// * | ||
// * This source code is licensed under the Apache-2.0 license found in the | ||
// * LICENSE file in the root directory of this source tree. | ||
// */ | ||
|
||
// // @ts-nocheck | ||
// import React from 'react'; | ||
// import { Slider, SliderSkeleton } from '@carbon/react'; | ||
// import figma from '@figma/code-connect'; | ||
|
||
// figma.connect( | ||
// SliderRange, | ||
// "https://www.figma.com/design/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?node-id=41061-1531&m=dev", | ||
// { | ||
// props: { | ||
// maxrangetext3836123: figma.string("Max range text"), | ||
// minrangetext383610: figma.string("Min range text"), | ||
// errortext97969: figma.string("Error text"), | ||
// warningtext97992: figma.string("Warning text"), | ||
// labeltext9790: figma.string("Label text"), | ||
// inputs: figma.boolean("Inputs"), | ||
// state: figma.enum("State", { | ||
// Enabled: "enabled", | ||
// Hover: "hover", | ||
// Active: "active", | ||
// Disabled: "disabled", | ||
// Focused: "focused", | ||
// Skeleton: "skeleton", | ||
// "Read only": "read-only", | ||
// "Hover + Error": "hover---error", | ||
// "Active + Error": "active---error", | ||
// "Focused + Error": "focused---error", | ||
// "Hover + Warning": "hover---warning", | ||
// "Active + Warning": "active---warning", | ||
// "Focused + Warning": "focused---warning", | ||
// }), | ||
// handle: figma.enum("Handle", { | ||
// None: "none", | ||
// Left: "left", | ||
// Right: "right", | ||
// }), | ||
// }, | ||
// example: (props) => <SliderRange />, | ||
// }, | ||
// ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters