@workday/canvas-kit-preview-react 13.0.0-alpha.996-next.0 → 13.0.0
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/lib/parts/ColorReset.tsx +0 -1
- package/dist/commonjs/color-picker/lib/ColorPicker.d.ts +1 -1
- package/dist/commonjs/color-picker/lib/ColorPicker.js +2 -8
- package/dist/commonjs/color-picker/lib/parts/ColorReset.d.ts +1 -2
- package/dist/commonjs/color-picker/lib/parts/ColorReset.d.ts.map +1 -1
- package/dist/commonjs/color-picker/lib/parts/ColorReset.js +2 -27
- package/dist/commonjs/color-picker/lib/parts/SwatchBook.d.ts +1 -2
- package/dist/commonjs/color-picker/lib/parts/SwatchBook.d.ts.map +1 -1
- package/dist/commonjs/color-picker/lib/parts/SwatchBook.js +9 -33
- package/dist/commonjs/divider/lib/Divider.d.ts +2 -2
- package/dist/commonjs/divider/lib/Divider.d.ts.map +1 -1
- package/dist/commonjs/divider/lib/Divider.js +4 -27
- package/dist/commonjs/index.d.ts +1 -2
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +1 -2
- package/dist/commonjs/{InformationHighlight → information-highlight}/index.d.ts.map +1 -1
- package/dist/commonjs/{InformationHighlight → information-highlight}/lib/InformationHighlight.d.ts +2 -2
- package/dist/commonjs/information-highlight/lib/InformationHighlight.d.ts.map +1 -0
- package/dist/commonjs/information-highlight/lib/InformationHighlight.js +42 -0
- package/dist/commonjs/information-highlight/lib/hooks/useInformationHighlightModel.d.ts.map +1 -0
- package/dist/commonjs/information-highlight/lib/parts/Body.d.ts +2 -0
- package/dist/commonjs/information-highlight/lib/parts/Body.d.ts.map +1 -0
- package/dist/commonjs/information-highlight/lib/parts/Body.js +17 -0
- package/dist/commonjs/information-highlight/lib/parts/Heading.d.ts.map +1 -0
- package/dist/commonjs/information-highlight/lib/parts/Heading.js +17 -0
- package/dist/commonjs/information-highlight/lib/parts/Icon.d.ts.map +1 -0
- package/dist/commonjs/information-highlight/lib/parts/Icon.js +19 -0
- package/dist/commonjs/information-highlight/lib/parts/Link.d.ts.map +1 -0
- package/dist/commonjs/information-highlight/lib/parts/Link.js +17 -0
- package/dist/commonjs/loading-sparkles/lib/LoadingSparkles.d.ts +1 -0
- package/dist/commonjs/loading-sparkles/lib/LoadingSparkles.d.ts.map +1 -1
- package/dist/commonjs/loading-sparkles/lib/LoadingSparkles.js +8 -45
- package/dist/commonjs/loading-sparkles/lib/sparkleIcon.js +1 -1
- package/dist/commonjs/menu/lib/Menu.d.ts +1 -1
- package/dist/commonjs/menu/lib/Menu.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/Menu.js +17 -19
- package/dist/commonjs/menu/lib/MenuItem.d.ts +1 -1
- package/dist/commonjs/menu/lib/MenuItem.js +2 -6
- package/dist/commonjs/multi-select/lib/MultiSelect.d.ts +1548 -266
- package/dist/commonjs/multi-select/lib/MultiSelect.d.ts.map +1 -1
- package/dist/commonjs/multi-select/lib/MultiSelect.js +2 -5
- package/dist/commonjs/multi-select/lib/MultiSelectCard.d.ts +464 -59
- package/dist/commonjs/multi-select/lib/MultiSelectCard.d.ts.map +1 -1
- package/dist/commonjs/multi-select/lib/MultiSelectCard.js +2 -5
- package/dist/commonjs/multi-select/lib/MultiSelectInput.d.ts +646 -37
- package/dist/commonjs/multi-select/lib/MultiSelectInput.d.ts.map +1 -1
- package/dist/commonjs/multi-select/lib/MultiSelectInput.js +7 -25
- package/dist/commonjs/multi-select/lib/MultiSelectItem.d.ts +619 -81
- package/dist/commonjs/multi-select/lib/MultiSelectItem.d.ts.map +1 -1
- package/dist/commonjs/multi-select/lib/MultiSelectItem.js +2 -5
- package/dist/commonjs/multi-select/lib/MultiSelectedItem.d.ts +468 -65
- package/dist/commonjs/multi-select/lib/MultiSelectedItem.d.ts.map +1 -1
- package/dist/commonjs/multi-select/lib/MultiSelectedItem.js +2 -7
- package/dist/commonjs/multi-select/lib/MultiSelectedList.d.ts +215 -12
- package/dist/commonjs/multi-select/lib/MultiSelectedList.d.ts.map +1 -1
- package/dist/commonjs/multi-select/lib/MultiSelectedList.js +2 -7
- package/dist/commonjs/multi-select/lib/useMultiSelectItemRemove.d.ts +215 -12
- package/dist/commonjs/multi-select/lib/useMultiSelectItemRemove.d.ts.map +1 -1
- package/dist/commonjs/multi-select/lib/useMultiSelectModel.d.ts +718 -178
- package/dist/commonjs/multi-select/lib/useMultiSelectModel.d.ts.map +1 -1
- package/dist/commonjs/pill/index.d.ts +5 -0
- package/dist/commonjs/pill/index.d.ts.map +1 -1
- package/dist/commonjs/pill/index.js +13 -0
- package/dist/commonjs/pill/lib/Pill.d.ts +229 -18
- package/dist/commonjs/pill/lib/Pill.d.ts.map +1 -1
- package/dist/commonjs/pill/lib/Pill.js +42 -172
- package/dist/commonjs/pill/lib/PillAvatar.d.ts +222 -1
- package/dist/commonjs/pill/lib/PillAvatar.d.ts.map +1 -1
- package/dist/commonjs/pill/lib/PillAvatar.js +12 -10
- package/dist/commonjs/pill/lib/PillCount.d.ts +7 -0
- package/dist/commonjs/pill/lib/PillCount.d.ts.map +1 -1
- package/dist/commonjs/pill/lib/PillCount.js +13 -14
- package/dist/commonjs/pill/lib/PillIcon.d.ts +16 -8
- package/dist/commonjs/pill/lib/PillIcon.d.ts.map +1 -1
- package/dist/commonjs/pill/lib/PillIcon.js +11 -8
- package/dist/commonjs/pill/lib/PillIconButton.d.ts +69 -10
- package/dist/commonjs/pill/lib/PillIconButton.d.ts.map +1 -1
- package/dist/commonjs/pill/lib/PillIconButton.js +11 -50
- package/dist/commonjs/pill/lib/PillLabel.d.ts +1 -1
- package/dist/commonjs/pill/lib/PillLabel.d.ts.map +1 -1
- package/dist/commonjs/pill/lib/PillLabel.js +8 -15
- package/dist/commonjs/pill/lib/usePillModel.d.ts +5 -30
- package/dist/commonjs/pill/lib/usePillModel.d.ts.map +1 -1
- package/dist/commonjs/pill/lib/usePillModel.js +1 -6
- package/dist/commonjs/radio/lib/RadioButton.d.ts +2 -3
- package/dist/commonjs/radio/lib/RadioButton.d.ts.map +1 -1
- package/dist/commonjs/radio/lib/RadioButton.js +2 -7
- package/dist/commonjs/radio/lib/RadioGroup.d.ts +12 -13
- package/dist/commonjs/radio/lib/RadioGroup.d.ts.map +1 -1
- package/dist/commonjs/radio/lib/RadioGroup.js +6 -9
- package/dist/commonjs/radio/lib/RadioInput.js +2 -1
- package/dist/commonjs/radio/lib/RadioLabel.js +3 -3
- package/dist/commonjs/radio/lib/RadioText.js +6 -5
- package/dist/commonjs/radio/lib/StyledRadioButton.js +9 -10
- package/dist/commonjs/segmented-control/lib/SegmentedControl.d.ts +410 -139
- package/dist/commonjs/segmented-control/lib/SegmentedControl.d.ts.map +1 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControl.js +2 -5
- package/dist/commonjs/segmented-control/lib/SegmentedControlItem.d.ts +81 -6
- package/dist/commonjs/segmented-control/lib/SegmentedControlItem.d.ts.map +1 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControlItem.js +3 -5
- package/dist/commonjs/segmented-control/lib/SegmentedControlList.d.ts +148 -12
- package/dist/commonjs/segmented-control/lib/SegmentedControlList.d.ts.map +1 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControlList.js +2 -25
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlItem.d.ts +74 -8
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlItem.d.ts.map +1 -1
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.d.ts +412 -142
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.d.ts.map +1 -1
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.js +1 -1
- package/dist/commonjs/select/lib/Select.js +3 -2
- package/dist/commonjs/select/lib/SelectBase.d.ts +1 -1
- package/dist/commonjs/select/lib/SelectBase.d.ts.map +1 -1
- package/dist/commonjs/select/lib/SelectBase.js +18 -21
- package/dist/commonjs/select/lib/SelectMenu.d.ts +1 -1
- package/dist/commonjs/select/lib/SelectMenu.d.ts.map +1 -1
- package/dist/commonjs/select/lib/SelectMenu.js +4 -28
- package/dist/commonjs/select/lib/SelectOption.d.ts +1 -1
- package/dist/commonjs/select/lib/SelectOption.d.ts.map +1 -1
- package/dist/commonjs/select/lib/SelectOption.js +2 -25
- package/dist/commonjs/side-panel/lib/SidePanel.d.ts +37 -4
- package/dist/commonjs/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/commonjs/side-panel/lib/SidePanel.js +46 -71
- package/dist/commonjs/side-panel/lib/SidePanelToggleButton.d.ts +38 -0
- package/dist/commonjs/side-panel/lib/SidePanelToggleButton.d.ts.map +1 -1
- package/dist/commonjs/side-panel/lib/SidePanelToggleButton.js +46 -29
- package/dist/commonjs/side-panel/lib/hooks.d.ts +2 -1
- package/dist/commonjs/side-panel/lib/hooks.d.ts.map +1 -1
- package/dist/commonjs/side-panel/lib/hooks.js +1 -0
- package/dist/commonjs/status-indicator/lib/StatusIndicator.d.ts.map +1 -1
- package/dist/commonjs/status-indicator/lib/StatusIndicator.js +15 -18
- package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.d.ts.map +1 -1
- package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.js +2 -5
- package/dist/commonjs/status-indicator/lib/StatusIndicatorLabel.d.ts.map +1 -1
- package/dist/commonjs/status-indicator/lib/StatusIndicatorLabel.js +4 -7
- package/dist/commonjs/text-area/lib/TextArea.d.ts +6 -6
- package/dist/commonjs/text-area/lib/TextArea.js +4 -7
- package/dist/commonjs/text-area/lib/TextAreaField.d.ts +2 -2
- package/dist/commonjs/text-area/lib/TextAreaField.d.ts.map +1 -1
- package/dist/commonjs/text-area/lib/TextAreaField.js +2 -4
- package/dist/commonjs/text-input/lib/TextInput.d.ts +7 -7
- package/dist/commonjs/text-input/lib/TextInput.js +4 -7
- package/dist/commonjs/text-input/lib/TextInputField.d.ts +2 -8
- package/dist/commonjs/text-input/lib/TextInputField.d.ts.map +1 -1
- package/dist/commonjs/text-input/lib/TextInputField.js +2 -4
- package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts +1 -1
- package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts +5 -5
- package/dist/es6/color-picker/lib/ColorPicker.d.ts +1 -1
- package/dist/es6/color-picker/lib/ColorPicker.js +2 -8
- package/dist/es6/color-picker/lib/parts/ColorReset.d.ts +1 -2
- package/dist/es6/color-picker/lib/parts/ColorReset.d.ts.map +1 -1
- package/dist/es6/color-picker/lib/parts/ColorReset.js +2 -4
- package/dist/es6/color-picker/lib/parts/SwatchBook.d.ts +1 -2
- package/dist/es6/color-picker/lib/parts/SwatchBook.d.ts.map +1 -1
- package/dist/es6/color-picker/lib/parts/SwatchBook.js +9 -10
- package/dist/es6/divider/lib/Divider.d.ts +2 -2
- package/dist/es6/divider/lib/Divider.d.ts.map +1 -1
- package/dist/es6/divider/lib/Divider.js +4 -4
- package/dist/es6/index.d.ts +1 -2
- package/dist/es6/index.d.ts.map +1 -1
- package/dist/es6/index.js +1 -2
- package/dist/es6/{InformationHighlight → information-highlight}/index.d.ts.map +1 -1
- package/dist/es6/{InformationHighlight → information-highlight}/lib/InformationHighlight.d.ts +2 -2
- package/dist/es6/information-highlight/lib/InformationHighlight.d.ts.map +1 -0
- package/dist/es6/{InformationHighlight → information-highlight}/lib/InformationHighlight.js +11 -11
- package/dist/es6/information-highlight/lib/hooks/useInformationHighlightModel.d.ts.map +1 -0
- package/dist/es6/information-highlight/lib/parts/Body.d.ts +2 -0
- package/dist/es6/information-highlight/lib/parts/Body.d.ts.map +1 -0
- package/dist/es6/information-highlight/lib/parts/Body.js +14 -0
- package/dist/es6/information-highlight/lib/parts/Heading.d.ts.map +1 -0
- package/dist/es6/information-highlight/lib/parts/Heading.js +14 -0
- package/dist/es6/information-highlight/lib/parts/Icon.d.ts.map +1 -0
- package/dist/es6/{InformationHighlight → information-highlight}/lib/parts/Icon.js +2 -2
- package/dist/es6/information-highlight/lib/parts/Link.d.ts.map +1 -0
- package/dist/es6/information-highlight/lib/parts/Link.js +14 -0
- package/dist/es6/loading-sparkles/lib/LoadingSparkles.d.ts +1 -0
- package/dist/es6/loading-sparkles/lib/LoadingSparkles.d.ts.map +1 -1
- package/dist/es6/loading-sparkles/lib/LoadingSparkles.js +10 -24
- package/dist/es6/loading-sparkles/lib/sparkleIcon.js +1 -1
- package/dist/es6/menu/lib/Menu.d.ts +1 -1
- package/dist/es6/menu/lib/Menu.d.ts.map +1 -1
- package/dist/es6/menu/lib/Menu.js +18 -20
- package/dist/es6/menu/lib/MenuItem.d.ts +1 -1
- package/dist/es6/menu/lib/MenuItem.js +2 -6
- package/dist/es6/multi-select/lib/MultiSelect.d.ts +1548 -266
- package/dist/es6/multi-select/lib/MultiSelect.d.ts.map +1 -1
- package/dist/es6/multi-select/lib/MultiSelect.js +2 -2
- package/dist/es6/multi-select/lib/MultiSelectCard.d.ts +464 -59
- package/dist/es6/multi-select/lib/MultiSelectCard.d.ts.map +1 -1
- package/dist/es6/multi-select/lib/MultiSelectCard.js +2 -2
- package/dist/es6/multi-select/lib/MultiSelectInput.d.ts +646 -37
- package/dist/es6/multi-select/lib/MultiSelectInput.d.ts.map +1 -1
- package/dist/es6/multi-select/lib/MultiSelectInput.js +7 -22
- package/dist/es6/multi-select/lib/MultiSelectItem.d.ts +619 -81
- 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.d.ts +468 -65
- package/dist/es6/multi-select/lib/MultiSelectedItem.d.ts.map +1 -1
- package/dist/es6/multi-select/lib/MultiSelectedItem.js +2 -4
- package/dist/es6/multi-select/lib/MultiSelectedList.d.ts +215 -12
- package/dist/es6/multi-select/lib/MultiSelectedList.d.ts.map +1 -1
- package/dist/es6/multi-select/lib/MultiSelectedList.js +2 -4
- package/dist/es6/multi-select/lib/useMultiSelectItemRemove.d.ts +215 -12
- package/dist/es6/multi-select/lib/useMultiSelectItemRemove.d.ts.map +1 -1
- package/dist/es6/multi-select/lib/useMultiSelectModel.d.ts +718 -178
- package/dist/es6/multi-select/lib/useMultiSelectModel.d.ts.map +1 -1
- package/dist/es6/pill/index.d.ts +5 -0
- package/dist/es6/pill/index.d.ts.map +1 -1
- package/dist/es6/pill/index.js +5 -0
- package/dist/es6/pill/lib/Pill.d.ts +229 -18
- package/dist/es6/pill/lib/Pill.d.ts.map +1 -1
- package/dist/es6/pill/lib/Pill.js +46 -173
- package/dist/es6/pill/lib/PillAvatar.d.ts +222 -1
- package/dist/es6/pill/lib/PillAvatar.d.ts.map +1 -1
- package/dist/es6/pill/lib/PillAvatar.js +13 -8
- package/dist/es6/pill/lib/PillCount.d.ts +7 -0
- package/dist/es6/pill/lib/PillCount.d.ts.map +1 -1
- package/dist/es6/pill/lib/PillCount.js +14 -12
- package/dist/es6/pill/lib/PillIcon.d.ts +16 -8
- package/dist/es6/pill/lib/PillIcon.d.ts.map +1 -1
- package/dist/es6/pill/lib/PillIcon.js +11 -5
- package/dist/es6/pill/lib/PillIconButton.d.ts +69 -10
- package/dist/es6/pill/lib/PillIconButton.d.ts.map +1 -1
- package/dist/es6/pill/lib/PillIconButton.js +13 -49
- package/dist/es6/pill/lib/PillLabel.d.ts +1 -1
- package/dist/es6/pill/lib/PillLabel.d.ts.map +1 -1
- package/dist/es6/pill/lib/PillLabel.js +9 -13
- package/dist/es6/pill/lib/usePillModel.d.ts +5 -30
- package/dist/es6/pill/lib/usePillModel.d.ts.map +1 -1
- package/dist/es6/pill/lib/usePillModel.js +1 -6
- package/dist/es6/radio/lib/RadioButton.d.ts +2 -3
- package/dist/es6/radio/lib/RadioButton.d.ts.map +1 -1
- package/dist/es6/radio/lib/RadioButton.js +2 -4
- package/dist/es6/radio/lib/RadioGroup.d.ts +12 -13
- package/dist/es6/radio/lib/RadioGroup.d.ts.map +1 -1
- package/dist/es6/radio/lib/RadioGroup.js +6 -6
- package/dist/es6/radio/lib/RadioInput.js +2 -1
- package/dist/es6/radio/lib/RadioLabel.js +3 -3
- package/dist/es6/radio/lib/RadioText.js +6 -5
- package/dist/es6/radio/lib/StyledRadioButton.js +9 -10
- package/dist/es6/segmented-control/lib/SegmentedControl.d.ts +410 -139
- package/dist/es6/segmented-control/lib/SegmentedControl.d.ts.map +1 -1
- package/dist/es6/segmented-control/lib/SegmentedControl.js +2 -2
- package/dist/es6/segmented-control/lib/SegmentedControlItem.d.ts +81 -6
- package/dist/es6/segmented-control/lib/SegmentedControlItem.d.ts.map +1 -1
- package/dist/es6/segmented-control/lib/SegmentedControlItem.js +3 -5
- package/dist/es6/segmented-control/lib/SegmentedControlList.d.ts +148 -12
- package/dist/es6/segmented-control/lib/SegmentedControlList.d.ts.map +1 -1
- package/dist/es6/segmented-control/lib/SegmentedControlList.js +2 -2
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlItem.d.ts +74 -8
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlItem.d.ts.map +1 -1
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.d.ts +412 -142
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.d.ts.map +1 -1
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.js +1 -1
- package/dist/es6/select/lib/Select.js +3 -2
- package/dist/es6/select/lib/SelectBase.d.ts +1 -1
- package/dist/es6/select/lib/SelectBase.d.ts.map +1 -1
- package/dist/es6/select/lib/SelectBase.js +18 -21
- package/dist/es6/select/lib/SelectMenu.d.ts +1 -1
- package/dist/es6/select/lib/SelectMenu.d.ts.map +1 -1
- package/dist/es6/select/lib/SelectMenu.js +4 -5
- package/dist/es6/select/lib/SelectOption.d.ts +1 -1
- package/dist/es6/select/lib/SelectOption.d.ts.map +1 -1
- package/dist/es6/select/lib/SelectOption.js +2 -2
- package/dist/es6/side-panel/lib/SidePanel.d.ts +37 -4
- package/dist/es6/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/es6/side-panel/lib/SidePanel.js +46 -71
- package/dist/es6/side-panel/lib/SidePanelToggleButton.d.ts +38 -0
- package/dist/es6/side-panel/lib/SidePanelToggleButton.d.ts.map +1 -1
- package/dist/es6/side-panel/lib/SidePanelToggleButton.js +46 -29
- package/dist/es6/side-panel/lib/hooks.d.ts +2 -1
- package/dist/es6/side-panel/lib/hooks.d.ts.map +1 -1
- package/dist/es6/side-panel/lib/hooks.js +1 -0
- package/dist/es6/status-indicator/lib/StatusIndicator.d.ts.map +1 -1
- package/dist/es6/status-indicator/lib/StatusIndicator.js +15 -15
- package/dist/es6/status-indicator/lib/StatusIndicatorIcon.d.ts.map +1 -1
- package/dist/es6/status-indicator/lib/StatusIndicatorIcon.js +2 -2
- package/dist/es6/status-indicator/lib/StatusIndicatorLabel.d.ts.map +1 -1
- package/dist/es6/status-indicator/lib/StatusIndicatorLabel.js +4 -4
- package/dist/es6/text-area/lib/TextArea.d.ts +6 -6
- package/dist/es6/text-area/lib/TextArea.js +4 -4
- package/dist/es6/text-area/lib/TextAreaField.d.ts +2 -2
- package/dist/es6/text-area/lib/TextAreaField.d.ts.map +1 -1
- package/dist/es6/text-area/lib/TextAreaField.js +2 -4
- package/dist/es6/text-input/lib/TextInput.d.ts +7 -7
- package/dist/es6/text-input/lib/TextInput.js +4 -4
- package/dist/es6/text-input/lib/TextInputField.d.ts +2 -8
- package/dist/es6/text-input/lib/TextInputField.d.ts.map +1 -1
- package/dist/es6/text-input/lib/TextInputField.js +2 -4
- package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts +1 -1
- package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts +5 -5
- package/divider/lib/Divider.tsx +0 -1
- package/index.ts +1 -2
- package/information-highlight/index.ts +5 -0
- package/{InformationHighlight → information-highlight}/lib/InformationHighlight.tsx +2 -2
- package/{InformationHighlight → information-highlight}/lib/parts/Body.tsx +3 -4
- package/{InformationHighlight → information-highlight}/lib/parts/Heading.tsx +0 -1
- package/{InformationHighlight → information-highlight}/lib/parts/Icon.tsx +0 -1
- package/{InformationHighlight → information-highlight}/lib/parts/Link.tsx +0 -1
- package/information-highlight/package.json +6 -0
- package/loading-sparkles/lib/LoadingSparkles.tsx +27 -55
- package/loading-sparkles/lib/sparkleIcon.ts +1 -1
- package/menu/lib/Menu.tsx +2 -3
- package/multi-select/lib/MultiSelectCard.tsx +0 -2
- package/multi-select/lib/MultiSelectInput.tsx +2 -1
- package/multi-select/lib/MultiSelectItem.tsx +0 -2
- package/multi-select/lib/MultiSelectedItem.tsx +1 -3
- package/package.json +6 -6
- package/pill/index.ts +5 -0
- package/pill/lib/Pill.tsx +146 -174
- package/pill/lib/PillAvatar.tsx +19 -13
- package/pill/lib/PillCount.tsx +32 -27
- package/pill/lib/PillIcon.tsx +16 -18
- package/pill/lib/PillIconButton.tsx +50 -74
- package/pill/lib/PillLabel.tsx +16 -20
- package/pill/lib/usePillModel.tsx +1 -6
- package/radio/lib/RadioButton.tsx +0 -1
- package/radio/lib/RadioGroup.tsx +0 -1
- package/segmented-control/lib/hooks/useSegmentedControlModel.tsx +1 -1
- package/side-panel/lib/SidePanel.tsx +66 -86
- package/side-panel/lib/SidePanelToggleButton.tsx +93 -33
- package/side-panel/lib/hooks.ts +2 -1
- package/status-indicator/lib/StatusIndicator.tsx +1 -0
- package/status-indicator/lib/StatusIndicatorIcon.tsx +0 -2
- package/status-indicator/lib/StatusIndicatorLabel.tsx +0 -2
- package/text-area/lib/TextArea.tsx +1 -1
- package/text-area/lib/TextAreaField.tsx +1 -5
- package/text-input/lib/TextInput.tsx +1 -1
- package/text-input/lib/TextInputField.tsx +1 -5
- package/common/index.ts +0 -1
- package/common/lib/parts/_brand-assets.ts +0 -19
- package/common/lib/parts/index.ts +0 -1
- package/common/package.json +0 -6
- package/dist/commonjs/InformationHighlight/lib/InformationHighlight.d.ts.map +0 -1
- package/dist/commonjs/InformationHighlight/lib/InformationHighlight.js +0 -65
- package/dist/commonjs/InformationHighlight/lib/hooks/useInformationHighlightModel.d.ts.map +0 -1
- package/dist/commonjs/InformationHighlight/lib/parts/Body.d.ts +0 -2
- package/dist/commonjs/InformationHighlight/lib/parts/Body.d.ts.map +0 -1
- package/dist/commonjs/InformationHighlight/lib/parts/Body.js +0 -40
- package/dist/commonjs/InformationHighlight/lib/parts/Heading.d.ts.map +0 -1
- package/dist/commonjs/InformationHighlight/lib/parts/Heading.js +0 -40
- package/dist/commonjs/InformationHighlight/lib/parts/Icon.d.ts.map +0 -1
- package/dist/commonjs/InformationHighlight/lib/parts/Icon.js +0 -42
- package/dist/commonjs/InformationHighlight/lib/parts/Link.d.ts.map +0 -1
- package/dist/commonjs/InformationHighlight/lib/parts/Link.js +0 -40
- package/dist/commonjs/common/index.d.ts +0 -2
- package/dist/commonjs/common/index.d.ts.map +0 -1
- package/dist/commonjs/common/index.js +0 -17
- package/dist/commonjs/common/lib/parts/_brand-assets.d.ts +0 -10
- package/dist/commonjs/common/lib/parts/_brand-assets.d.ts.map +0 -1
- package/dist/commonjs/common/lib/parts/_brand-assets.js +0 -13
- package/dist/commonjs/common/lib/parts/index.d.ts +0 -2
- package/dist/commonjs/common/lib/parts/index.d.ts.map +0 -1
- package/dist/commonjs/common/lib/parts/index.js +0 -17
- package/dist/es6/InformationHighlight/lib/InformationHighlight.d.ts.map +0 -1
- package/dist/es6/InformationHighlight/lib/hooks/useInformationHighlightModel.d.ts.map +0 -1
- package/dist/es6/InformationHighlight/lib/parts/Body.d.ts +0 -2
- package/dist/es6/InformationHighlight/lib/parts/Body.d.ts.map +0 -1
- package/dist/es6/InformationHighlight/lib/parts/Body.js +0 -14
- package/dist/es6/InformationHighlight/lib/parts/Heading.d.ts.map +0 -1
- package/dist/es6/InformationHighlight/lib/parts/Heading.js +0 -14
- package/dist/es6/InformationHighlight/lib/parts/Icon.d.ts.map +0 -1
- package/dist/es6/InformationHighlight/lib/parts/Link.d.ts.map +0 -1
- package/dist/es6/InformationHighlight/lib/parts/Link.js +0 -14
- package/dist/es6/common/index.d.ts +0 -2
- package/dist/es6/common/index.d.ts.map +0 -1
- package/dist/es6/common/index.js +0 -1
- package/dist/es6/common/lib/parts/_brand-assets.d.ts +0 -10
- package/dist/es6/common/lib/parts/_brand-assets.d.ts.map +0 -1
- package/dist/es6/common/lib/parts/_brand-assets.js +0 -10
- package/dist/es6/common/lib/parts/index.d.ts +0 -2
- package/dist/es6/common/lib/parts/index.d.ts.map +0 -1
- package/dist/es6/common/lib/parts/index.js +0 -1
- /package/dist/commonjs/{InformationHighlight → information-highlight}/index.d.ts +0 -0
- /package/dist/commonjs/{InformationHighlight → information-highlight}/index.js +0 -0
- /package/dist/commonjs/{InformationHighlight → information-highlight}/lib/hooks/useInformationHighlightModel.d.ts +0 -0
- /package/dist/commonjs/{InformationHighlight → information-highlight}/lib/hooks/useInformationHighlightModel.js +0 -0
- /package/dist/commonjs/{InformationHighlight → information-highlight}/lib/parts/Heading.d.ts +0 -0
- /package/dist/commonjs/{InformationHighlight → information-highlight}/lib/parts/Icon.d.ts +0 -0
- /package/dist/commonjs/{InformationHighlight → information-highlight}/lib/parts/Link.d.ts +0 -0
- /package/dist/es6/{InformationHighlight → information-highlight}/index.d.ts +0 -0
- /package/dist/es6/{InformationHighlight → information-highlight}/index.js +0 -0
- /package/dist/es6/{InformationHighlight → information-highlight}/lib/hooks/useInformationHighlightModel.d.ts +0 -0
- /package/dist/es6/{InformationHighlight → information-highlight}/lib/hooks/useInformationHighlightModel.js +0 -0
- /package/dist/es6/{InformationHighlight → information-highlight}/lib/parts/Heading.d.ts +0 -0
- /package/dist/es6/{InformationHighlight → information-highlight}/lib/parts/Icon.d.ts +0 -0
- /package/dist/es6/{InformationHighlight → information-highlight}/lib/parts/Link.d.ts +0 -0
- /package/{InformationHighlight → information-highlight}/lib/hooks/useInformationHighlightModel.ts +0 -0
package/pill/lib/PillCount.tsx
CHANGED
|
@@ -1,39 +1,44 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {borderRadius, colors, space} from '@workday/canvas-kit-react/tokens';
|
|
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';
|
|
6
5
|
|
|
7
6
|
export interface PillCountProps extends FlexProps {}
|
|
8
7
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
+
}),
|
|
14
33
|
});
|
|
15
34
|
|
|
16
35
|
export const PillCount = createComponent('span')({
|
|
17
|
-
displayName: 'Pill.
|
|
36
|
+
displayName: 'Pill.Count',
|
|
18
37
|
Component: ({children, ...elemProps}: PillCountProps, ref, Element) => {
|
|
19
38
|
return (
|
|
20
|
-
<
|
|
21
|
-
display="inline-flex"
|
|
22
|
-
alignItems="center"
|
|
23
|
-
justifyContent="center"
|
|
24
|
-
as={Element}
|
|
25
|
-
height={22}
|
|
26
|
-
minWidth={22}
|
|
27
|
-
padding={`0 ${space.xxxs}`}
|
|
28
|
-
marginInlineEnd={`-${space.xxs}`} // Remove excess margin at the end
|
|
29
|
-
marginInlineStart={`${space.xxxs}`}
|
|
30
|
-
backgroundColor={colors.soap500}
|
|
31
|
-
data-count="ck-pill-count"
|
|
32
|
-
ref={ref}
|
|
33
|
-
{...elemProps}
|
|
34
|
-
>
|
|
39
|
+
<Element ref={ref} {...mergeStyles(elemProps, pillCountStencil())}>
|
|
35
40
|
{children}
|
|
36
|
-
</
|
|
41
|
+
</Element>
|
|
37
42
|
);
|
|
38
43
|
},
|
|
39
44
|
});
|
package/pill/lib/PillIcon.tsx
CHANGED
|
@@ -1,34 +1,32 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
1
|
import {createSubcomponent} from '@workday/canvas-kit-react/common';
|
|
4
2
|
|
|
5
|
-
import {SystemIcon, SystemIconProps} from '@workday/canvas-kit-react/icon';
|
|
3
|
+
import {SystemIcon, SystemIconProps, systemIconStencil} from '@workday/canvas-kit-react/icon';
|
|
6
4
|
import {usePillModel} from './usePillModel';
|
|
7
5
|
import {plusIcon} from '@workday/canvas-system-icons-web';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
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> {}
|
|
10
11
|
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
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
|
+
});
|
|
18
20
|
|
|
19
21
|
export const PillIcon = createSubcomponent('span')({
|
|
20
22
|
modelHook: usePillModel,
|
|
21
|
-
})<PillIconProps>(({
|
|
23
|
+
})<PillIconProps>(({icon, ...elemProps}, Element) => {
|
|
22
24
|
return (
|
|
23
25
|
<SystemIcon
|
|
24
|
-
marginInlineStart={`-${space.xxxs}`} // remove excess margin from the start
|
|
25
|
-
display="flex"
|
|
26
26
|
as={Element}
|
|
27
|
-
size={20}
|
|
28
27
|
role="img"
|
|
29
|
-
aria-label="add"
|
|
30
28
|
icon={icon || plusIcon}
|
|
31
|
-
{...elemProps}
|
|
29
|
+
{...mergeStyles(elemProps, pillIconStencil())}
|
|
32
30
|
/>
|
|
33
31
|
);
|
|
34
32
|
});
|
|
@@ -1,102 +1,78 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import {focusRing, styled, StyledType, createSubcomponent} from '@workday/canvas-kit-react/common';
|
|
4
|
-
|
|
5
|
-
import {SystemIcon, SystemIconProps} from '@workday/canvas-kit-react/icon';
|
|
1
|
+
import {focusRing, createSubcomponent} from '@workday/canvas-kit-react/common';
|
|
2
|
+
import {SystemIcon, SystemIconProps, systemIconStencil} from '@workday/canvas-kit-react/icon';
|
|
6
3
|
import {usePillModel} from './usePillModel';
|
|
7
4
|
import {xSmallIcon} from '@workday/canvas-system-icons-web';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
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';
|
|
11
9
|
|
|
12
|
-
export interface PillIconButtonProps extends
|
|
13
|
-
/**
|
|
14
|
-
* The system icon rendered by the button
|
|
15
|
-
* @default `xSmallIcon`
|
|
16
|
-
*/
|
|
17
|
-
icon?: CanvasSystemIcon;
|
|
10
|
+
export interface PillIconButtonProps extends Partial<SystemIconProps> {
|
|
18
11
|
/**
|
|
19
|
-
* The aria label for the removable icon
|
|
20
|
-
* @default 'remove'
|
|
12
|
+
* The aria label for the removable icon. You must provide a valid string to represent the action.
|
|
21
13
|
*/
|
|
22
14
|
'aria-label'?: string;
|
|
23
15
|
}
|
|
24
16
|
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
'&:hover, &.hover': {
|
|
53
|
-
[buttonStencil.vars.background]: colors.soap300,
|
|
54
|
-
[buttonStencil.vars.border]: 'transparent',
|
|
55
|
-
[buttonStencil.vars.label]: colors.blackPepper400,
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
'&:active, &.active': {
|
|
59
|
-
[buttonStencil.vars.background]: colors.soap500,
|
|
60
|
-
[buttonStencil.vars.border]: 'transparent',
|
|
61
|
-
[buttonStencil.vars.label]: colors.blackPepper400,
|
|
62
|
-
},
|
|
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.soft,
|
|
30
|
+
[systemIconStencil.vars.color]: system.color.icon.default,
|
|
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
|
+
},
|
|
63
42
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
43
|
+
'&:focus-visible, &.focus': {
|
|
44
|
+
[buttonStencil.vars.border]: system.color.border.transparent,
|
|
45
|
+
...focusRing({
|
|
46
|
+
innerColor: system.color.border.transparent,
|
|
47
|
+
}),
|
|
48
|
+
},
|
|
49
|
+
'&:hover, &.hover': {
|
|
50
|
+
[buttonStencil.vars.border]: system.color.border.transparent,
|
|
51
|
+
},
|
|
52
|
+
'&:disabled, &.disabled': {
|
|
53
|
+
[buttonStencil.vars.border]: system.color.border.transparent,
|
|
54
|
+
},
|
|
68
55
|
},
|
|
69
56
|
});
|
|
70
57
|
|
|
71
58
|
export const PillIconButton = createSubcomponent('button')({
|
|
72
59
|
modelHook: usePillModel,
|
|
73
60
|
})<PillIconButtonProps>(
|
|
74
|
-
(
|
|
75
|
-
{size, icon = xSmallIcon, maxWidth, children, 'aria-label': ariaLabel = 'remove', ...elemProps},
|
|
76
|
-
Element,
|
|
77
|
-
model
|
|
78
|
-
) => {
|
|
61
|
+
({size, icon, children, 'aria-label': ariaLabel = '', ...elemProps}, Element, model) => {
|
|
79
62
|
return (
|
|
80
|
-
<
|
|
81
|
-
borderRadius="s"
|
|
82
|
-
height={20}
|
|
83
|
-
width={20}
|
|
84
|
-
padding="zero"
|
|
63
|
+
<Element
|
|
85
64
|
disabled={model.state.disabled}
|
|
86
65
|
aria-labelledby={`removable-${model.state.id} label-${model.state.id}`}
|
|
87
|
-
|
|
88
|
-
position="relative"
|
|
89
|
-
{...elemProps}
|
|
66
|
+
{...mergeStyles(elemProps, pillIconButtonStencil())}
|
|
90
67
|
>
|
|
91
68
|
<SystemIcon
|
|
92
69
|
aria-label={ariaLabel}
|
|
93
70
|
id={`removable-${model.state.id}`}
|
|
94
|
-
icon={icon}
|
|
95
|
-
size={space.m}
|
|
71
|
+
icon={icon || xSmallIcon}
|
|
96
72
|
aria-hidden // This works for Chrome but not needed in Safari
|
|
97
73
|
role="img"
|
|
98
74
|
/>
|
|
99
|
-
</
|
|
75
|
+
</Element>
|
|
100
76
|
);
|
|
101
77
|
}
|
|
102
78
|
);
|
package/pill/lib/PillLabel.tsx
CHANGED
|
@@ -1,36 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import {createSubcomponent, styled, StyledType} from '@workday/canvas-kit-react/common';
|
|
4
|
-
import {Box, BoxProps} from '@workday/canvas-kit-react/layout';
|
|
1
|
+
import {createSubcomponent} from '@workday/canvas-kit-react/common';
|
|
2
|
+
import {BoxProps, mergeStyles} from '@workday/canvas-kit-react/layout';
|
|
5
3
|
import {OverflowTooltip, OverflowTooltipProps} from '@workday/canvas-kit-react/tooltip';
|
|
6
4
|
|
|
7
5
|
import {usePillModel} from './usePillModel';
|
|
8
|
-
|
|
6
|
+
|
|
7
|
+
import {createStencil} from '@workday/canvas-kit-styling';
|
|
9
8
|
|
|
10
9
|
export interface PillLabelProps extends BoxProps {
|
|
11
10
|
tooltipProps?: Omit<OverflowTooltipProps, 'children'>;
|
|
12
11
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
|
|
13
|
+
export const pillLabelStencil = createStencil({
|
|
14
|
+
base: {
|
|
15
|
+
flexShrink: 1,
|
|
16
|
+
whiteSpace: 'nowrap',
|
|
17
|
+
textOverflow: 'ellipsis',
|
|
18
|
+
overflow: 'hidden',
|
|
19
|
+
},
|
|
18
20
|
});
|
|
19
21
|
|
|
20
22
|
export const PillLabel = createSubcomponent('span')({
|
|
21
23
|
modelHook: usePillModel,
|
|
22
|
-
})<PillLabelProps>(({tooltipProps, ...elemProps}, Element, model) => {
|
|
24
|
+
})<PillLabelProps>(({tooltipProps, children, ...elemProps}, Element, model) => {
|
|
23
25
|
return (
|
|
24
26
|
<OverflowTooltip {...tooltipProps}>
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
as={Element}
|
|
29
|
-
id={`label-${model.state.id}`}
|
|
30
|
-
{...elemProps}
|
|
31
|
-
>
|
|
32
|
-
{elemProps.children}
|
|
33
|
-
</StyledLabelContainer>
|
|
27
|
+
<Element id={`label-${model.state.id}`} {...mergeStyles(elemProps, pillLabelStencil())}>
|
|
28
|
+
{children}
|
|
29
|
+
</Element>
|
|
34
30
|
</OverflowTooltip>
|
|
35
31
|
);
|
|
36
32
|
});
|
|
@@ -3,12 +3,7 @@ import {createModelHook, useUniqueId} from '@workday/canvas-kit-react/common';
|
|
|
3
3
|
export const usePillModel = createModelHook({
|
|
4
4
|
defaultConfig: {
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
* text will be truncated and a tooltip will show the rest of the content when hovered over
|
|
8
|
-
*/
|
|
9
|
-
maxWidth: 200 as string | number,
|
|
10
|
-
/**
|
|
11
|
-
* Use to disable a pill.
|
|
6
|
+
* Used to disable a pill and apply the correct styles.
|
|
12
7
|
*/
|
|
13
8
|
disabled: false,
|
|
14
9
|
/**
|
package/radio/lib/RadioGroup.tsx
CHANGED
|
@@ -44,7 +44,7 @@ export const useSegmentedControlModel = createModelHook({
|
|
|
44
44
|
items,
|
|
45
45
|
onRegisterItem(data) {
|
|
46
46
|
if (!initialSelectedRef.current) {
|
|
47
|
-
initialSelectedRef.current =
|
|
47
|
+
initialSelectedRef.current = data.id;
|
|
48
48
|
events.select({id: initialSelectedRef.current});
|
|
49
49
|
}
|
|
50
50
|
},
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
/** @jsxRuntime classic */
|
|
2
|
-
/** @jsx jsx */
|
|
3
1
|
import * as React from 'react';
|
|
4
|
-
import {createComponent
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import {createComponent} from '@workday/canvas-kit-react/common';
|
|
3
|
+
import {createStencil, handleCsProp, px2rem} from '@workday/canvas-kit-styling';
|
|
4
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
7
5
|
import {SidePanelContext} from './hooks';
|
|
8
6
|
import {SidePanelToggleButton} from './SidePanelToggleButton';
|
|
9
7
|
|
|
@@ -61,44 +59,48 @@ export interface SidePanelProps {
|
|
|
61
59
|
*/
|
|
62
60
|
touched: boolean;
|
|
63
61
|
children?: React.ReactNode;
|
|
64
|
-
|
|
65
|
-
onAnimationEnd?: React.AnimationEventHandler<HTMLElement>;
|
|
62
|
+
onAnimationEnd?: React.TransitionEvent<HTMLElement>;
|
|
66
63
|
}
|
|
67
64
|
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
return keyframes`
|
|
75
|
-
from {
|
|
76
|
-
width: ${normalized.from};
|
|
77
|
-
min-width: ${normalized.from};
|
|
78
|
-
max-width: ${normalized.from};
|
|
79
|
-
} to {
|
|
80
|
-
width: ${normalized.to};
|
|
81
|
-
min-width: ${normalized.to};
|
|
82
|
-
max-width: ${normalized.to};
|
|
83
|
-
}
|
|
84
|
-
`;
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
const containerVariantStyle: Record<SidePanelVariant, CSSObject> = {
|
|
88
|
-
alternate: {
|
|
89
|
-
backgroundColor: colors.frenchVanilla100,
|
|
90
|
-
...depth[5],
|
|
65
|
+
export const panelStencil = createStencil({
|
|
66
|
+
vars: {
|
|
67
|
+
expandedWidth: '',
|
|
68
|
+
collapsedWidth: '',
|
|
91
69
|
},
|
|
92
|
-
|
|
93
|
-
|
|
70
|
+
base: () => ({
|
|
71
|
+
overflow: 'hidden',
|
|
72
|
+
position: 'relative',
|
|
73
|
+
height: '100%',
|
|
74
|
+
outline: `${px2rem(1)} solid transparent`,
|
|
75
|
+
transition: 'width ease-out 200ms, max-width ease-out 200ms',
|
|
76
|
+
}),
|
|
77
|
+
modifiers: {
|
|
78
|
+
variant: {
|
|
79
|
+
alternate: {
|
|
80
|
+
backgroundColor: system.color.bg.default,
|
|
81
|
+
boxShadow: system.depth[5],
|
|
82
|
+
},
|
|
83
|
+
standard: {
|
|
84
|
+
backgroundColor: system.color.bg.alt.softer,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
expanded: {
|
|
88
|
+
true: ({expandedWidth}) => ({
|
|
89
|
+
width: expandedWidth,
|
|
90
|
+
maxWidth: expandedWidth,
|
|
91
|
+
}),
|
|
92
|
+
false: ({collapsedWidth}) => ({
|
|
93
|
+
width: collapsedWidth,
|
|
94
|
+
maxWidth: collapsedWidth,
|
|
95
|
+
}),
|
|
96
|
+
},
|
|
97
|
+
touched: {
|
|
98
|
+
true: {},
|
|
99
|
+
false: {
|
|
100
|
+
animation: 'none',
|
|
101
|
+
},
|
|
102
|
+
},
|
|
94
103
|
},
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
const Panel = styled('section')({
|
|
98
|
-
overflow: 'hidden',
|
|
99
|
-
position: 'relative',
|
|
100
|
-
boxSizing: 'border-box',
|
|
101
|
-
height: '100%',
|
|
102
104
|
});
|
|
103
105
|
|
|
104
106
|
export const SidePanel = createComponent('section')({
|
|
@@ -110,7 +112,6 @@ export const SidePanel = createComponent('section')({
|
|
|
110
112
|
expanded = true,
|
|
111
113
|
expandedWidth = 320,
|
|
112
114
|
onAnimationEnd,
|
|
113
|
-
onAnimationStart,
|
|
114
115
|
onExpandedChange,
|
|
115
116
|
onStateTransition,
|
|
116
117
|
origin = 'left',
|
|
@@ -137,71 +138,50 @@ export const SidePanel = createComponent('section')({
|
|
|
137
138
|
}
|
|
138
139
|
}, [state, onStateTransition]);
|
|
139
140
|
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
const handleAnimationEnd = (event: React.AnimationEvent<HTMLDivElement>) => {
|
|
146
|
-
if (event.currentTarget === event.target) {
|
|
147
|
-
if (event.animationName === motion.collapse.name) {
|
|
148
|
-
setState('collapsed');
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
if (event.animationName === motion.expand.name) {
|
|
141
|
+
const handleAnimationEnd = (event: React.TransitionEvent<HTMLDivElement>) => {
|
|
142
|
+
if (event.propertyName === 'width') {
|
|
143
|
+
if (state === 'expanding') {
|
|
152
144
|
setState('expanded');
|
|
145
|
+
} else if (state === 'collapsing') {
|
|
146
|
+
setState('collapsed');
|
|
153
147
|
}
|
|
154
148
|
}
|
|
155
|
-
|
|
156
|
-
if (typeof onAnimationEnd !== 'undefined') {
|
|
157
|
-
onAnimationEnd(event);
|
|
158
|
-
}
|
|
159
149
|
};
|
|
160
150
|
|
|
161
|
-
const handleAnimationStart = (
|
|
162
|
-
if (
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
) {
|
|
167
|
-
setState(expanded ? 'expanding' : 'collapsing');
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
if (typeof onAnimationStart !== 'undefined') {
|
|
172
|
-
onAnimationStart(event);
|
|
151
|
+
const handleAnimationStart = () => {
|
|
152
|
+
if (state === 'collapsed' || state === 'collapsing') {
|
|
153
|
+
setState('expanding');
|
|
154
|
+
} else if (state === 'expanded' || state === 'expanding') {
|
|
155
|
+
setState('collapsing');
|
|
173
156
|
}
|
|
157
|
+
return undefined;
|
|
174
158
|
};
|
|
175
159
|
|
|
176
160
|
return (
|
|
177
|
-
<
|
|
161
|
+
<Element
|
|
178
162
|
ref={ref}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
{
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
containerVariantStyle[variant],
|
|
191
|
-
]}
|
|
192
|
-
onAnimationEnd={handleAnimationEnd}
|
|
193
|
-
onAnimationStart={handleAnimationStart}
|
|
194
|
-
{...elemProps}
|
|
163
|
+
onTransitionEnd={handleAnimationEnd}
|
|
164
|
+
{...handleCsProp(elemProps, [
|
|
165
|
+
panelStencil({
|
|
166
|
+
expanded,
|
|
167
|
+
variant,
|
|
168
|
+
expandedWidth:
|
|
169
|
+
typeof expandedWidth === 'number' ? px2rem(expandedWidth) : expandedWidth,
|
|
170
|
+
collapsedWidth:
|
|
171
|
+
typeof collapsedWidth === 'number' ? px2rem(collapsedWidth) : collapsedWidth,
|
|
172
|
+
}),
|
|
173
|
+
])}
|
|
195
174
|
>
|
|
196
175
|
<SidePanelContext.Provider
|
|
197
176
|
value={{
|
|
198
177
|
state,
|
|
199
178
|
origin,
|
|
179
|
+
handleAnimationStart,
|
|
200
180
|
}}
|
|
201
181
|
>
|
|
202
182
|
{children}
|
|
203
183
|
</SidePanelContext.Provider>
|
|
204
|
-
</
|
|
184
|
+
</Element>
|
|
205
185
|
);
|
|
206
186
|
},
|
|
207
187
|
subComponents: {
|