@workday/canvas-kit-preview-react 15.0.0-alpha.1326-next.0 → 15.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/color-picker/index.ts +1 -1
- package/color-picker/lib/ColorPicker.tsx +9 -72
- package/color-picker/lib/defaultColorSet.ts +64 -0
- package/color-picker/lib/parts/ColorReset.tsx +8 -8
- package/color-picker/lib/parts/SwatchBook.tsx +8 -7
- package/dist/commonjs/color-picker/index.d.ts +1 -1
- package/dist/commonjs/color-picker/index.d.ts.map +1 -1
- package/dist/commonjs/color-picker/lib/ColorPicker.d.ts.map +1 -1
- package/dist/commonjs/color-picker/lib/ColorPicker.js +10 -67
- package/dist/commonjs/color-picker/lib/defaultColorSet.d.ts +59 -0
- package/dist/commonjs/color-picker/lib/defaultColorSet.d.ts.map +1 -0
- package/dist/commonjs/color-picker/lib/defaultColorSet.js +61 -0
- package/dist/commonjs/color-picker/lib/parts/ColorReset.js +4 -4
- package/dist/commonjs/color-picker/lib/parts/SwatchBook.d.ts.map +1 -1
- package/dist/commonjs/color-picker/lib/parts/SwatchBook.js +4 -4
- package/dist/commonjs/divider/lib/Divider.d.ts +6 -6
- package/dist/commonjs/divider/lib/Divider.d.ts.map +1 -1
- package/dist/commonjs/divider/lib/Divider.js +5 -5
- package/dist/commonjs/index.d.ts +2 -5
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +2 -5
- package/dist/commonjs/loading-sparkles/lib/LoadingSparkles.d.ts.map +1 -1
- package/dist/commonjs/loading-sparkles/lib/LoadingSparkles.js +5 -5
- package/dist/commonjs/loading-sparkles/lib/sparkleIcon.d.ts.map +1 -1
- package/dist/commonjs/loading-sparkles/lib/sparkleIcon.js +1 -1
- package/dist/commonjs/multi-select/lib/MultiSelect.js +3 -3
- package/dist/commonjs/multi-select/lib/MultiSelectCard.d.ts.map +1 -1
- package/dist/commonjs/multi-select/lib/MultiSelectCard.js +1 -1
- package/dist/commonjs/multi-select/lib/MultiSelectInput.d.ts +20 -14
- package/dist/commonjs/multi-select/lib/MultiSelectInput.d.ts.map +1 -1
- package/dist/commonjs/multi-select/lib/MultiSelectInput.js +13 -13
- package/dist/commonjs/multi-select/lib/MultiSelectItem.d.ts.map +1 -1
- package/dist/commonjs/multi-select/lib/MultiSelectItem.js +2 -2
- package/dist/commonjs/multi-select/lib/MultiSelectedItem.js +2 -2
- package/dist/commonjs/multi-select/lib/MultiSelectedList.d.ts.map +1 -1
- package/dist/commonjs/multi-select/lib/MultiSelectedList.js +2 -2
- package/dist/commonjs/multi-select/lib/useMultiSelectItemRemove.d.ts.map +1 -1
- package/dist/commonjs/multi-select/lib/useMultiSelectItemRemove.js +1 -1
- package/dist/commonjs/multi-select/lib/useMultiSelectModel.d.ts.map +1 -1
- package/dist/commonjs/multi-select/lib/useMultiSelectModel.js +2 -2
- package/dist/commonjs/radio/lib/RadioButton.d.ts.map +1 -1
- package/dist/commonjs/radio/lib/RadioButton.js +1 -1
- package/dist/commonjs/radio/lib/RadioGroup.d.ts +1 -1
- package/dist/commonjs/radio/lib/RadioGroup.d.ts.map +1 -1
- package/dist/commonjs/radio/lib/RadioGroup.js +6 -6
- package/dist/commonjs/radio/lib/RadioInput.d.ts.map +1 -1
- package/dist/commonjs/radio/lib/RadioInput.js +1 -1
- package/dist/commonjs/radio/lib/RadioLabel.d.ts +1 -1
- package/dist/commonjs/radio/lib/RadioLabel.d.ts.map +1 -1
- package/dist/commonjs/radio/lib/RadioLabel.js +5 -5
- package/dist/commonjs/radio/lib/RadioText.d.ts.map +1 -1
- package/dist/commonjs/radio/lib/RadioText.js +7 -13
- package/dist/commonjs/radio/lib/StyledRadioButton.d.ts +71 -0
- package/dist/commonjs/radio/lib/StyledRadioButton.d.ts.map +1 -1
- package/dist/commonjs/radio/lib/StyledRadioButton.js +16 -15
- package/dist/commonjs/side-panel/lib/SidePanel.d.ts +16 -1
- package/dist/commonjs/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/commonjs/side-panel/lib/SidePanel.js +15 -9
- package/dist/commonjs/side-panel/lib/SidePanelToggleButton.d.ts +1 -1
- package/dist/commonjs/side-panel/lib/SidePanelToggleButton.d.ts.map +1 -1
- package/dist/commonjs/side-panel/lib/SidePanelToggleButton.js +16 -16
- package/dist/commonjs/side-panel/lib/hooks.d.ts +9 -0
- package/dist/commonjs/side-panel/lib/hooks.d.ts.map +1 -1
- package/dist/commonjs/side-panel/lib/hooks.js +2 -1
- package/dist/commonjs/status-indicator/lib/StatusIndicator.d.ts +12 -16
- package/dist/commonjs/status-indicator/lib/StatusIndicator.d.ts.map +1 -1
- package/dist/commonjs/status-indicator/lib/StatusIndicator.js +17 -18
- package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.d.ts.map +1 -1
- package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.js +4 -0
- package/dist/commonjs/status-indicator/lib/StatusIndicatorLabel.d.ts.map +1 -1
- package/dist/commonjs/status-indicator/lib/StatusIndicatorLabel.js +2 -2
- package/dist/commonjs/switch/index.d.ts +7 -0
- package/dist/commonjs/switch/index.d.ts.map +1 -0
- package/dist/commonjs/{avatar → switch}/index.js +6 -5
- package/dist/commonjs/switch/lib/Switch.d.ts +36 -0
- package/dist/commonjs/switch/lib/Switch.d.ts.map +1 -0
- package/dist/commonjs/switch/lib/Switch.js +20 -0
- package/dist/commonjs/switch/lib/SwitchBackground.d.ts +3 -0
- package/dist/commonjs/switch/lib/SwitchBackground.d.ts.map +1 -0
- package/dist/commonjs/switch/lib/SwitchBackground.js +16 -0
- package/dist/commonjs/switch/lib/SwitchCircle.d.ts +13 -0
- package/dist/commonjs/switch/lib/SwitchCircle.d.ts.map +1 -0
- package/dist/commonjs/switch/lib/SwitchCircle.js +21 -0
- package/dist/commonjs/switch/lib/SwitchContainer.d.ts +3 -0
- package/dist/commonjs/switch/lib/SwitchContainer.d.ts.map +1 -0
- package/dist/commonjs/switch/lib/SwitchContainer.js +16 -0
- package/dist/commonjs/switch/lib/SwitchIcon.d.ts +13 -0
- package/dist/commonjs/switch/lib/SwitchIcon.d.ts.map +1 -0
- package/dist/commonjs/switch/lib/SwitchIcon.js +23 -0
- package/dist/commonjs/switch/lib/SwitchInput.d.ts +17 -0
- package/dist/commonjs/switch/lib/SwitchInput.d.ts.map +1 -0
- package/dist/commonjs/switch/lib/SwitchInput.js +22 -0
- package/dist/commonjs/version/lib/version.js +1 -1
- package/dist/es6/color-picker/index.d.ts +1 -1
- package/dist/es6/color-picker/index.d.ts.map +1 -1
- package/dist/es6/color-picker/lib/ColorPicker.d.ts.map +1 -1
- package/dist/es6/color-picker/lib/ColorPicker.js +8 -65
- package/dist/es6/color-picker/lib/defaultColorSet.d.ts +59 -0
- package/dist/es6/color-picker/lib/defaultColorSet.d.ts.map +1 -0
- package/dist/es6/color-picker/lib/defaultColorSet.js +58 -0
- package/dist/es6/color-picker/lib/parts/ColorReset.js +4 -4
- package/dist/es6/color-picker/lib/parts/SwatchBook.d.ts.map +1 -1
- package/dist/es6/color-picker/lib/parts/SwatchBook.js +4 -4
- package/dist/es6/divider/lib/Divider.d.ts +6 -6
- package/dist/es6/divider/lib/Divider.d.ts.map +1 -1
- package/dist/es6/divider/lib/Divider.js +6 -6
- package/dist/es6/index.d.ts +2 -5
- package/dist/es6/index.d.ts.map +1 -1
- package/dist/es6/index.js +2 -5
- package/dist/es6/loading-sparkles/lib/LoadingSparkles.d.ts.map +1 -1
- package/dist/es6/loading-sparkles/lib/LoadingSparkles.js +5 -5
- package/dist/es6/loading-sparkles/lib/sparkleIcon.d.ts.map +1 -1
- package/dist/es6/loading-sparkles/lib/sparkleIcon.js +1 -1
- package/dist/es6/multi-select/lib/MultiSelect.js +3 -3
- package/dist/es6/multi-select/lib/MultiSelectCard.d.ts.map +1 -1
- package/dist/es6/multi-select/lib/MultiSelectCard.js +1 -1
- package/dist/es6/multi-select/lib/MultiSelectInput.d.ts +20 -14
- package/dist/es6/multi-select/lib/MultiSelectInput.d.ts.map +1 -1
- package/dist/es6/multi-select/lib/MultiSelectInput.js +13 -13
- package/dist/es6/multi-select/lib/MultiSelectItem.d.ts.map +1 -1
- package/dist/es6/multi-select/lib/MultiSelectItem.js +2 -2
- package/dist/es6/multi-select/lib/MultiSelectedItem.js +2 -2
- package/dist/es6/multi-select/lib/MultiSelectedList.d.ts.map +1 -1
- package/dist/es6/multi-select/lib/MultiSelectedList.js +2 -2
- package/dist/es6/multi-select/lib/useMultiSelectItemRemove.d.ts.map +1 -1
- package/dist/es6/multi-select/lib/useMultiSelectItemRemove.js +1 -1
- package/dist/es6/multi-select/lib/useMultiSelectModel.d.ts.map +1 -1
- package/dist/es6/multi-select/lib/useMultiSelectModel.js +2 -2
- package/dist/es6/radio/lib/RadioButton.d.ts.map +1 -1
- package/dist/es6/radio/lib/RadioButton.js +1 -1
- package/dist/es6/radio/lib/RadioGroup.d.ts +1 -1
- package/dist/es6/radio/lib/RadioGroup.d.ts.map +1 -1
- package/dist/es6/radio/lib/RadioGroup.js +7 -7
- package/dist/es6/radio/lib/RadioInput.d.ts.map +1 -1
- package/dist/es6/radio/lib/RadioInput.js +2 -2
- package/dist/es6/radio/lib/RadioLabel.d.ts +1 -1
- package/dist/es6/radio/lib/RadioLabel.d.ts.map +1 -1
- package/dist/es6/radio/lib/RadioLabel.js +5 -5
- package/dist/es6/radio/lib/RadioText.d.ts.map +1 -1
- package/dist/es6/radio/lib/RadioText.js +7 -13
- package/dist/es6/radio/lib/StyledRadioButton.d.ts +71 -0
- package/dist/es6/radio/lib/StyledRadioButton.d.ts.map +1 -1
- package/dist/es6/radio/lib/StyledRadioButton.js +17 -16
- package/dist/es6/side-panel/lib/SidePanel.d.ts +16 -1
- package/dist/es6/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/es6/side-panel/lib/SidePanel.js +15 -9
- package/dist/es6/side-panel/lib/SidePanelToggleButton.d.ts +1 -1
- package/dist/es6/side-panel/lib/SidePanelToggleButton.d.ts.map +1 -1
- package/dist/es6/side-panel/lib/SidePanelToggleButton.js +16 -16
- package/dist/es6/side-panel/lib/hooks.d.ts +9 -0
- package/dist/es6/side-panel/lib/hooks.d.ts.map +1 -1
- package/dist/es6/side-panel/lib/hooks.js +2 -1
- package/dist/es6/status-indicator/lib/StatusIndicator.d.ts +12 -16
- package/dist/es6/status-indicator/lib/StatusIndicator.d.ts.map +1 -1
- package/dist/es6/status-indicator/lib/StatusIndicator.js +17 -18
- package/dist/es6/status-indicator/lib/StatusIndicatorIcon.d.ts.map +1 -1
- package/dist/es6/status-indicator/lib/StatusIndicatorIcon.js +4 -0
- package/dist/es6/status-indicator/lib/StatusIndicatorLabel.d.ts.map +1 -1
- package/dist/es6/status-indicator/lib/StatusIndicatorLabel.js +2 -2
- package/dist/es6/switch/index.d.ts +7 -0
- package/dist/es6/switch/index.d.ts.map +1 -0
- package/dist/es6/switch/index.js +6 -0
- package/dist/es6/switch/lib/Switch.d.ts +36 -0
- package/dist/es6/switch/lib/Switch.d.ts.map +1 -0
- package/dist/es6/switch/lib/Switch.js +17 -0
- package/dist/es6/switch/lib/SwitchBackground.d.ts +3 -0
- package/dist/es6/switch/lib/SwitchBackground.d.ts.map +1 -0
- package/dist/es6/switch/lib/SwitchBackground.js +13 -0
- package/dist/es6/switch/lib/SwitchCircle.d.ts +13 -0
- package/dist/es6/switch/lib/SwitchCircle.d.ts.map +1 -0
- package/dist/es6/switch/lib/SwitchCircle.js +18 -0
- package/dist/es6/switch/lib/SwitchContainer.d.ts +3 -0
- package/dist/es6/switch/lib/SwitchContainer.d.ts.map +1 -0
- package/dist/es6/switch/lib/SwitchContainer.js +13 -0
- package/dist/es6/switch/lib/SwitchIcon.d.ts +13 -0
- package/dist/es6/switch/lib/SwitchIcon.d.ts.map +1 -0
- package/dist/es6/switch/lib/SwitchIcon.js +20 -0
- package/dist/es6/switch/lib/SwitchInput.d.ts +17 -0
- package/dist/es6/switch/lib/SwitchInput.d.ts.map +1 -0
- package/dist/es6/switch/lib/SwitchInput.js +19 -0
- package/dist/es6/version/lib/version.js +1 -1
- package/divider/lib/Divider.tsx +9 -9
- package/index.ts +2 -5
- package/loading-sparkles/lib/LoadingSparkles.tsx +2 -2
- package/loading-sparkles/lib/sparkleIcon.ts +2 -2
- package/multi-select/lib/MultiSelect.tsx +3 -3
- package/multi-select/lib/MultiSelectCard.tsx +2 -2
- package/multi-select/lib/MultiSelectInput.tsx +64 -50
- package/multi-select/lib/MultiSelectItem.tsx +3 -4
- package/multi-select/lib/MultiSelectedItem.tsx +2 -2
- package/multi-select/lib/MultiSelectedList.tsx +2 -2
- package/multi-select/lib/useMultiSelectItemRemove.ts +2 -1
- package/multi-select/lib/useMultiSelectModel.ts +2 -2
- package/package.json +8 -8
- package/radio/lib/RadioButton.tsx +2 -1
- package/radio/lib/RadioGroup.tsx +14 -15
- package/radio/lib/RadioInput.tsx +23 -19
- package/radio/lib/RadioLabel.tsx +7 -6
- package/radio/lib/RadioText.tsx +8 -15
- package/radio/lib/StyledRadioButton.tsx +61 -94
- package/side-panel/lib/SidePanel.tsx +19 -2
- package/side-panel/lib/SidePanelToggleButton.tsx +12 -10
- package/side-panel/lib/hooks.ts +11 -1
- package/status-indicator/lib/StatusIndicator.tsx +23 -27
- package/status-indicator/lib/StatusIndicatorIcon.tsx +4 -0
- package/status-indicator/lib/StatusIndicatorLabel.tsx +1 -1
- package/switch/index.ts +6 -0
- package/switch/lib/Switch.tsx +74 -0
- package/switch/lib/SwitchBackground.tsx +33 -0
- package/switch/lib/SwitchCircle.tsx +37 -0
- package/switch/lib/SwitchContainer.tsx +25 -0
- package/switch/lib/SwitchIcon.tsx +44 -0
- package/switch/lib/SwitchInput.tsx +76 -0
- package/switch/package.json +6 -0
- package/avatar/index.ts +0 -5
- package/avatar/lib/Avatar.tsx +0 -156
- package/avatar/lib/AvatarImage.tsx +0 -20
- package/avatar/lib/AvatarName.tsx +0 -32
- package/avatar/lib/BaseAvatar.tsx +0 -127
- package/avatar/lib/getInitialsFromName.ts +0 -11
- package/avatar/package.json +0 -6
- package/dist/commonjs/avatar/index.d.ts +0 -6
- package/dist/commonjs/avatar/index.d.ts.map +0 -1
- package/dist/commonjs/avatar/lib/Avatar.d.ts +0 -281
- package/dist/commonjs/avatar/lib/Avatar.d.ts.map +0 -1
- package/dist/commonjs/avatar/lib/Avatar.js +0 -53
- package/dist/commonjs/avatar/lib/AvatarImage.d.ts +0 -6
- package/dist/commonjs/avatar/lib/AvatarImage.d.ts.map +0 -1
- package/dist/commonjs/avatar/lib/AvatarImage.js +0 -15
- package/dist/commonjs/avatar/lib/AvatarName.d.ts +0 -14
- package/dist/commonjs/avatar/lib/AvatarName.d.ts.map +0 -1
- package/dist/commonjs/avatar/lib/AvatarName.js +0 -16
- package/dist/commonjs/avatar/lib/BaseAvatar.d.ts +0 -148
- package/dist/commonjs/avatar/lib/BaseAvatar.d.ts.map +0 -1
- package/dist/commonjs/avatar/lib/BaseAvatar.js +0 -47
- package/dist/commonjs/avatar/lib/getInitialsFromName.d.ts +0 -2
- package/dist/commonjs/avatar/lib/getInitialsFromName.d.ts.map +0 -1
- package/dist/commonjs/avatar/lib/getInitialsFromName.js +0 -13
- package/dist/commonjs/information-highlight/index.d.ts +0 -6
- package/dist/commonjs/information-highlight/index.d.ts.map +0 -1
- package/dist/commonjs/information-highlight/index.js +0 -21
- package/dist/commonjs/information-highlight/lib/InformationHighlight.d.ts +0 -76
- package/dist/commonjs/information-highlight/lib/InformationHighlight.d.ts.map +0 -1
- package/dist/commonjs/information-highlight/lib/InformationHighlight.js +0 -42
- package/dist/commonjs/information-highlight/lib/hooks/useInformationHighlightModel.d.ts +0 -23
- package/dist/commonjs/information-highlight/lib/hooks/useInformationHighlightModel.d.ts.map +0 -1
- package/dist/commonjs/information-highlight/lib/hooks/useInformationHighlightModel.js +0 -18
- package/dist/commonjs/information-highlight/lib/parts/Body.d.ts +0 -2
- package/dist/commonjs/information-highlight/lib/parts/Body.d.ts.map +0 -1
- package/dist/commonjs/information-highlight/lib/parts/Body.js +0 -17
- package/dist/commonjs/information-highlight/lib/parts/Heading.d.ts +0 -6
- package/dist/commonjs/information-highlight/lib/parts/Heading.d.ts.map +0 -1
- package/dist/commonjs/information-highlight/lib/parts/Heading.js +0 -17
- package/dist/commonjs/information-highlight/lib/parts/Icon.d.ts +0 -12
- package/dist/commonjs/information-highlight/lib/parts/Icon.d.ts.map +0 -1
- package/dist/commonjs/information-highlight/lib/parts/Icon.js +0 -19
- package/dist/commonjs/information-highlight/lib/parts/Link.d.ts +0 -2
- package/dist/commonjs/information-highlight/lib/parts/Link.d.ts.map +0 -1
- package/dist/commonjs/information-highlight/lib/parts/Link.js +0 -17
- package/dist/commonjs/pill/index.d.ts +0 -8
- package/dist/commonjs/pill/index.d.ts.map +0 -1
- package/dist/commonjs/pill/index.js +0 -23
- package/dist/commonjs/pill/lib/Pill.d.ts +0 -265
- package/dist/commonjs/pill/lib/Pill.d.ts.map +0 -1
- package/dist/commonjs/pill/lib/Pill.js +0 -147
- package/dist/commonjs/pill/lib/PillAvatar.d.ts +0 -526
- package/dist/commonjs/pill/lib/PillAvatar.d.ts.map +0 -1
- package/dist/commonjs/pill/lib/PillAvatar.js +0 -22
- package/dist/commonjs/pill/lib/PillCount.d.ts +0 -12
- package/dist/commonjs/pill/lib/PillCount.d.ts.map +0 -1
- package/dist/commonjs/pill/lib/PillCount.js +0 -21
- package/dist/commonjs/pill/lib/PillIcon.d.ts +0 -54
- package/dist/commonjs/pill/lib/PillIcon.d.ts.map +0 -1
- package/dist/commonjs/pill/lib/PillIcon.js +0 -20
- package/dist/commonjs/pill/lib/PillIconButton.d.ts +0 -148
- package/dist/commonjs/pill/lib/PillIconButton.d.ts.map +0 -1
- package/dist/commonjs/pill/lib/PillIconButton.js +0 -21
- package/dist/commonjs/pill/lib/PillLabel.d.ts +0 -14
- package/dist/commonjs/pill/lib/PillLabel.d.ts.map +0 -1
- package/dist/commonjs/pill/lib/PillLabel.js +0 -17
- package/dist/commonjs/pill/lib/usePillModel.d.ts +0 -46
- package/dist/commonjs/pill/lib/usePillModel.d.ts.map +0 -1
- package/dist/commonjs/pill/lib/usePillModel.js +0 -24
- package/dist/commonjs/segmented-control/index.d.ts +0 -5
- package/dist/commonjs/segmented-control/index.d.ts.map +0 -1
- package/dist/commonjs/segmented-control/index.js +0 -20
- package/dist/commonjs/segmented-control/lib/SegmentedControl.d.ts +0 -1324
- package/dist/commonjs/segmented-control/lib/SegmentedControl.d.ts.map +0 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControl.js +0 -54
- package/dist/commonjs/segmented-control/lib/SegmentedControlItem.d.ts +0 -256
- package/dist/commonjs/segmented-control/lib/SegmentedControlItem.d.ts.map +0 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControlItem.js +0 -114
- package/dist/commonjs/segmented-control/lib/SegmentedControlList.d.ts +0 -153
- package/dist/commonjs/segmented-control/lib/SegmentedControlList.d.ts.map +0 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControlList.js +0 -34
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlItem.d.ts +0 -140
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlItem.d.ts.map +0 -1
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlItem.js +0 -21
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.d.ts +0 -1336
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.d.ts.map +0 -1
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.js +0 -75
- package/dist/commonjs/select/index.d.ts +0 -3
- package/dist/commonjs/select/index.d.ts.map +0 -1
- package/dist/commonjs/select/index.js +0 -17
- package/dist/commonjs/select/lib/Select.d.ts +0 -31
- package/dist/commonjs/select/lib/Select.d.ts.map +0 -1
- package/dist/commonjs/select/lib/Select.js +0 -486
- package/dist/commonjs/select/lib/SelectBase.d.ts +0 -165
- package/dist/commonjs/select/lib/SelectBase.d.ts.map +0 -1
- package/dist/commonjs/select/lib/SelectBase.js +0 -235
- package/dist/commonjs/select/lib/SelectMenu.d.ts +0 -45
- package/dist/commonjs/select/lib/SelectMenu.d.ts.map +0 -1
- package/dist/commonjs/select/lib/SelectMenu.js +0 -195
- package/dist/commonjs/select/lib/SelectOption.d.ts +0 -38
- package/dist/commonjs/select/lib/SelectOption.d.ts.map +0 -1
- package/dist/commonjs/select/lib/SelectOption.js +0 -73
- package/dist/commonjs/select/lib/scrolling.d.ts +0 -5
- package/dist/commonjs/select/lib/scrolling.d.ts.map +0 -1
- package/dist/commonjs/select/lib/scrolling.js +0 -36
- package/dist/commonjs/select/lib/types.d.ts +0 -37
- package/dist/commonjs/select/lib/types.d.ts.map +0 -1
- package/dist/commonjs/select/lib/types.js +0 -2
- package/dist/commonjs/select/lib/utils.d.ts +0 -10
- package/dist/commonjs/select/lib/utils.d.ts.map +0 -1
- package/dist/commonjs/select/lib/utils.js +0 -27
- package/dist/es6/avatar/index.d.ts +0 -6
- package/dist/es6/avatar/index.d.ts.map +0 -1
- package/dist/es6/avatar/index.js +0 -5
- package/dist/es6/avatar/lib/Avatar.d.ts +0 -281
- package/dist/es6/avatar/lib/Avatar.d.ts.map +0 -1
- package/dist/es6/avatar/lib/Avatar.js +0 -47
- package/dist/es6/avatar/lib/AvatarImage.d.ts +0 -6
- package/dist/es6/avatar/lib/AvatarImage.d.ts.map +0 -1
- package/dist/es6/avatar/lib/AvatarImage.js +0 -12
- package/dist/es6/avatar/lib/AvatarName.d.ts +0 -14
- package/dist/es6/avatar/lib/AvatarName.d.ts.map +0 -1
- package/dist/es6/avatar/lib/AvatarName.js +0 -13
- package/dist/es6/avatar/lib/BaseAvatar.d.ts +0 -148
- package/dist/es6/avatar/lib/BaseAvatar.d.ts.map +0 -1
- package/dist/es6/avatar/lib/BaseAvatar.js +0 -44
- package/dist/es6/avatar/lib/getInitialsFromName.d.ts +0 -2
- package/dist/es6/avatar/lib/getInitialsFromName.d.ts.map +0 -1
- package/dist/es6/avatar/lib/getInitialsFromName.js +0 -9
- package/dist/es6/information-highlight/index.d.ts +0 -6
- package/dist/es6/information-highlight/index.d.ts.map +0 -1
- package/dist/es6/information-highlight/index.js +0 -5
- package/dist/es6/information-highlight/lib/InformationHighlight.d.ts +0 -76
- package/dist/es6/information-highlight/lib/InformationHighlight.d.ts.map +0 -1
- package/dist/es6/information-highlight/lib/InformationHighlight.js +0 -39
- package/dist/es6/information-highlight/lib/hooks/useInformationHighlightModel.d.ts +0 -23
- package/dist/es6/information-highlight/lib/hooks/useInformationHighlightModel.d.ts.map +0 -1
- package/dist/es6/information-highlight/lib/hooks/useInformationHighlightModel.js +0 -15
- package/dist/es6/information-highlight/lib/parts/Body.d.ts +0 -2
- package/dist/es6/information-highlight/lib/parts/Body.d.ts.map +0 -1
- package/dist/es6/information-highlight/lib/parts/Body.js +0 -14
- package/dist/es6/information-highlight/lib/parts/Heading.d.ts +0 -6
- package/dist/es6/information-highlight/lib/parts/Heading.d.ts.map +0 -1
- package/dist/es6/information-highlight/lib/parts/Heading.js +0 -14
- package/dist/es6/information-highlight/lib/parts/Icon.d.ts +0 -12
- package/dist/es6/information-highlight/lib/parts/Icon.d.ts.map +0 -1
- package/dist/es6/information-highlight/lib/parts/Icon.js +0 -16
- package/dist/es6/information-highlight/lib/parts/Link.d.ts +0 -2
- package/dist/es6/information-highlight/lib/parts/Link.d.ts.map +0 -1
- package/dist/es6/information-highlight/lib/parts/Link.js +0 -14
- package/dist/es6/pill/index.d.ts +0 -8
- package/dist/es6/pill/index.d.ts.map +0 -1
- package/dist/es6/pill/index.js +0 -7
- package/dist/es6/pill/lib/Pill.d.ts +0 -265
- package/dist/es6/pill/lib/Pill.d.ts.map +0 -1
- package/dist/es6/pill/lib/Pill.js +0 -144
- package/dist/es6/pill/lib/PillAvatar.d.ts +0 -526
- package/dist/es6/pill/lib/PillAvatar.d.ts.map +0 -1
- package/dist/es6/pill/lib/PillAvatar.js +0 -19
- package/dist/es6/pill/lib/PillCount.d.ts +0 -12
- package/dist/es6/pill/lib/PillCount.d.ts.map +0 -1
- package/dist/es6/pill/lib/PillCount.js +0 -18
- package/dist/es6/pill/lib/PillIcon.d.ts +0 -54
- package/dist/es6/pill/lib/PillIcon.d.ts.map +0 -1
- package/dist/es6/pill/lib/PillIcon.js +0 -17
- package/dist/es6/pill/lib/PillIconButton.d.ts +0 -148
- package/dist/es6/pill/lib/PillIconButton.d.ts.map +0 -1
- package/dist/es6/pill/lib/PillIconButton.js +0 -18
- package/dist/es6/pill/lib/PillLabel.d.ts +0 -14
- package/dist/es6/pill/lib/PillLabel.d.ts.map +0 -1
- package/dist/es6/pill/lib/PillLabel.js +0 -14
- package/dist/es6/pill/lib/usePillModel.d.ts +0 -46
- package/dist/es6/pill/lib/usePillModel.d.ts.map +0 -1
- package/dist/es6/pill/lib/usePillModel.js +0 -21
- package/dist/es6/segmented-control/index.d.ts +0 -5
- package/dist/es6/segmented-control/index.d.ts.map +0 -1
- package/dist/es6/segmented-control/index.js +0 -4
- package/dist/es6/segmented-control/lib/SegmentedControl.d.ts +0 -1324
- package/dist/es6/segmented-control/lib/SegmentedControl.d.ts.map +0 -1
- package/dist/es6/segmented-control/lib/SegmentedControl.js +0 -51
- package/dist/es6/segmented-control/lib/SegmentedControlItem.d.ts +0 -256
- package/dist/es6/segmented-control/lib/SegmentedControlItem.d.ts.map +0 -1
- package/dist/es6/segmented-control/lib/SegmentedControlItem.js +0 -88
- package/dist/es6/segmented-control/lib/SegmentedControlList.d.ts +0 -153
- package/dist/es6/segmented-control/lib/SegmentedControlList.d.ts.map +0 -1
- package/dist/es6/segmented-control/lib/SegmentedControlList.js +0 -31
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlItem.d.ts +0 -140
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlItem.d.ts.map +0 -1
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlItem.js +0 -18
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.d.ts +0 -1336
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.d.ts.map +0 -1
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.js +0 -69
- package/dist/es6/select/index.d.ts +0 -3
- package/dist/es6/select/index.d.ts.map +0 -1
- package/dist/es6/select/index.js +0 -1
- package/dist/es6/select/lib/Select.d.ts +0 -31
- package/dist/es6/select/lib/Select.d.ts.map +0 -1
- package/dist/es6/select/lib/Select.js +0 -460
- package/dist/es6/select/lib/SelectBase.d.ts +0 -165
- package/dist/es6/select/lib/SelectBase.d.ts.map +0 -1
- package/dist/es6/select/lib/SelectBase.js +0 -208
- package/dist/es6/select/lib/SelectMenu.d.ts +0 -45
- package/dist/es6/select/lib/SelectMenu.d.ts.map +0 -1
- package/dist/es6/select/lib/SelectMenu.js +0 -191
- package/dist/es6/select/lib/SelectOption.d.ts +0 -38
- package/dist/es6/select/lib/SelectOption.d.ts.map +0 -1
- package/dist/es6/select/lib/SelectOption.js +0 -69
- package/dist/es6/select/lib/scrolling.d.ts +0 -5
- package/dist/es6/select/lib/scrolling.d.ts.map +0 -1
- package/dist/es6/select/lib/scrolling.js +0 -32
- package/dist/es6/select/lib/types.d.ts +0 -37
- package/dist/es6/select/lib/types.d.ts.map +0 -1
- package/dist/es6/select/lib/types.js +0 -1
- package/dist/es6/select/lib/utils.d.ts +0 -10
- package/dist/es6/select/lib/utils.d.ts.map +0 -1
- package/dist/es6/select/lib/utils.js +0 -22
- package/information-highlight/index.ts +0 -5
- package/information-highlight/lib/InformationHighlight.tsx +0 -107
- package/information-highlight/lib/hooks/useInformationHighlightModel.ts +0 -16
- package/information-highlight/lib/parts/Body.tsx +0 -28
- package/information-highlight/lib/parts/Heading.tsx +0 -34
- package/information-highlight/lib/parts/Icon.tsx +0 -29
- package/information-highlight/lib/parts/Link.tsx +0 -29
- package/information-highlight/package.json +0 -6
- package/pill/index.ts +0 -7
- package/pill/lib/Pill.tsx +0 -285
- package/pill/lib/PillAvatar.tsx +0 -35
- package/pill/lib/PillCount.tsx +0 -44
- package/pill/lib/PillIcon.tsx +0 -32
- package/pill/lib/PillIconButton.tsx +0 -86
- package/pill/lib/PillLabel.tsx +0 -32
- package/pill/lib/usePillModel.tsx +0 -23
- package/pill/package.json +0 -6
- package/segmented-control/index.ts +0 -4
- package/segmented-control/lib/SegmentedControl.tsx +0 -57
- package/segmented-control/lib/SegmentedControlItem.tsx +0 -230
- package/segmented-control/lib/SegmentedControlList.tsx +0 -64
- package/segmented-control/lib/hooks/useSegmentedControlItem.tsx +0 -33
- package/segmented-control/lib/hooks/useSegmentedControlModel.tsx +0 -75
- package/segmented-control/package.json +0 -6
- package/select/index.ts +0 -8
- package/select/lib/Select.tsx +0 -595
- package/select/lib/SelectBase.tsx +0 -493
- package/select/lib/SelectMenu.tsx +0 -304
- package/select/lib/SelectOption.tsx +0 -133
- package/select/lib/scrolling.ts +0 -42
- package/select/lib/types.ts +0 -37
- package/select/lib/utils.ts +0 -30
- package/select/package.json +0 -6
package/pill/lib/Pill.tsx
DELETED
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
import {buttonStencil} from '@workday/canvas-kit-react/button';
|
|
2
|
-
import {createContainer, focusRing} from '@workday/canvas-kit-react/common';
|
|
3
|
-
import {Box, BoxProps, mergeStyles} from '@workday/canvas-kit-react/layout';
|
|
4
|
-
import {px2rem, createStencil, cssVar} from '@workday/canvas-kit-styling';
|
|
5
|
-
|
|
6
|
-
import {usePillModel} from './usePillModel';
|
|
7
|
-
|
|
8
|
-
import {PillIcon} from './PillIcon';
|
|
9
|
-
import {PillIconButton} from './PillIconButton';
|
|
10
|
-
import {PillCount, pillCountStencil} from './PillCount';
|
|
11
|
-
import {PillAvatar} from './PillAvatar';
|
|
12
|
-
import {PillLabel} from './PillLabel';
|
|
13
|
-
import {systemIconStencil} from '@workday/canvas-kit-react/icon';
|
|
14
|
-
import {system} from '@workday/canvas-tokens-web';
|
|
15
|
-
|
|
16
|
-
export interface PillProps extends BoxProps {
|
|
17
|
-
/**
|
|
18
|
-
* Defines what kind of pill to render stylistically and its interaction states
|
|
19
|
-
* @default 'default'
|
|
20
|
-
*/
|
|
21
|
-
variant?: 'readOnly' | 'removable';
|
|
22
|
-
/**
|
|
23
|
-
* Determines the max width of the pill. If the pill text is longer than the max width,
|
|
24
|
-
* text will be truncated and a tooltip will show the rest of the content when hovered over
|
|
25
|
-
*/
|
|
26
|
-
maxWidth?: string | number;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export const pillStencil = createStencil({
|
|
30
|
-
extends: buttonStencil,
|
|
31
|
-
vars: {
|
|
32
|
-
maxWidth: '',
|
|
33
|
-
},
|
|
34
|
-
base: ({maxWidth}) => ({
|
|
35
|
-
display: 'initial',
|
|
36
|
-
flexDirection: 'row',
|
|
37
|
-
alignItems: 'center',
|
|
38
|
-
borderRadius: system.shape.x1,
|
|
39
|
-
...system.type.subtext.large,
|
|
40
|
-
lineHeight: system.lineHeight.subtext.small, // ensure correct line height when there's no elements and just text
|
|
41
|
-
boxShadow: 'none',
|
|
42
|
-
outline: 'none',
|
|
43
|
-
fontWeight: system.fontWeight.medium,
|
|
44
|
-
WebkitFontSmoothing: 'antialiased',
|
|
45
|
-
MozOsxFontSmoothing: 'grayscale',
|
|
46
|
-
width: 'fit-content',
|
|
47
|
-
padding: `${px2rem(2)} ${cssVar(system.space.x2)}`,
|
|
48
|
-
height: system.space.x6,
|
|
49
|
-
position: 'relative',
|
|
50
|
-
gap: system.space.x1,
|
|
51
|
-
maxWidth,
|
|
52
|
-
whiteSpace: 'nowrap',
|
|
53
|
-
textOverflow: 'ellipsis',
|
|
54
|
-
overflow: 'hidden',
|
|
55
|
-
[buttonStencil.vars.background]: system.color.bg.alt.default,
|
|
56
|
-
[buttonStencil.vars.border]: system.color.border.input.default,
|
|
57
|
-
[buttonStencil.vars.label]: system.color.fg.strong,
|
|
58
|
-
[systemIconStencil.vars.color]: 'currentColor',
|
|
59
|
-
[pillCountStencil.vars.borderColor]: 'transparent',
|
|
60
|
-
|
|
61
|
-
'&:has(span)': {
|
|
62
|
-
display: 'flex',
|
|
63
|
-
lineHeight: system.lineHeight.subtext.large, // ensure correct line height
|
|
64
|
-
},
|
|
65
|
-
'&:hover, &.hover': {
|
|
66
|
-
[buttonStencil.vars.background]: system.color.bg.alt.strong,
|
|
67
|
-
[buttonStencil.vars.border]: system.color.border.input.strong,
|
|
68
|
-
[buttonStencil.vars.label]: system.color.fg.strong,
|
|
69
|
-
[systemIconStencil.vars.color]: 'currentColor',
|
|
70
|
-
[pillCountStencil.vars.backgroundColor]: system.color.bg.muted.softer,
|
|
71
|
-
[pillCountStencil.vars.borderColor]: 'transparent',
|
|
72
|
-
},
|
|
73
|
-
'&:active, &.active': {
|
|
74
|
-
[buttonStencil.vars.background]: system.color.bg.alt.stronger,
|
|
75
|
-
[buttonStencil.vars.border]: system.color.border.input.strong,
|
|
76
|
-
[buttonStencil.vars.label]: system.color.fg.strong,
|
|
77
|
-
[systemIconStencil.vars.color]: 'currentColor',
|
|
78
|
-
[pillCountStencil.vars.backgroundColor]: system.color.bg.muted.softer,
|
|
79
|
-
[pillCountStencil.vars.borderColor]: 'transparent',
|
|
80
|
-
},
|
|
81
|
-
'&:focus-visible, &.focus': {
|
|
82
|
-
[buttonStencil.vars.background]: system.color.bg.alt.default,
|
|
83
|
-
[buttonStencil.vars.border]: system.color.border.primary.default,
|
|
84
|
-
[buttonStencil.vars.label]: system.color.fg.strong,
|
|
85
|
-
borderColor: system.color.border.primary.default,
|
|
86
|
-
[systemIconStencil.vars.color]: 'currentColor',
|
|
87
|
-
[pillCountStencil.vars.borderColor]: system.color.border.primary.default,
|
|
88
|
-
|
|
89
|
-
...focusRing({
|
|
90
|
-
width: 0,
|
|
91
|
-
inset: 'inner',
|
|
92
|
-
innerColor: system.color.border.primary.default,
|
|
93
|
-
outerColor: system.color.border.primary.default,
|
|
94
|
-
separation: 1,
|
|
95
|
-
}),
|
|
96
|
-
},
|
|
97
|
-
'&:disabled, &.disabled': {
|
|
98
|
-
[buttonStencil.vars.background]: system.color.bg.alt.default,
|
|
99
|
-
[buttonStencil.vars.border]: system.color.border.input.disabled,
|
|
100
|
-
[buttonStencil.vars.label]: system.color.fg.disabled,
|
|
101
|
-
[systemIconStencil.vars.color]: 'currentColor',
|
|
102
|
-
[pillCountStencil.vars.backgroundColor]: system.color.bg.alt.strong,
|
|
103
|
-
[pillCountStencil.vars.borderColor]: 'transparent',
|
|
104
|
-
},
|
|
105
|
-
}),
|
|
106
|
-
modifiers: {
|
|
107
|
-
variant: {
|
|
108
|
-
readOnly: {
|
|
109
|
-
border: `${px2rem(1)} solid ${system.color.border.container}`,
|
|
110
|
-
cursor: 'default',
|
|
111
|
-
[buttonStencil.vars.background]: system.color.bg.default,
|
|
112
|
-
'&:hover, &.hover': {
|
|
113
|
-
borderColor: system.color.border.container,
|
|
114
|
-
[buttonStencil.vars.background]: system.color.bg.default,
|
|
115
|
-
},
|
|
116
|
-
'&:focus-visible, &.focus': {
|
|
117
|
-
[buttonStencil.vars.background]: system.color.bg.default,
|
|
118
|
-
},
|
|
119
|
-
'&:active, &.active': {
|
|
120
|
-
[buttonStencil.vars.background]: system.color.bg.default,
|
|
121
|
-
},
|
|
122
|
-
'&:disabled, &.disabled': {
|
|
123
|
-
[buttonStencil.vars.background]: system.color.bg.default,
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
removable: {
|
|
127
|
-
'&:focus-visible, &.focus': {
|
|
128
|
-
[buttonStencil.vars.background]: system.color.bg.alt.default,
|
|
129
|
-
[buttonStencil.vars.border]: system.color.border.input.default,
|
|
130
|
-
[buttonStencil.vars.label]: system.color.fg.strong,
|
|
131
|
-
boxShadow: 'none',
|
|
132
|
-
},
|
|
133
|
-
'&:hover, &.hover': {
|
|
134
|
-
[buttonStencil.vars.background]: system.color.bg.alt.strong,
|
|
135
|
-
},
|
|
136
|
-
'&:active, &.active': {
|
|
137
|
-
[buttonStencil.vars.background]: system.color.bg.alt.stronger,
|
|
138
|
-
},
|
|
139
|
-
'&:disabled, &.disabled': {
|
|
140
|
-
[buttonStencil.vars.background]: system.color.bg.alt.default,
|
|
141
|
-
[systemIconStencil.vars.color]: 'currentColor',
|
|
142
|
-
},
|
|
143
|
-
cursor: 'default',
|
|
144
|
-
overflow: 'revert', // override BaseButton overflow styles so the click target exists outside the pill for removable
|
|
145
|
-
position: 'relative',
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* By default, a `Pill` renders an interactive element that accepts subcomponents. By "interactive"
|
|
153
|
-
* we mean that the Pill container is a focusable element (a `<button>`). All leading elements
|
|
154
|
-
* (icons or avatars) are intended to be descriptive, helping support the label. They should not
|
|
155
|
-
* receive focus.
|
|
156
|
-
*
|
|
157
|
-
* `Pill` is the container component. It also provides a React context model for its subcomponents.
|
|
158
|
-
* Based on the `variant` prop this component will render different styled `Pill`s.
|
|
159
|
-
*
|
|
160
|
-
* Example of read only:
|
|
161
|
-
*
|
|
162
|
-
* ```tsx
|
|
163
|
-
* <Pill variant="readOnly">This is a read only</Pill>
|
|
164
|
-
* ```
|
|
165
|
-
*
|
|
166
|
-
* Example of interactive:
|
|
167
|
-
*
|
|
168
|
-
* ```tsx
|
|
169
|
-
* <Pill onClick={() => console.log('clicked')}>
|
|
170
|
-
* <Pill.Avatar /> Regina Skeltor
|
|
171
|
-
* </Pill>
|
|
172
|
-
* ```
|
|
173
|
-
*
|
|
174
|
-
* Example of removable:
|
|
175
|
-
*
|
|
176
|
-
* ```tsx
|
|
177
|
-
* <Pill variant="removable">
|
|
178
|
-
* <Pill.Avatar /> Regina Skeltor
|
|
179
|
-
* <Pill.IconButton aria-label='Remove user' onClick={() => console.log('clicked')} />
|
|
180
|
-
* </Pill>
|
|
181
|
-
* ```
|
|
182
|
-
*
|
|
183
|
-
* If you set the `Pill` `variant` to `removable`, it will render a `<span>` element. You can then
|
|
184
|
-
* provide a `Pill.IconButton` that acts as the focus target. This creates a smaller, more
|
|
185
|
-
* intentional click target that prevents users from accidentally deleting an item.
|
|
186
|
-
*
|
|
187
|
-
* ```tsx
|
|
188
|
-
* <Pill variant="removable">
|
|
189
|
-
* Shoes
|
|
190
|
-
* <Pill.IconButton aria-label='Remove user' onClick={() => console.log('handle remove')} />
|
|
191
|
-
* </Pill>
|
|
192
|
-
* ```
|
|
193
|
-
*/
|
|
194
|
-
export const Pill = createContainer('button')({
|
|
195
|
-
displayName: 'Pill',
|
|
196
|
-
modelHook: usePillModel,
|
|
197
|
-
subComponents: {
|
|
198
|
-
/**
|
|
199
|
-
* This component renders an avatar. It supports all props of the `Avatar` component.
|
|
200
|
-
*
|
|
201
|
-
* ```tsx
|
|
202
|
-
* <Pill variant="removable">
|
|
203
|
-
* <Pill.Avatar url={avatarUrl} />
|
|
204
|
-
* <Pill.Label>Regina Skeltor</Pill.Label>
|
|
205
|
-
* <Pill.IconButton aria-label='Remove user' onClick={() => console.log('handle remove')} />
|
|
206
|
-
* </Pill>
|
|
207
|
-
* ```
|
|
208
|
-
*/
|
|
209
|
-
Avatar: PillAvatar,
|
|
210
|
-
/**
|
|
211
|
-
* This component renders its `children` as the count.
|
|
212
|
-
*
|
|
213
|
-
* ```tsx
|
|
214
|
-
* <Pill onClick={() => console.warn('clicked')}>
|
|
215
|
-
* <Pill.Label>Shoes</Pill.Label>
|
|
216
|
-
* <Pill.Count>30</Pill.Count>
|
|
217
|
-
* </Pill>
|
|
218
|
-
* ```
|
|
219
|
-
*/
|
|
220
|
-
Count: PillCount,
|
|
221
|
-
/**
|
|
222
|
-
* This component renders an `icon`. By default it renders a `plusIcon` but it can be overridden by
|
|
223
|
-
* providing an icon to the `icon` prop. You must provide an `aria-label` for the icon.
|
|
224
|
-
*
|
|
225
|
-
* ```tsx
|
|
226
|
-
* <Pill onClick={() => console.warn('clicked')}>
|
|
227
|
-
* <Pill.Icon aria-label='Add user' />
|
|
228
|
-
* <Pill.Label>Regina Skeltor</Pill.Label>
|
|
229
|
-
* </Pill>
|
|
230
|
-
* ```
|
|
231
|
-
*/
|
|
232
|
-
Icon: PillIcon,
|
|
233
|
-
/**
|
|
234
|
-
* This component renders a custom icon button. It is only intended to be used with the
|
|
235
|
-
* `removable` variant. By default, it renders a `xSmallIcon` but can be overridden by providing
|
|
236
|
-
* an icon to the `icon` prop.
|
|
237
|
-
*
|
|
238
|
-
* ```tsx
|
|
239
|
-
* <Pill variant="removable">
|
|
240
|
-
* <Pill.Label>Pink Shirts</Pill.Label>
|
|
241
|
-
* <Pill.IconButton aria-label='Remove item' onClick={() => console.warn('clicked')} />
|
|
242
|
-
* </Pill>
|
|
243
|
-
* ```
|
|
244
|
-
*/
|
|
245
|
-
IconButton: PillIconButton,
|
|
246
|
-
/**
|
|
247
|
-
* This component renders a `<span>` that automatically handles overflow by rendering a tooltip.
|
|
248
|
-
* There's no need to use this component directly since the overflow is handled for you automatically unless you have an icon or other element.
|
|
249
|
-
*
|
|
250
|
-
* ```tsx
|
|
251
|
-
* <Pill variant="readOnly">
|
|
252
|
-
* <Pill.Label>Read-only</Pill.Label>
|
|
253
|
-
* </Pill>
|
|
254
|
-
* ```
|
|
255
|
-
*/
|
|
256
|
-
Label: PillLabel,
|
|
257
|
-
},
|
|
258
|
-
})<PillProps>(({variant, maxWidth = 200, children, ...elemProps}, Element, model) => {
|
|
259
|
-
const maxWidthCSSValue = typeof maxWidth === 'number' ? px2rem(maxWidth) : maxWidth;
|
|
260
|
-
|
|
261
|
-
const isReadOnly = variant === 'readOnly';
|
|
262
|
-
|
|
263
|
-
return variant?.match(/^(readOnly|removable)$/) ? (
|
|
264
|
-
<Box
|
|
265
|
-
as={Element !== 'button' ? Element : 'span'}
|
|
266
|
-
id={isReadOnly ? model.state.id : undefined}
|
|
267
|
-
{...mergeStyles(elemProps, [
|
|
268
|
-
model.state.disabled ? 'disabled' : undefined,
|
|
269
|
-
pillStencil({maxWidth: maxWidthCSSValue, variant}),
|
|
270
|
-
])}
|
|
271
|
-
>
|
|
272
|
-
{isReadOnly ? <PillLabel>{children}</PillLabel> : children}
|
|
273
|
-
</Box>
|
|
274
|
-
) : (
|
|
275
|
-
<Element
|
|
276
|
-
disabled={model.state.disabled}
|
|
277
|
-
{...mergeStyles(elemProps, [
|
|
278
|
-
model.state.disabled ? 'disabled' : undefined,
|
|
279
|
-
pillStencil({maxWidth: maxWidthCSSValue}),
|
|
280
|
-
])}
|
|
281
|
-
>
|
|
282
|
-
{children}
|
|
283
|
-
</Element>
|
|
284
|
-
);
|
|
285
|
-
});
|
package/pill/lib/PillAvatar.tsx
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import {createSubcomponent} from '@workday/canvas-kit-react/common';
|
|
2
|
-
import {Avatar, AvatarProps, avatarStencil} from '@workday/canvas-kit-preview-react/avatar';
|
|
3
|
-
import {usePillModel} from './usePillModel';
|
|
4
|
-
import {createStencil, px2rem} from '@workday/canvas-kit-styling';
|
|
5
|
-
import {mergeStyles} from '@workday/canvas-kit-react/layout';
|
|
6
|
-
import {system} from '@workday/canvas-tokens-web';
|
|
7
|
-
|
|
8
|
-
export interface PillAvatarProps extends AvatarProps {}
|
|
9
|
-
|
|
10
|
-
export const pillAvatarStencil = createStencil({
|
|
11
|
-
extends: avatarStencil,
|
|
12
|
-
base: {
|
|
13
|
-
flex: '0 0 auto',
|
|
14
|
-
...system.type.subtext.small,
|
|
15
|
-
'&:disabled, &.disabled': {
|
|
16
|
-
opacity: system.opacity.disabled,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
export const PillAvatar = createSubcomponent('div')({
|
|
22
|
-
modelHook: usePillModel,
|
|
23
|
-
})<PillAvatarProps>(({size, ...elemProps}: PillAvatarProps, Element, _model) => {
|
|
24
|
-
return (
|
|
25
|
-
<Avatar
|
|
26
|
-
isDecorative
|
|
27
|
-
as={Element}
|
|
28
|
-
size={px2rem(18)}
|
|
29
|
-
{...mergeStyles(elemProps, [
|
|
30
|
-
pillAvatarStencil(),
|
|
31
|
-
_model.state.disabled ? 'disabled' : undefined,
|
|
32
|
-
])}
|
|
33
|
-
/>
|
|
34
|
-
);
|
|
35
|
-
});
|
package/pill/lib/PillCount.tsx
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import {createComponent} from '@workday/canvas-kit-react/common';
|
|
2
|
-
import {FlexProps, mergeStyles} from '@workday/canvas-kit-react/layout';
|
|
3
|
-
import {calc, createStencil, cssVar, px2rem} from '@workday/canvas-kit-styling';
|
|
4
|
-
import {system} from '@workday/canvas-tokens-web';
|
|
5
|
-
|
|
6
|
-
export interface PillCountProps extends FlexProps {}
|
|
7
|
-
|
|
8
|
-
export const pillCountStencil = createStencil({
|
|
9
|
-
vars: {
|
|
10
|
-
backgroundColor: '',
|
|
11
|
-
borderColor: '',
|
|
12
|
-
},
|
|
13
|
-
base: ({backgroundColor, borderColor}) => ({
|
|
14
|
-
borderStartStartRadius: system.shape.zero,
|
|
15
|
-
borderStartEndRadius: system.shape.x1,
|
|
16
|
-
borderEndStartRadius: system.shape.zero,
|
|
17
|
-
borderEndEndRadius: system.shape.x1,
|
|
18
|
-
borderWidth: px2rem(1),
|
|
19
|
-
borderInlineStartWidth: system.space.zero,
|
|
20
|
-
borderStyle: 'solid',
|
|
21
|
-
borderColor: cssVar(borderColor, system.color.border.transparent),
|
|
22
|
-
display: 'inline-flex',
|
|
23
|
-
alignItems: 'center',
|
|
24
|
-
justifyContent: 'center',
|
|
25
|
-
height: px2rem(22),
|
|
26
|
-
width: system.space.x6,
|
|
27
|
-
padding: `${system.space.zero} ${system.space.x1}`,
|
|
28
|
-
marginInlineEnd: calc.negate(system.space.x2),
|
|
29
|
-
marginInlineStart: system.space.x1,
|
|
30
|
-
backgroundColor: cssVar(backgroundColor, system.color.bg.alt.stronger),
|
|
31
|
-
flex: '0 0 auto',
|
|
32
|
-
}),
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
export const PillCount = createComponent('span')({
|
|
36
|
-
displayName: 'Pill.Count',
|
|
37
|
-
Component: ({children, ...elemProps}: PillCountProps, ref, Element) => {
|
|
38
|
-
return (
|
|
39
|
-
<Element ref={ref} {...mergeStyles(elemProps, pillCountStencil())}>
|
|
40
|
-
{children}
|
|
41
|
-
</Element>
|
|
42
|
-
);
|
|
43
|
-
},
|
|
44
|
-
});
|
package/pill/lib/PillIcon.tsx
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {createSubcomponent} from '@workday/canvas-kit-react/common';
|
|
2
|
-
|
|
3
|
-
import {SystemIcon, SystemIconProps, systemIconStencil} from '@workday/canvas-kit-react/icon';
|
|
4
|
-
import {usePillModel} from './usePillModel';
|
|
5
|
-
import {plusIcon} from '@workday/canvas-system-icons-web';
|
|
6
|
-
import {calc, createStencil, px2rem} from '@workday/canvas-kit-styling';
|
|
7
|
-
import {system} from '@workday/canvas-tokens-web';
|
|
8
|
-
import {mergeStyles} from '@workday/canvas-kit-react/layout';
|
|
9
|
-
|
|
10
|
-
export interface PillIconProps extends Partial<SystemIconProps> {}
|
|
11
|
-
|
|
12
|
-
export const pillIconStencil = createStencil({
|
|
13
|
-
extends: systemIconStencil,
|
|
14
|
-
base: {
|
|
15
|
-
marginInlineStart: calc.negate(system.space.x1),
|
|
16
|
-
[systemIconStencil.vars.size]: px2rem(20),
|
|
17
|
-
flex: '0 0 auto',
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
export const PillIcon = createSubcomponent('span')({
|
|
22
|
-
modelHook: usePillModel,
|
|
23
|
-
})<PillIconProps>(({icon, ...elemProps}, Element) => {
|
|
24
|
-
return (
|
|
25
|
-
<SystemIcon
|
|
26
|
-
as={Element}
|
|
27
|
-
role="img"
|
|
28
|
-
icon={icon || plusIcon}
|
|
29
|
-
{...mergeStyles(elemProps, pillIconStencil())}
|
|
30
|
-
/>
|
|
31
|
-
);
|
|
32
|
-
});
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import {focusRing, createSubcomponent} from '@workday/canvas-kit-react/common';
|
|
2
|
-
import {SystemIcon, SystemIconProps, systemIconStencil} from '@workday/canvas-kit-react/icon';
|
|
3
|
-
import {usePillModel} from './usePillModel';
|
|
4
|
-
import {xSmallIcon} from '@workday/canvas-system-icons-web';
|
|
5
|
-
import {buttonStencil} from '@workday/canvas-kit-react/button';
|
|
6
|
-
import {calc, createStencil, px2rem} from '@workday/canvas-kit-styling';
|
|
7
|
-
import {system} from '@workday/canvas-tokens-web';
|
|
8
|
-
import {mergeStyles} from '@workday/canvas-kit-react/layout';
|
|
9
|
-
|
|
10
|
-
export interface PillIconButtonProps extends Partial<SystemIconProps> {
|
|
11
|
-
/**
|
|
12
|
-
* The aria label for the removable icon. You must provide a valid string to represent the action.
|
|
13
|
-
*/
|
|
14
|
-
'aria-label'?: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const pillIconButtonStencil = createStencil({
|
|
18
|
-
extends: buttonStencil,
|
|
19
|
-
base: {
|
|
20
|
-
marginInlineEnd: calc.negate(px2rem(7)), // visually pull in the pill to the right size by -7px
|
|
21
|
-
marginInlineStart: calc.negate(px2rem(2)), // visually create space between label and the button by -2px
|
|
22
|
-
borderRadius: system.shape.half,
|
|
23
|
-
height: calc.add(system.space.x4, system.space.x1),
|
|
24
|
-
width: calc.add(system.space.x4, system.space.x1),
|
|
25
|
-
padding: system.space.zero,
|
|
26
|
-
overflow: 'visible',
|
|
27
|
-
flex: '0 0 auto',
|
|
28
|
-
[buttonStencil.vars.border]: system.color.border.transparent,
|
|
29
|
-
[buttonStencil.vars.background]: system.color.bg.alt.default,
|
|
30
|
-
[systemIconStencil.vars.color]: system.color.fg.strong,
|
|
31
|
-
[systemIconStencil.vars.size]: system.space.x6,
|
|
32
|
-
'::after': {
|
|
33
|
-
content: '""',
|
|
34
|
-
height: system.space.x8,
|
|
35
|
-
width: system.space.x8,
|
|
36
|
-
position: 'absolute',
|
|
37
|
-
left: calc.negate(px2rem(7)),
|
|
38
|
-
bottom: calc.negate(px2rem(7)),
|
|
39
|
-
margin: system.space.zero,
|
|
40
|
-
pointerEvents: 'all',
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
'&:focus-visible, &.focus': {
|
|
44
|
-
[buttonStencil.vars.border]: system.color.border.transparent,
|
|
45
|
-
[buttonStencil.vars.background]: system.color.bg.alt.default,
|
|
46
|
-
...focusRing({
|
|
47
|
-
innerColor: system.color.border.transparent,
|
|
48
|
-
}),
|
|
49
|
-
},
|
|
50
|
-
'&:hover, &.hover': {
|
|
51
|
-
[buttonStencil.vars.border]: system.color.border.transparent,
|
|
52
|
-
[buttonStencil.vars.background]: system.color.bg.alt.strong,
|
|
53
|
-
},
|
|
54
|
-
'&:active, &.active': {
|
|
55
|
-
[buttonStencil.vars.border]: system.color.border.transparent,
|
|
56
|
-
[buttonStencil.vars.background]: system.color.bg.alt.stronger,
|
|
57
|
-
},
|
|
58
|
-
'&:disabled, &.disabled': {
|
|
59
|
-
[buttonStencil.vars.border]: system.color.border.transparent,
|
|
60
|
-
[buttonStencil.vars.background]: system.color.bg.alt.default,
|
|
61
|
-
[systemIconStencil.vars.color]: system.color.fg.disabled,
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
export const PillIconButton = createSubcomponent('button')({
|
|
67
|
-
modelHook: usePillModel,
|
|
68
|
-
})<PillIconButtonProps>(
|
|
69
|
-
({size, icon, children, 'aria-label': ariaLabel = '', ...elemProps}, Element, model) => {
|
|
70
|
-
return (
|
|
71
|
-
<Element
|
|
72
|
-
disabled={model.state.disabled}
|
|
73
|
-
aria-labelledby={`removable-${model.state.id} label-${model.state.id}`}
|
|
74
|
-
{...mergeStyles(elemProps, pillIconButtonStencil())}
|
|
75
|
-
>
|
|
76
|
-
<SystemIcon
|
|
77
|
-
aria-label={ariaLabel}
|
|
78
|
-
id={`removable-${model.state.id}`}
|
|
79
|
-
icon={icon || xSmallIcon}
|
|
80
|
-
aria-hidden // This works for Chrome but not needed in Safari
|
|
81
|
-
role="img"
|
|
82
|
-
/>
|
|
83
|
-
</Element>
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
);
|
package/pill/lib/PillLabel.tsx
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {createSubcomponent} from '@workday/canvas-kit-react/common';
|
|
2
|
-
import {BoxProps, mergeStyles} from '@workday/canvas-kit-react/layout';
|
|
3
|
-
import {OverflowTooltip, OverflowTooltipProps} from '@workday/canvas-kit-react/tooltip';
|
|
4
|
-
|
|
5
|
-
import {usePillModel} from './usePillModel';
|
|
6
|
-
|
|
7
|
-
import {createStencil} from '@workday/canvas-kit-styling';
|
|
8
|
-
|
|
9
|
-
export interface PillLabelProps extends BoxProps {
|
|
10
|
-
tooltipProps?: Omit<OverflowTooltipProps, 'children'>;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const pillLabelStencil = createStencil({
|
|
14
|
-
base: {
|
|
15
|
-
flexShrink: 1,
|
|
16
|
-
whiteSpace: 'nowrap',
|
|
17
|
-
textOverflow: 'ellipsis',
|
|
18
|
-
overflow: 'hidden',
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
export const PillLabel = createSubcomponent('span')({
|
|
23
|
-
modelHook: usePillModel,
|
|
24
|
-
})<PillLabelProps>(({tooltipProps, children, ...elemProps}, Element, model) => {
|
|
25
|
-
return (
|
|
26
|
-
<OverflowTooltip {...tooltipProps}>
|
|
27
|
-
<Element id={`label-${model.state.id}`} {...mergeStyles(elemProps, pillLabelStencil())}>
|
|
28
|
-
{children}
|
|
29
|
-
</Element>
|
|
30
|
-
</OverflowTooltip>
|
|
31
|
-
);
|
|
32
|
-
});
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import {createModelHook, useUniqueId} from '@workday/canvas-kit-react/common';
|
|
2
|
-
|
|
3
|
-
export const usePillModel = createModelHook({
|
|
4
|
-
defaultConfig: {
|
|
5
|
-
/**
|
|
6
|
-
* Used to disable a pill and apply the correct styles.
|
|
7
|
-
*/
|
|
8
|
-
disabled: false,
|
|
9
|
-
/**
|
|
10
|
-
* ID used to add accessibility labels to pill elements.
|
|
11
|
-
* @default `useUniqueId()`
|
|
12
|
-
*/
|
|
13
|
-
id: '',
|
|
14
|
-
},
|
|
15
|
-
})(config => {
|
|
16
|
-
const id = useUniqueId(config.id);
|
|
17
|
-
const state = {
|
|
18
|
-
...config,
|
|
19
|
-
id,
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
return {state, events: {}};
|
|
23
|
-
});
|
package/pill/package.json
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {createContainer} from '@workday/canvas-kit-react/common';
|
|
3
|
-
|
|
4
|
-
import {useSegmentedControlModel} from './hooks/useSegmentedControlModel';
|
|
5
|
-
import {SegmentedControlList} from './SegmentedControlList';
|
|
6
|
-
import {SegmentedControlItem} from './SegmentedControlItem';
|
|
7
|
-
|
|
8
|
-
export interface SegmentedControlProps {
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* `SegmentedControl` is a container component that is responsible for creating a
|
|
14
|
-
* {@link SegmentedControlModel} and sharing it with its subcomponents using React context. It does
|
|
15
|
-
* not represent a real element.
|
|
16
|
-
*
|
|
17
|
-
* ```tsx
|
|
18
|
-
* <SegmentedControl items={[]}>{Child components}</SegmentedControl>
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
* Alternatively, you may pass in a model using the [hoisted model
|
|
22
|
-
* pattern](/getting-started/for-developers/resources/compound-components/#configuring-a-model).
|
|
23
|
-
*
|
|
24
|
-
* ```tsx
|
|
25
|
-
* const model = useSegmentedControlModel({
|
|
26
|
-
* items: [],
|
|
27
|
-
* });
|
|
28
|
-
*
|
|
29
|
-
* <SegmentedControl model={model}>{Child components}</SegmentedControl>;
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
export const SegmentedControl = createContainer()({
|
|
33
|
-
displayName: 'SegmentedControl',
|
|
34
|
-
modelHook: useSegmentedControlModel,
|
|
35
|
-
subComponents: {
|
|
36
|
-
/**
|
|
37
|
-
* `SegmentedControl.List` renders {@link Grid} under the hood. It is a container for
|
|
38
|
-
* {@link SegmentedControlItem SegmentedControl.Item} subcomponents.
|
|
39
|
-
*
|
|
40
|
-
* ```tsx
|
|
41
|
-
* <SegmentedControl.List>{SegmentedControl.Items}</SegmentedControl.List>
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
List: SegmentedControlList,
|
|
45
|
-
/**
|
|
46
|
-
* `SegmentedControl.Item` is a `button` element built on `BaseButton`. `SegmentedControl.Item`
|
|
47
|
-
* has a `data-id` prop to handle `onSelect` properly.
|
|
48
|
-
*
|
|
49
|
-
* ```tsx
|
|
50
|
-
* <SegmentedControl.Item data-id="table">Table</SegmentedControl.Item>
|
|
51
|
-
* ```
|
|
52
|
-
*/
|
|
53
|
-
Item: SegmentedControlItem,
|
|
54
|
-
},
|
|
55
|
-
})<SegmentedControlProps>(({children}) => {
|
|
56
|
-
return <>{children}</>;
|
|
57
|
-
});
|