@workday/canvas-kit-preview-react 12.0.0-alpha.862-next.0 → 12.0.0-alpha.898-next.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/ColorPicker.tsx +11 -5
- package/color-picker/lib/parts/SwatchBook.tsx +34 -22
- package/dist/commonjs/color-picker/lib/ColorPicker.d.ts +3 -2
- package/dist/commonjs/color-picker/lib/ColorPicker.d.ts.map +1 -1
- package/dist/commonjs/color-picker/lib/ColorPicker.js +20 -9
- package/dist/commonjs/color-picker/lib/parts/ColorReset.d.ts +2 -1
- package/dist/commonjs/color-picker/lib/parts/ColorReset.d.ts.map +1 -1
- package/dist/commonjs/color-picker/lib/parts/ColorReset.js +8 -4
- package/dist/commonjs/color-picker/lib/parts/SwatchBook.d.ts +7 -2
- package/dist/commonjs/color-picker/lib/parts/SwatchBook.d.ts.map +1 -1
- package/dist/commonjs/color-picker/lib/parts/SwatchBook.js +20 -12
- package/dist/commonjs/divider/index.d.ts +2 -0
- package/dist/commonjs/divider/index.d.ts.map +1 -0
- package/dist/commonjs/{form-field/lib/hooks → divider}/index.js +6 -6
- package/dist/commonjs/divider/lib/Divider.d.ts +34 -0
- package/dist/commonjs/divider/lib/Divider.d.ts.map +1 -0
- package/dist/commonjs/divider/lib/Divider.js +58 -0
- package/dist/commonjs/index.d.ts +3 -2
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +8 -3
- package/dist/commonjs/loading-sparkles/index.js +5 -1
- package/dist/commonjs/loading-sparkles/lib/LoadingSparkles.js +11 -7
- package/dist/commonjs/menu/index.js +5 -1
- package/dist/commonjs/menu/lib/Menu.d.ts +1 -1
- package/dist/commonjs/menu/lib/Menu.js +12 -8
- package/dist/commonjs/menu/lib/MenuItem.d.ts +1 -1
- package/dist/commonjs/menu/lib/MenuItem.js +13 -9
- package/dist/commonjs/pill/index.js +5 -1
- package/dist/commonjs/pill/lib/Pill.js +12 -12
- package/dist/commonjs/pill/lib/PillAvatar.js +2 -2
- package/dist/commonjs/pill/lib/PillCount.js +3 -3
- package/dist/commonjs/pill/lib/PillIcon.js +2 -2
- package/dist/commonjs/pill/lib/PillIconButton.js +4 -4
- package/dist/commonjs/pill/lib/PillLabel.js +4 -4
- package/dist/commonjs/pill/lib/usePillModel.js +2 -2
- package/dist/commonjs/radio/index.js +5 -1
- package/dist/commonjs/radio/lib/RadioButton.js +2 -2
- package/dist/commonjs/radio/lib/RadioGroup.js +6 -6
- package/dist/commonjs/radio/lib/RadioInput.js +3 -3
- package/dist/commonjs/radio/lib/RadioLabel.js +4 -4
- package/dist/commonjs/radio/lib/RadioText.js +7 -7
- package/dist/commonjs/radio/lib/StyledRadioButton.js +13 -13
- package/dist/commonjs/radio/lib/hooks/useRadioModel.js +1 -1
- package/dist/commonjs/segmented-control/index.js +5 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControl.d.ts +38 -38
- package/dist/commonjs/segmented-control/lib/SegmentedControl.js +1 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControlItem.d.ts +1 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControlItem.js +10 -6
- package/dist/commonjs/segmented-control/lib/SegmentedControlList.d.ts +2 -2
- package/dist/commonjs/segmented-control/lib/SegmentedControlList.js +8 -4
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlItem.js +3 -3
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.d.ts +39 -39
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.js +2 -2
- package/dist/commonjs/select/index.d.ts +3 -0
- package/dist/commonjs/select/index.d.ts.map +1 -0
- package/dist/commonjs/select/index.js +17 -0
- package/dist/commonjs/select/lib/Select.d.ts +31 -0
- package/dist/commonjs/select/lib/Select.d.ts.map +1 -0
- package/dist/commonjs/select/lib/Select.js +485 -0
- package/dist/commonjs/select/lib/SelectBase.d.ts +165 -0
- package/dist/commonjs/select/lib/SelectBase.d.ts.map +1 -0
- package/dist/commonjs/select/lib/SelectBase.js +238 -0
- package/dist/commonjs/select/lib/SelectMenu.d.ts +45 -0
- package/dist/commonjs/select/lib/SelectMenu.d.ts.map +1 -0
- package/dist/commonjs/select/lib/SelectMenu.js +219 -0
- package/dist/commonjs/select/lib/SelectOption.d.ts +38 -0
- package/dist/commonjs/select/lib/SelectOption.d.ts.map +1 -0
- package/dist/commonjs/select/lib/SelectOption.js +96 -0
- package/dist/commonjs/select/lib/scrolling.d.ts +5 -0
- package/dist/commonjs/select/lib/scrolling.d.ts.map +1 -0
- package/dist/commonjs/select/lib/scrolling.js +36 -0
- package/dist/commonjs/select/lib/types.d.ts +37 -0
- package/dist/commonjs/select/lib/types.d.ts.map +1 -0
- package/dist/commonjs/select/lib/types.js +2 -0
- package/dist/commonjs/select/lib/utils.d.ts +10 -0
- package/dist/commonjs/select/lib/utils.d.ts.map +1 -0
- package/dist/commonjs/select/lib/utils.js +27 -0
- package/dist/commonjs/side-panel/index.js +5 -1
- package/dist/commonjs/side-panel/lib/SidePanel.d.ts +2 -2
- package/dist/commonjs/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/commonjs/side-panel/lib/SidePanel.js +11 -7
- package/dist/commonjs/side-panel/lib/SidePanelToggleButton.js +10 -6
- package/dist/commonjs/side-panel/lib/hooks.d.ts +1 -1
- package/dist/commonjs/side-panel/lib/hooks.d.ts.map +1 -1
- package/dist/commonjs/side-panel/lib/hooks.js +7 -3
- package/dist/commonjs/status-indicator/lib/StatusIndicator.d.ts +1 -1
- package/dist/commonjs/status-indicator/lib/StatusIndicator.d.ts.map +1 -1
- package/dist/commonjs/status-indicator/lib/StatusIndicator.js +16 -16
- package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.js +2 -2
- package/dist/commonjs/status-indicator/lib/StatusIndicatorLabel.js +4 -4
- package/dist/commonjs/text-area/index.js +5 -1
- package/dist/commonjs/text-area/lib/TextArea.d.ts +8 -2
- package/dist/commonjs/text-area/lib/TextArea.d.ts.map +1 -1
- package/dist/commonjs/text-area/lib/TextArea.js +8 -8
- package/dist/commonjs/text-area/lib/TextAreaField.d.ts +2 -0
- package/dist/commonjs/text-area/lib/TextAreaField.d.ts.map +1 -1
- package/dist/commonjs/text-area/lib/TextAreaField.js +5 -5
- package/dist/commonjs/text-input/index.js +5 -1
- package/dist/commonjs/text-input/lib/TextInput.d.ts +10 -3
- package/dist/commonjs/text-input/lib/TextInput.d.ts.map +1 -1
- package/dist/commonjs/text-input/lib/TextInput.js +8 -8
- package/dist/commonjs/text-input/lib/TextInputField.d.ts +8 -0
- package/dist/commonjs/text-input/lib/TextInputField.d.ts.map +1 -1
- package/dist/commonjs/text-input/lib/TextInputField.js +5 -5
- package/dist/commonjs/text-input/lib/hooks/index.js +5 -1
- package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts +1 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts.map +1 -1
- package/dist/commonjs/text-input/lib/hooks/useTextInputField.js +1 -1
- package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts +5 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -1
- package/dist/commonjs/text-input/lib/hooks/useTextInputModel.js +1 -1
- package/dist/es6/color-picker/lib/ColorPicker.d.ts +3 -2
- package/dist/es6/color-picker/lib/ColorPicker.d.ts.map +1 -1
- package/dist/es6/color-picker/lib/ColorPicker.js +10 -3
- package/dist/es6/color-picker/lib/parts/ColorReset.d.ts +2 -1
- package/dist/es6/color-picker/lib/parts/ColorReset.d.ts.map +1 -1
- package/dist/es6/color-picker/lib/parts/SwatchBook.d.ts +7 -2
- package/dist/es6/color-picker/lib/parts/SwatchBook.d.ts.map +1 -1
- package/dist/es6/color-picker/lib/parts/SwatchBook.js +11 -7
- package/dist/es6/divider/index.d.ts +2 -0
- package/dist/es6/divider/index.d.ts.map +1 -0
- package/dist/es6/divider/index.js +1 -0
- package/dist/es6/divider/lib/Divider.d.ts +34 -0
- package/dist/es6/divider/lib/Divider.d.ts.map +1 -0
- package/dist/es6/divider/lib/Divider.js +32 -0
- package/dist/es6/index.d.ts +3 -2
- package/dist/es6/index.d.ts.map +1 -1
- package/dist/es6/index.js +3 -2
- package/dist/es6/loading-sparkles/lib/LoadingSparkles.js +4 -4
- package/dist/es6/menu/lib/Menu.d.ts +1 -1
- package/dist/es6/menu/lib/Menu.js +5 -5
- package/dist/es6/menu/lib/MenuItem.d.ts +1 -1
- package/dist/es6/menu/lib/MenuItem.js +3 -3
- package/dist/es6/pill/lib/Pill.js +3 -3
- package/dist/es6/pill/lib/PillAvatar.js +1 -1
- package/dist/es6/pill/lib/PillCount.js +1 -1
- package/dist/es6/pill/lib/PillIcon.js +1 -1
- package/dist/es6/pill/lib/PillIconButton.js +1 -1
- package/dist/es6/pill/lib/PillLabel.js +2 -2
- package/dist/es6/radio/lib/RadioButton.js +1 -1
- package/dist/es6/radio/lib/RadioGroup.js +4 -4
- package/dist/es6/radio/lib/RadioInput.js +1 -1
- package/dist/es6/radio/lib/RadioLabel.js +2 -2
- package/dist/es6/radio/lib/RadioText.js +5 -5
- package/dist/es6/radio/lib/StyledRadioButton.js +8 -8
- package/dist/es6/segmented-control/lib/SegmentedControl.d.ts +38 -38
- package/dist/es6/segmented-control/lib/SegmentedControlItem.d.ts +1 -1
- package/dist/es6/segmented-control/lib/SegmentedControlItem.js +3 -3
- package/dist/es6/segmented-control/lib/SegmentedControlList.d.ts +2 -2
- package/dist/es6/segmented-control/lib/SegmentedControlList.js +1 -1
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.d.ts +39 -39
- package/dist/es6/select/index.d.ts +3 -0
- package/dist/es6/select/index.d.ts.map +1 -0
- package/dist/es6/select/index.js +1 -0
- package/dist/es6/select/lib/Select.d.ts +31 -0
- package/dist/es6/select/lib/Select.d.ts.map +1 -0
- package/dist/es6/select/lib/Select.js +459 -0
- package/dist/es6/select/lib/SelectBase.d.ts +165 -0
- package/dist/es6/select/lib/SelectBase.d.ts.map +1 -0
- package/dist/es6/select/lib/SelectBase.js +211 -0
- package/dist/es6/select/lib/SelectMenu.d.ts +45 -0
- package/dist/es6/select/lib/SelectMenu.d.ts.map +1 -0
- package/dist/es6/select/lib/SelectMenu.js +192 -0
- package/dist/es6/select/lib/SelectOption.d.ts +38 -0
- package/dist/es6/select/lib/SelectOption.d.ts.map +1 -0
- package/dist/es6/select/lib/SelectOption.js +69 -0
- package/dist/es6/select/lib/scrolling.d.ts +5 -0
- package/dist/es6/select/lib/scrolling.d.ts.map +1 -0
- package/dist/es6/select/lib/scrolling.js +32 -0
- package/dist/es6/select/lib/types.d.ts +37 -0
- package/dist/es6/select/lib/types.d.ts.map +1 -0
- package/dist/es6/select/lib/types.js +1 -0
- package/dist/es6/select/lib/utils.d.ts +10 -0
- package/dist/es6/select/lib/utils.d.ts.map +1 -0
- package/dist/es6/select/lib/utils.js +22 -0
- package/dist/es6/side-panel/lib/SidePanel.d.ts +2 -2
- package/dist/es6/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/es6/side-panel/lib/SidePanel.js +2 -2
- package/dist/es6/side-panel/lib/SidePanelToggleButton.js +1 -1
- package/dist/es6/side-panel/lib/hooks.d.ts +1 -1
- package/dist/es6/side-panel/lib/hooks.d.ts.map +1 -1
- package/dist/es6/status-indicator/lib/StatusIndicator.d.ts +1 -1
- package/dist/es6/status-indicator/lib/StatusIndicator.d.ts.map +1 -1
- package/dist/es6/status-indicator/lib/StatusIndicator.js +14 -14
- package/dist/es6/status-indicator/lib/StatusIndicatorIcon.js +1 -1
- package/dist/es6/status-indicator/lib/StatusIndicatorLabel.js +2 -2
- package/dist/es6/text-area/lib/TextArea.d.ts +8 -2
- package/dist/es6/text-area/lib/TextArea.d.ts.map +1 -1
- package/dist/es6/text-area/lib/TextArea.js +7 -7
- package/dist/es6/text-area/lib/TextAreaField.d.ts +2 -0
- package/dist/es6/text-area/lib/TextAreaField.d.ts.map +1 -1
- package/dist/es6/text-area/lib/TextAreaField.js +2 -2
- package/dist/es6/text-input/lib/TextInput.d.ts +10 -3
- package/dist/es6/text-input/lib/TextInput.d.ts.map +1 -1
- package/dist/es6/text-input/lib/TextInput.js +7 -7
- package/dist/es6/text-input/lib/TextInputField.d.ts +8 -0
- package/dist/es6/text-input/lib/TextInputField.d.ts.map +1 -1
- package/dist/es6/text-input/lib/TextInputField.js +2 -2
- package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts +1 -0
- package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts.map +1 -1
- package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts +5 -0
- package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -1
- package/dist/es6/text-input/lib/hooks/useTextInputModel.js +1 -1
- package/divider/index.ts +1 -0
- package/divider/lib/Divider.tsx +60 -0
- package/divider/package.json +6 -0
- package/index.ts +3 -2
- package/package.json +5 -5
- package/radio/lib/RadioGroup.tsx +1 -1
- package/select/index.ts +8 -0
- package/select/lib/Select.tsx +595 -0
- package/select/lib/SelectBase.tsx +493 -0
- package/select/lib/SelectMenu.tsx +304 -0
- package/select/lib/SelectOption.tsx +133 -0
- package/select/lib/scrolling.ts +42 -0
- package/select/lib/types.ts +37 -0
- package/select/lib/utils.ts +30 -0
- package/select/package.json +6 -0
- package/text-area/lib/TextArea.tsx +2 -2
- package/text-area/lib/TextAreaField.tsx +1 -1
- package/text-input/lib/TextInput.tsx +2 -6
- package/text-input/lib/TextInputField.tsx +1 -1
- package/text-input/lib/hooks/useTextInputModel.ts +1 -1
- package/dist/commonjs/form-field/index.d.ts +0 -7
- package/dist/commonjs/form-field/index.d.ts.map +0 -1
- package/dist/commonjs/form-field/index.js +0 -23
- package/dist/commonjs/form-field/lib/FormField.d.ts +0 -124
- package/dist/commonjs/form-field/lib/FormField.d.ts.map +0 -1
- package/dist/commonjs/form-field/lib/FormField.js +0 -99
- package/dist/commonjs/form-field/lib/FormFieldContainer.d.ts +0 -11
- package/dist/commonjs/form-field/lib/FormFieldContainer.d.ts.map +0 -1
- package/dist/commonjs/form-field/lib/FormFieldContainer.js +0 -19
- package/dist/commonjs/form-field/lib/FormFieldHint.d.ts +0 -112
- package/dist/commonjs/form-field/lib/FormFieldHint.d.ts.map +0 -1
- package/dist/commonjs/form-field/lib/FormFieldHint.js +0 -32
- package/dist/commonjs/form-field/lib/FormFieldInput.d.ts +0 -9
- package/dist/commonjs/form-field/lib/FormFieldInput.d.ts.map +0 -1
- package/dist/commonjs/form-field/lib/FormFieldInput.js +0 -17
- package/dist/commonjs/form-field/lib/FormFieldLabel.d.ts +0 -122
- package/dist/commonjs/form-field/lib/FormFieldLabel.d.ts.map +0 -1
- package/dist/commonjs/form-field/lib/FormFieldLabel.js +0 -29
- package/dist/commonjs/form-field/lib/formFieldStencil.d.ts +0 -29
- package/dist/commonjs/form-field/lib/formFieldStencil.d.ts.map +0 -1
- package/dist/commonjs/form-field/lib/formFieldStencil.js +0 -27
- package/dist/commonjs/form-field/lib/hooks/index.d.ts +0 -6
- package/dist/commonjs/form-field/lib/hooks/index.d.ts.map +0 -1
- package/dist/commonjs/form-field/lib/hooks/useFormFieldHint.d.ts +0 -15
- package/dist/commonjs/form-field/lib/hooks/useFormFieldHint.d.ts.map +0 -1
- package/dist/commonjs/form-field/lib/hooks/useFormFieldHint.js +0 -14
- package/dist/commonjs/form-field/lib/hooks/useFormFieldInput.d.ts +0 -19
- package/dist/commonjs/form-field/lib/hooks/useFormFieldInput.d.ts.map +0 -1
- package/dist/commonjs/form-field/lib/hooks/useFormFieldInput.js +0 -18
- package/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.d.ts +0 -15
- package/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.d.ts.map +0 -1
- package/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.js +0 -14
- package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.d.ts +0 -93
- package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.d.ts.map +0 -1
- package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.js +0 -40
- package/dist/commonjs/form-field/lib/hooks/useFormFieldOrientation.d.ts +0 -12
- package/dist/commonjs/form-field/lib/hooks/useFormFieldOrientation.d.ts.map +0 -1
- package/dist/commonjs/form-field/lib/hooks/useFormFieldOrientation.js +0 -28
- package/dist/es6/form-field/index.d.ts +0 -7
- package/dist/es6/form-field/index.d.ts.map +0 -1
- package/dist/es6/form-field/index.js +0 -6
- package/dist/es6/form-field/lib/FormField.d.ts +0 -124
- package/dist/es6/form-field/lib/FormField.d.ts.map +0 -1
- package/dist/es6/form-field/lib/FormField.js +0 -93
- package/dist/es6/form-field/lib/FormFieldContainer.d.ts +0 -11
- package/dist/es6/form-field/lib/FormFieldContainer.d.ts.map +0 -1
- package/dist/es6/form-field/lib/FormFieldContainer.js +0 -13
- package/dist/es6/form-field/lib/FormFieldHint.d.ts +0 -112
- package/dist/es6/form-field/lib/FormFieldHint.d.ts.map +0 -1
- package/dist/es6/form-field/lib/FormFieldHint.js +0 -26
- package/dist/es6/form-field/lib/FormFieldInput.d.ts +0 -9
- package/dist/es6/form-field/lib/FormFieldInput.d.ts.map +0 -1
- package/dist/es6/form-field/lib/FormFieldInput.js +0 -11
- package/dist/es6/form-field/lib/FormFieldLabel.d.ts +0 -122
- package/dist/es6/form-field/lib/FormFieldLabel.d.ts.map +0 -1
- package/dist/es6/form-field/lib/FormFieldLabel.js +0 -23
- package/dist/es6/form-field/lib/formFieldStencil.d.ts +0 -29
- package/dist/es6/form-field/lib/formFieldStencil.d.ts.map +0 -1
- package/dist/es6/form-field/lib/formFieldStencil.js +0 -24
- package/dist/es6/form-field/lib/hooks/index.d.ts +0 -6
- package/dist/es6/form-field/lib/hooks/index.d.ts.map +0 -1
- package/dist/es6/form-field/lib/hooks/index.js +0 -5
- package/dist/es6/form-field/lib/hooks/useFormFieldHint.d.ts +0 -15
- package/dist/es6/form-field/lib/hooks/useFormFieldHint.d.ts.map +0 -1
- package/dist/es6/form-field/lib/hooks/useFormFieldHint.js +0 -11
- package/dist/es6/form-field/lib/hooks/useFormFieldInput.d.ts +0 -19
- package/dist/es6/form-field/lib/hooks/useFormFieldInput.d.ts.map +0 -1
- package/dist/es6/form-field/lib/hooks/useFormFieldInput.js +0 -15
- package/dist/es6/form-field/lib/hooks/useFormFieldLabel.d.ts +0 -15
- package/dist/es6/form-field/lib/hooks/useFormFieldLabel.d.ts.map +0 -1
- package/dist/es6/form-field/lib/hooks/useFormFieldLabel.js +0 -11
- package/dist/es6/form-field/lib/hooks/useFormFieldModel.d.ts +0 -93
- package/dist/es6/form-field/lib/hooks/useFormFieldModel.d.ts.map +0 -1
- package/dist/es6/form-field/lib/hooks/useFormFieldModel.js +0 -37
- package/dist/es6/form-field/lib/hooks/useFormFieldOrientation.d.ts +0 -12
- package/dist/es6/form-field/lib/hooks/useFormFieldOrientation.d.ts.map +0 -1
- package/dist/es6/form-field/lib/hooks/useFormFieldOrientation.js +0 -24
- package/form-field/index.ts +0 -6
- package/form-field/lib/FormField.tsx +0 -114
- package/form-field/lib/FormFieldContainer.tsx +0 -25
- package/form-field/lib/FormFieldHint.tsx +0 -41
- package/form-field/lib/FormFieldInput.tsx +0 -14
- package/form-field/lib/FormFieldLabel.tsx +0 -69
- package/form-field/lib/formFieldStencil.ts +0 -42
- package/form-field/lib/hooks/index.ts +0 -5
- package/form-field/lib/hooks/useFormFieldHint.tsx +0 -12
- package/form-field/lib/hooks/useFormFieldInput.tsx +0 -16
- package/form-field/lib/hooks/useFormFieldLabel.tsx +0 -12
- package/form-field/lib/hooks/useFormFieldModel.tsx +0 -40
- package/form-field/lib/hooks/useFormFieldOrientation.tsx +0 -31
- package/form-field/package.json +0 -6
|
@@ -3,11 +3,11 @@ import {checkIcon} from '@workday/canvas-system-icons-web';
|
|
|
3
3
|
import {ColorInput} from '@workday/canvas-kit-react/color-picker';
|
|
4
4
|
import {SecondaryButton} from '@workday/canvas-kit-react/button';
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
import {FormField} from '@workday/canvas-kit-
|
|
6
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
7
7
|
import styled from '@emotion/styled';
|
|
8
8
|
|
|
9
9
|
import {ResetButton} from './parts/ColorReset';
|
|
10
|
-
import {SwatchBook} from './parts/SwatchBook';
|
|
10
|
+
import {SwatchBook, SwatchBookColorObject} from './parts/SwatchBook';
|
|
11
11
|
|
|
12
12
|
export interface ColorPickerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
13
13
|
/**
|
|
@@ -21,7 +21,7 @@ export interface ColorPickerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
21
21
|
/**
|
|
22
22
|
* The array of colors to be rendered in the swatchbook.
|
|
23
23
|
*/
|
|
24
|
-
colorSet?: string[];
|
|
24
|
+
colorSet?: string[] | SwatchBookColorObject[];
|
|
25
25
|
/**
|
|
26
26
|
* If true, render an input for entering a custom hex color.
|
|
27
27
|
* @default false
|
|
@@ -149,13 +149,19 @@ const HexColorInput = styled(ColorInput)({
|
|
|
149
149
|
width: '168px',
|
|
150
150
|
});
|
|
151
151
|
|
|
152
|
-
const isCustomColor = (colors: string[], hexCode?: string) => {
|
|
152
|
+
const isCustomColor = (colors: (string | SwatchBookColorObject)[], hexCode?: string) => {
|
|
153
153
|
if (!hexCode) {
|
|
154
154
|
return false;
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
const lowercaseHex = hexCode.toLowerCase();
|
|
158
|
-
return !colors.
|
|
158
|
+
return !colors.some((color: string | SwatchBookColorObject) => {
|
|
159
|
+
if (typeof color === 'string') {
|
|
160
|
+
return color.toLowerCase() === lowercaseHex;
|
|
161
|
+
} else {
|
|
162
|
+
return color.value.toLowerCase() === lowercaseHex;
|
|
163
|
+
}
|
|
164
|
+
});
|
|
159
165
|
};
|
|
160
166
|
|
|
161
167
|
export const ColorPicker = ({
|
|
@@ -4,8 +4,13 @@ import {borderRadius, colors, space} from '@workday/canvas-kit-react/tokens';
|
|
|
4
4
|
import {focusRing, mouseFocusBehavior} from '@workday/canvas-kit-react/common';
|
|
5
5
|
import {ColorSwatch} from '@workday/canvas-kit-react/color-picker';
|
|
6
6
|
|
|
7
|
+
export interface SwatchBookColorObject {
|
|
8
|
+
value: string;
|
|
9
|
+
label: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
7
12
|
export interface SwatchBookProps {
|
|
8
|
-
colors: string[];
|
|
13
|
+
colors: (string | SwatchBookColorObject)[];
|
|
9
14
|
value?: string;
|
|
10
15
|
onSelect: (color: string) => void;
|
|
11
16
|
}
|
|
@@ -58,26 +63,33 @@ const Container = styled('div')({
|
|
|
58
63
|
margin: `0px -${space.xxs} -${space.xxs} 0px`,
|
|
59
64
|
});
|
|
60
65
|
|
|
61
|
-
export const SwatchBook = ({colors, value, onSelect}: SwatchBookProps) =>
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
66
|
+
export const SwatchBook = ({colors, value, onSelect}: SwatchBookProps) => {
|
|
67
|
+
return (
|
|
68
|
+
<Container>
|
|
69
|
+
{colors.map((color: string | SwatchBookColorObject, index: number) => {
|
|
70
|
+
const hexCode = typeof color === 'object' ? color.value : color;
|
|
71
|
+
const label = typeof color === 'object' ? color.label : color;
|
|
72
|
+
const isSelected = value ? hexCode.toLowerCase() === value.toLowerCase() : false;
|
|
65
73
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
74
|
+
const handleClick = () => onSelect(hexCode);
|
|
75
|
+
const handleKeyDown = (event: React.KeyboardEvent) =>
|
|
76
|
+
(event.key === 'Enter' || event.key === ' ') && onSelect(hexCode);
|
|
69
77
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
);
|
|
78
|
+
return (
|
|
79
|
+
<SwatchContainer
|
|
80
|
+
key={index + '-' + color}
|
|
81
|
+
onClick={handleClick}
|
|
82
|
+
onKeyDown={handleKeyDown}
|
|
83
|
+
tabIndex={0}
|
|
84
|
+
isSelected={isSelected}
|
|
85
|
+
role="button"
|
|
86
|
+
aria-label={label}
|
|
87
|
+
aria-selected={isSelected}
|
|
88
|
+
>
|
|
89
|
+
<ColorSwatch color={hexCode} showCheck={isSelected} />
|
|
90
|
+
</SwatchContainer>
|
|
91
|
+
);
|
|
92
|
+
})}
|
|
93
|
+
</Container>
|
|
94
|
+
);
|
|
95
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { SwatchBookColorObject } from './parts/SwatchBook';
|
|
2
3
|
export interface ColorPickerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
4
|
/**
|
|
4
5
|
* The function called when the ColorPicker state changes.
|
|
@@ -11,7 +12,7 @@ export interface ColorPickerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
11
12
|
/**
|
|
12
13
|
* The array of colors to be rendered in the swatchbook.
|
|
13
14
|
*/
|
|
14
|
-
colorSet?: string[];
|
|
15
|
+
colorSet?: string[] | SwatchBookColorObject[];
|
|
15
16
|
/**
|
|
16
17
|
* If true, render an input for entering a custom hex color.
|
|
17
18
|
* @default false
|
|
@@ -48,7 +49,7 @@ export interface ColorPickerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
48
49
|
resetLabel?: string;
|
|
49
50
|
}
|
|
50
51
|
export declare const ColorPicker: {
|
|
51
|
-
({ colorSet, customHexInputLabel, submitLabel, onColorChange, onColorReset, onSubmitClick, resetLabel, resetColor, value, showCustomHexInput, ...elemProps }: ColorPickerProps): JSX.Element;
|
|
52
|
+
({ colorSet, customHexInputLabel, submitLabel, onColorChange, onColorReset, onSubmitClick, resetLabel, resetColor, value, showCustomHexInput, ...elemProps }: ColorPickerProps): React.JSX.Element;
|
|
52
53
|
defaultColorSet: string[];
|
|
53
54
|
};
|
|
54
55
|
//# sourceMappingURL=ColorPicker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../../../color-picker/lib/ColorPicker.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../../../color-picker/lib/ColorPicker.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAa,qBAAqB,EAAC,MAAM,oBAAoB,CAAC;AAErE,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5E;;OAEG;IACH,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,qBAAqB,EAAE,CAAC;IAC9C;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,KAAK,IAAI,CAAC;IACjD;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AA4GD,eAAO,MAAM,WAAW;kKAYrB,gBAAgB;;CAsDlB,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -28,7 +32,7 @@ const canvas_system_icons_web_1 = require("@workday/canvas-system-icons-web");
|
|
|
28
32
|
const color_picker_1 = require("@workday/canvas-kit-react/color-picker");
|
|
29
33
|
const button_1 = require("@workday/canvas-kit-react/button");
|
|
30
34
|
const React = __importStar(require("react"));
|
|
31
|
-
const form_field_1 = require("@workday/canvas-kit-
|
|
35
|
+
const form_field_1 = require("@workday/canvas-kit-react/form-field");
|
|
32
36
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
33
37
|
const ColorReset_1 = require("./parts/ColorReset");
|
|
34
38
|
const SwatchBook_1 = require("./parts/SwatchBook");
|
|
@@ -90,25 +94,25 @@ const defaultColorSet = [
|
|
|
90
94
|
tokens_1.colors.frenchVanilla200,
|
|
91
95
|
tokens_1.colors.frenchVanilla100,
|
|
92
96
|
];
|
|
93
|
-
const ColorPickerContainer = styled_1.default('div')({
|
|
97
|
+
const ColorPickerContainer = (0, styled_1.default)('div')({
|
|
94
98
|
width: 216,
|
|
95
99
|
});
|
|
96
|
-
const ColorInputWrapper = styled_1.default('form')({
|
|
100
|
+
const ColorInputWrapper = (0, styled_1.default)('form')({
|
|
97
101
|
width: '100%',
|
|
98
102
|
marginTop: tokens_1.space.s,
|
|
99
103
|
display: 'flex',
|
|
100
104
|
flexDirection: 'row',
|
|
101
105
|
justifyContent: 'space-between',
|
|
102
106
|
});
|
|
103
|
-
const ColorInputAndLabel = styled_1.default(form_field_1.FormField)({
|
|
107
|
+
const ColorInputAndLabel = (0, styled_1.default)(form_field_1.FormField)({
|
|
104
108
|
display: 'flex',
|
|
105
109
|
flexDirection: 'column',
|
|
106
110
|
margin: 0,
|
|
107
111
|
});
|
|
108
|
-
const CheckButton = styled_1.default(button_1.SecondaryButton)({
|
|
112
|
+
const CheckButton = (0, styled_1.default)(button_1.SecondaryButton)({
|
|
109
113
|
alignSelf: 'flex-end',
|
|
110
114
|
});
|
|
111
|
-
const HexColorInput = styled_1.default(color_picker_1.ColorInput)({
|
|
115
|
+
const HexColorInput = (0, styled_1.default)(color_picker_1.ColorInput)({
|
|
112
116
|
width: '168px',
|
|
113
117
|
});
|
|
114
118
|
const isCustomColor = (colors, hexCode) => {
|
|
@@ -116,7 +120,14 @@ const isCustomColor = (colors, hexCode) => {
|
|
|
116
120
|
return false;
|
|
117
121
|
}
|
|
118
122
|
const lowercaseHex = hexCode.toLowerCase();
|
|
119
|
-
return !colors.
|
|
123
|
+
return !colors.some((color) => {
|
|
124
|
+
if (typeof color === 'string') {
|
|
125
|
+
return color.toLowerCase() === lowercaseHex;
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
return color.value.toLowerCase() === lowercaseHex;
|
|
129
|
+
}
|
|
130
|
+
});
|
|
120
131
|
};
|
|
121
132
|
const ColorPicker = ({ colorSet = defaultColorSet, customHexInputLabel = 'Custom Hex Color', submitLabel = 'Submit', onColorChange, onColorReset, onSubmitClick, resetLabel = 'Reset', resetColor, value = '', showCustomHexInput = false, ...elemProps }) => {
|
|
122
133
|
const [validHexValue, setValidHexValue] = React.useState('');
|
|
@@ -138,7 +149,7 @@ const ColorPicker = ({ colorSet = defaultColorSet, customHexInputLabel = 'Custom
|
|
|
138
149
|
onColorChange(validHexValue);
|
|
139
150
|
event.preventDefault(); // don't submit the form - default action is to reload the page
|
|
140
151
|
};
|
|
141
|
-
return (React.createElement(ColorPickerContainer,
|
|
152
|
+
return (React.createElement(ColorPickerContainer, { ...elemProps },
|
|
142
153
|
onColorReset && resetColor && (React.createElement(ColorReset_1.ResetButton, { onClick: onColorReset, resetColor: resetColor, label: resetLabel })),
|
|
143
154
|
React.createElement(SwatchBook_1.SwatchBook, { colors: colorSet, onSelect: onColorChange, value: value }),
|
|
144
155
|
showCustomHexInput && (React.createElement(ColorInputWrapper, { onSubmit: onSubmit },
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
export interface ResetButtonProps {
|
|
2
3
|
label: string;
|
|
3
4
|
resetColor: string;
|
|
4
5
|
onClick: (color: string) => void;
|
|
5
6
|
}
|
|
6
|
-
export declare const ResetButton: ({ onClick, resetColor, label }: ResetButtonProps) => JSX.Element;
|
|
7
|
+
export declare const ResetButton: ({ onClick, resetColor, label }: ResetButtonProps) => React.JSX.Element;
|
|
7
8
|
//# sourceMappingURL=ColorReset.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorReset.d.ts","sourceRoot":"","sources":["../../../../../color-picker/lib/parts/ColorReset.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ColorReset.d.ts","sourceRoot":"","sources":["../../../../../color-picker/lib/parts/ColorReset.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC;AAoCD,eAAO,MAAM,WAAW,mCAAkC,gBAAgB,sBASzE,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -28,10 +32,10 @@ const styled_1 = __importDefault(require("@emotion/styled"));
|
|
|
28
32
|
const tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
29
33
|
const common_1 = require("@workday/canvas-kit-react/common");
|
|
30
34
|
const color_picker_1 = require("@workday/canvas-kit-react/color-picker");
|
|
31
|
-
const Label = styled_1.default('div')({
|
|
35
|
+
const Label = (0, styled_1.default)('div')({
|
|
32
36
|
marginLeft: tokens_1.space.xxs,
|
|
33
37
|
});
|
|
34
|
-
const Container = styled_1.default('button')({
|
|
38
|
+
const Container = (0, styled_1.default)('button')({
|
|
35
39
|
display: 'flex',
|
|
36
40
|
alignItems: 'center',
|
|
37
41
|
justifyContent: 'flex-start',
|
|
@@ -53,7 +57,7 @@ const Container = styled_1.default('button')({
|
|
|
53
57
|
backgroundColor: tokens_1.colors.soap400,
|
|
54
58
|
},
|
|
55
59
|
'&:focus': {
|
|
56
|
-
...common_1.focusRing(),
|
|
60
|
+
...(0, common_1.focusRing)(),
|
|
57
61
|
},
|
|
58
62
|
...common_1.hideMouseFocus,
|
|
59
63
|
});
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface SwatchBookColorObject {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
1
6
|
export interface SwatchBookProps {
|
|
2
|
-
colors: string[];
|
|
7
|
+
colors: (string | SwatchBookColorObject)[];
|
|
3
8
|
value?: string;
|
|
4
9
|
onSelect: (color: string) => void;
|
|
5
10
|
}
|
|
6
|
-
export declare const SwatchBook: ({ colors, value, onSelect }: SwatchBookProps) => JSX.Element;
|
|
11
|
+
export declare const SwatchBook: ({ colors, value, onSelect }: SwatchBookProps) => React.JSX.Element;
|
|
7
12
|
//# sourceMappingURL=SwatchBook.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwatchBook.d.ts","sourceRoot":"","sources":["../../../../../color-picker/lib/parts/SwatchBook.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SwatchBook.d.ts","sourceRoot":"","sources":["../../../../../color-picker/lib/parts/SwatchBook.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,CAAC,MAAM,GAAG,qBAAqB,CAAC,EAAE,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAkDD,eAAO,MAAM,UAAU,gCAA+B,eAAe,sBA6BpE,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -29,7 +33,7 @@ const tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
|
29
33
|
const common_1 = require("@workday/canvas-kit-react/common");
|
|
30
34
|
const color_picker_1 = require("@workday/canvas-kit-react/color-picker");
|
|
31
35
|
const accessibilityBorder = `${tokens_1.colors.frenchVanilla100} 0px 0px 0px 2px, ${tokens_1.colors.licorice200} 0px 0px 0px 3px`;
|
|
32
|
-
const SwatchContainer = styled_1.default('div')({
|
|
36
|
+
const SwatchContainer = (0, styled_1.default)('div')({
|
|
33
37
|
display: 'flex',
|
|
34
38
|
width: 20,
|
|
35
39
|
height: 20,
|
|
@@ -42,11 +46,11 @@ const SwatchContainer = styled_1.default('div')({
|
|
|
42
46
|
},
|
|
43
47
|
'&:focus': {
|
|
44
48
|
outline: 'none',
|
|
45
|
-
...common_1.focusRing({ separation: 2 }),
|
|
49
|
+
...(0, common_1.focusRing)({ separation: 2 }),
|
|
46
50
|
},
|
|
47
51
|
}, ({ isSelected }) => ({
|
|
48
52
|
boxShadow: isSelected ? accessibilityBorder : undefined,
|
|
49
|
-
...common_1.mouseFocusBehavior({
|
|
53
|
+
...(0, common_1.mouseFocusBehavior)({
|
|
50
54
|
'&:focus': {
|
|
51
55
|
animation: 'none',
|
|
52
56
|
boxShadow: 'none',
|
|
@@ -59,16 +63,20 @@ const SwatchContainer = styled_1.default('div')({
|
|
|
59
63
|
},
|
|
60
64
|
}),
|
|
61
65
|
}));
|
|
62
|
-
const Container = styled_1.default('div')({
|
|
66
|
+
const Container = (0, styled_1.default)('div')({
|
|
63
67
|
display: 'flex',
|
|
64
68
|
flexWrap: 'wrap',
|
|
65
69
|
margin: `0px -${tokens_1.space.xxs} -${tokens_1.space.xxs} 0px`,
|
|
66
70
|
});
|
|
67
|
-
const SwatchBook = ({ colors, value, onSelect }) =>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
const SwatchBook = ({ colors, value, onSelect }) => {
|
|
72
|
+
return (React.createElement(Container, null, colors.map((color, index) => {
|
|
73
|
+
const hexCode = typeof color === 'object' ? color.value : color;
|
|
74
|
+
const label = typeof color === 'object' ? color.label : color;
|
|
75
|
+
const isSelected = value ? hexCode.toLowerCase() === value.toLowerCase() : false;
|
|
76
|
+
const handleClick = () => onSelect(hexCode);
|
|
77
|
+
const handleKeyDown = (event) => (event.key === 'Enter' || event.key === ' ') && onSelect(hexCode);
|
|
78
|
+
return (React.createElement(SwatchContainer, { key: index + '-' + color, onClick: handleClick, onKeyDown: handleKeyDown, tabIndex: 0, isSelected: isSelected, role: "button", "aria-label": label, "aria-selected": isSelected },
|
|
79
|
+
React.createElement(color_picker_1.ColorSwatch, { color: hexCode, showCheck: isSelected })));
|
|
80
|
+
})));
|
|
81
|
+
};
|
|
74
82
|
exports.SwatchBook = SwatchBook;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../divider/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -10,8 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
15
|
};
|
|
12
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./
|
|
14
|
-
__exportStar(require("./useFormFieldHint"), exports);
|
|
15
|
-
__exportStar(require("./useFormFieldInput"), exports);
|
|
16
|
-
__exportStar(require("./useFormFieldModel"), exports);
|
|
17
|
-
__exportStar(require("./useFormFieldLabel"), exports);
|
|
17
|
+
__exportStar(require("./lib/Divider"), exports);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CSProps } from '@workday/canvas-kit-styling';
|
|
2
|
+
export declare const dividerStencil: import("@workday/canvas-kit-styling").Stencil<import("@workday/canvas-kit-styling").StencilModifierConfig<{
|
|
3
|
+
space: string;
|
|
4
|
+
}, never>, {
|
|
5
|
+
space: string;
|
|
6
|
+
}, never, never>;
|
|
7
|
+
export interface DividerProps extends CSProps {
|
|
8
|
+
/**
|
|
9
|
+
* Applies top and bottom margin evenly. It divides the provided value by two and applies half to each end.
|
|
10
|
+
* E.g. `space="2rem"` would apply `1rem` margin to the top, and `1rem` margin to the bottom.
|
|
11
|
+
* @default `system.space.x4` (1rem)
|
|
12
|
+
*/
|
|
13
|
+
space?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* # Divider
|
|
17
|
+
* A divider to segment and visually organize content. By default, it renders a semantic `[<hr>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hr)` element.
|
|
18
|
+
*
|
|
19
|
+
* [View Docs](https://workday.github.io/canvas-kit/?path=/docs/preview-divider-react)
|
|
20
|
+
*
|
|
21
|
+
* The `space` prop will equally apply top and bottom margin styles.
|
|
22
|
+
* In the example below, `x2` (0.5rem), adds `0.25rem` margin to the top and `0.25rem` to the bottom
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* import { Divider } from '@workday/canvas-kit-preview-react/divider';
|
|
27
|
+
* import {system} from '@workday/canvas-tokens-web';
|
|
28
|
+
*
|
|
29
|
+
* <Divider space={system.space.x2} />
|
|
30
|
+
*
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare const Divider: import("@workday/canvas-kit-react/common").ElementComponent<"hr", DividerProps>;
|
|
34
|
+
//# sourceMappingURL=Divider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Divider.d.ts","sourceRoot":"","sources":["../../../../divider/lib/Divider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,OAAO,EAIR,MAAM,6BAA6B,CAAC;AAGrC,eAAO,MAAM,cAAc;;;;gBAazB,CAAC;AAEH,MAAM,WAAW,YAAa,SAAQ,OAAO;IAC3C;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,OAAO,iFAKlB,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.Divider = exports.dividerStencil = void 0;
|
|
27
|
+
const React = __importStar(require("react"));
|
|
28
|
+
const common_1 = require("@workday/canvas-kit-react/common");
|
|
29
|
+
const canvas_kit_styling_1 = require("@workday/canvas-kit-styling");
|
|
30
|
+
const canvas_tokens_web_1 = require("@workday/canvas-tokens-web");
|
|
31
|
+
exports.dividerStencil = (0, canvas_kit_styling_1.createStencil)({
|
|
32
|
+
vars: {
|
|
33
|
+
space: (0, canvas_kit_styling_1.cssVar)(canvas_tokens_web_1.system.space.x4),
|
|
34
|
+
},
|
|
35
|
+
base: { name: "d4qa2", styles: "--space-divider-156e29:var(--cnvs-sys-space-x4);box-sizing:border-box;display:block;height:0.0625rem;border:none;border-top:1px solid var(--cnvs-sys-color-border-divider);margin:calc(var(--space-divider-156e29) / 2) 0;" }
|
|
36
|
+
}, "divider-156e29");
|
|
37
|
+
/**
|
|
38
|
+
* # Divider
|
|
39
|
+
* A divider to segment and visually organize content. By default, it renders a semantic `[<hr>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hr)` element.
|
|
40
|
+
*
|
|
41
|
+
* [View Docs](https://workday.github.io/canvas-kit/?path=/docs/preview-divider-react)
|
|
42
|
+
*
|
|
43
|
+
* The `space` prop will equally apply top and bottom margin styles.
|
|
44
|
+
* In the example below, `x2` (0.5rem), adds `0.25rem` margin to the top and `0.25rem` to the bottom
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* import { Divider } from '@workday/canvas-kit-preview-react/divider';
|
|
49
|
+
* import {system} from '@workday/canvas-tokens-web';
|
|
50
|
+
*
|
|
51
|
+
* <Divider space={system.space.x2} />
|
|
52
|
+
*
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
exports.Divider = (0, common_1.createComponent)('hr')({
|
|
56
|
+
displayName: 'Divider',
|
|
57
|
+
Component: ({ space, ...elemProps }, ref, Element) => (React.createElement(Element, { ref: ref, ...(0, canvas_kit_styling_1.handleCsProp)(elemProps, (0, exports.dividerStencil)({ space })) })),
|
|
58
|
+
});
|
package/dist/commonjs/index.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
export * from './color-picker';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './divider';
|
|
3
3
|
export * from './loading-sparkles';
|
|
4
4
|
export * from './menu';
|
|
5
5
|
export * from './pill';
|
|
6
|
+
export * from './radio';
|
|
6
7
|
export * from './segmented-control';
|
|
8
|
+
export * from './select';
|
|
7
9
|
export * from './side-panel';
|
|
8
10
|
export * from './status-indicator';
|
|
9
11
|
export * from './text-area';
|
|
10
12
|
export * from './text-input';
|
|
11
|
-
export * from './radio';
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC;AACpC,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
|
package/dist/commonjs/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -11,13 +15,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11
15
|
};
|
|
12
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
17
|
__exportStar(require("./color-picker"), exports);
|
|
14
|
-
__exportStar(require("./
|
|
18
|
+
__exportStar(require("./divider"), exports);
|
|
15
19
|
__exportStar(require("./loading-sparkles"), exports);
|
|
16
20
|
__exportStar(require("./menu"), exports);
|
|
17
21
|
__exportStar(require("./pill"), exports);
|
|
22
|
+
__exportStar(require("./radio"), exports);
|
|
18
23
|
__exportStar(require("./segmented-control"), exports);
|
|
24
|
+
__exportStar(require("./select"), exports);
|
|
19
25
|
__exportStar(require("./side-panel"), exports);
|
|
20
26
|
__exportStar(require("./status-indicator"), exports);
|
|
21
27
|
__exportStar(require("./text-area"), exports);
|
|
22
28
|
__exportStar(require("./text-input"), exports);
|
|
23
|
-
__exportStar(require("./radio"), exports);
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -45,22 +49,22 @@ const AI_COLORS = {
|
|
|
45
49
|
/**
|
|
46
50
|
* The animation for the sparkle.
|
|
47
51
|
*/
|
|
48
|
-
const LOADING_ANIMATION = canvas_kit_styling_1.keyframes({ name: "
|
|
49
|
-
const loadingSparklesIconStyles = canvas_kit_styling_1.createStyles({ name: "
|
|
52
|
+
const LOADING_ANIMATION = (0, canvas_kit_styling_1.keyframes)({ name: "d4qa3", styles: "0%, 79%, 100%{opacity:0.2;transform:scale(0.55);}27%{opacity:1;transform:scale(1);}53%{opacity:0.6;transform:scale(0.7);}" });
|
|
53
|
+
const loadingSparklesIconStyles = (0, canvas_kit_styling_1.createStyles)({ name: "d4qa4", styles: "animation-duration:1230ms;animation-fill-mode:both;animation-iteration-count:infinite;animation-name:animation-d4qa3;animation-timing-function:ease-in-out;.wd-sparkle-fill{fill:#8C17D2;}&:nth-child(1){animation-delay:0ms;}&:nth-child(2){animation-delay:calc(1230ms * (1/3));}&:nth-child(3){animation-delay:calc(1230ms * (2/3));}" });
|
|
50
54
|
/**
|
|
51
55
|
* An individual loading sparkle. ✨
|
|
52
56
|
*/
|
|
53
57
|
const Sparkle = () => {
|
|
54
|
-
return (React.createElement(icon_1.SystemIcon, { icon: sparkleIcon_1.sparkleIcon, cs: [loadingSparklesIconStyles], size: canvas_kit_styling_1.cssVar(canvas_tokens_web_1.system.space.x3) }));
|
|
58
|
+
return (React.createElement(icon_1.SystemIcon, { icon: sparkleIcon_1.sparkleIcon, cs: [loadingSparklesIconStyles], size: (0, canvas_kit_styling_1.cssVar)(canvas_tokens_web_1.system.space.x3) }));
|
|
55
59
|
};
|
|
56
|
-
const loadingSparklesStyles = canvas_kit_styling_1.createStyles({ name: "
|
|
60
|
+
const loadingSparklesStyles = (0, canvas_kit_styling_1.createStyles)({ name: "d4qa5", styles: "display:inline-flex;gap:0.0625rem;" });
|
|
57
61
|
/**
|
|
58
62
|
* A simple component that displays three horizontal sparkles, to be used when an AI operation is in progress.
|
|
59
63
|
*/
|
|
60
|
-
exports.LoadingSparkles = common_1.createComponent('div')({
|
|
64
|
+
exports.LoadingSparkles = (0, common_1.createComponent)('div')({
|
|
61
65
|
displayName: 'LoadingSparkles',
|
|
62
66
|
Component: (elemProps, ref, Element) => {
|
|
63
|
-
return (React.createElement(Element,
|
|
67
|
+
return (React.createElement(Element, { ref: ref, role: "status", ...(0, canvas_kit_styling_1.handleCsProp)(elemProps, loadingSparklesStyles) },
|
|
64
68
|
React.createElement(Sparkle, null),
|
|
65
69
|
React.createElement(Sparkle, null),
|
|
66
70
|
React.createElement(Sparkle, null)));
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -65,7 +65,7 @@ export declare class DeprecatedMenu extends React.Component<DeprecatedMenuProps,
|
|
|
65
65
|
componentDidUpdate(prevProps: DeprecatedMenuProps): void;
|
|
66
66
|
componentDidMount(): void;
|
|
67
67
|
componentWillUnmount(): void;
|
|
68
|
-
render(): JSX.Element;
|
|
68
|
+
render(): React.JSX.Element;
|
|
69
69
|
getNormalizedItemIndex: (index: number | undefined) => number;
|
|
70
70
|
setNormalizedItemIndex: (index: number | undefined) => void;
|
|
71
71
|
private handleKeyboardShortcuts;
|