@workday/canvas-kit-preview-react 8.0.0-alpha.254-next.23 → 8.0.0-alpha.428-next.2
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 +1 -1
- package/dist/commonjs/color-picker/lib/ColorPicker.js +25 -48
- package/dist/commonjs/color-picker/lib/parts/ColorReset.js +32 -23
- package/dist/commonjs/color-picker/lib/parts/SwatchBook.js +26 -39
- package/dist/commonjs/form-field/lib/FormField.d.ts +4 -10
- package/dist/commonjs/form-field/lib/FormField.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/FormField.js +10 -33
- package/dist/commonjs/form-field/lib/FormFieldHint.d.ts +1 -1
- package/dist/commonjs/form-field/lib/FormFieldHint.js +8 -31
- package/dist/commonjs/form-field/lib/FormFieldInput.d.ts +1 -1
- package/dist/commonjs/form-field/lib/FormFieldInput.js +6 -17
- package/dist/commonjs/form-field/lib/FormFieldLabel.d.ts +2 -8
- package/dist/commonjs/form-field/lib/FormFieldLabel.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/FormFieldLabel.js +8 -31
- package/dist/commonjs/form-field/lib/hooks/useFormFieldHint.d.ts +3 -5
- package/dist/commonjs/form-field/lib/hooks/useFormFieldHint.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/hooks/useFormFieldHint.js +4 -5
- package/dist/commonjs/form-field/lib/hooks/useFormFieldInput.d.ts +3 -5
- package/dist/commonjs/form-field/lib/hooks/useFormFieldInput.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/hooks/useFormFieldInput.js +5 -6
- package/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.d.ts +3 -5
- package/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.js +4 -5
- package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.d.ts +2 -12
- package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.js +9 -19
- package/dist/commonjs/form-field/lib/hooks/useFormFieldOrientation.d.ts +4 -4
- package/dist/commonjs/form-field/lib/hooks/useFormFieldOrientation.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/hooks/useFormFieldOrientation.js +5 -5
- package/dist/commonjs/menu/lib/Menu.d.ts +16 -9
- package/dist/commonjs/menu/lib/Menu.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/Menu.js +108 -132
- package/dist/commonjs/menu/lib/MenuItem.d.ts +17 -7
- package/dist/commonjs/menu/lib/MenuItem.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/MenuItem.js +111 -114
- package/dist/commonjs/pill/lib/Pill.d.ts +103 -5
- package/dist/commonjs/pill/lib/Pill.d.ts.map +1 -1
- package/dist/commonjs/pill/lib/Pill.js +158 -64
- package/dist/commonjs/pill/lib/PillAvatar.js +6 -17
- package/dist/commonjs/pill/lib/PillCount.js +7 -30
- package/dist/commonjs/pill/lib/PillIcon.js +8 -31
- package/dist/commonjs/pill/lib/PillIconButton.js +13 -36
- package/dist/commonjs/pill/lib/PillLabel.js +10 -33
- package/dist/commonjs/pill/lib/usePillModel.js +8 -16
- package/dist/commonjs/segmented-control/index.d.ts +2 -0
- package/dist/commonjs/segmented-control/index.d.ts.map +1 -1
- package/dist/commonjs/segmented-control/index.js +4 -0
- package/dist/commonjs/segmented-control/lib/SegmentedControl.d.ts +267 -82
- package/dist/commonjs/segmented-control/lib/SegmentedControl.d.ts.map +1 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControl.js +42 -7
- package/dist/commonjs/segmented-control/lib/SegmentedControlItem.d.ts +9 -5
- package/dist/commonjs/segmented-control/lib/SegmentedControlItem.d.ts.map +1 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControlItem.js +24 -49
- package/dist/commonjs/segmented-control/lib/SegmentedControlList.d.ts +71 -2
- package/dist/commonjs/segmented-control/lib/SegmentedControlList.d.ts.map +1 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControlList.js +15 -40
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlItem.d.ts +28 -9
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlItem.d.ts.map +1 -1
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlItem.js +8 -10
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.d.ts +233 -83
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.d.ts.map +1 -1
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.js +33 -32
- package/dist/commonjs/select/lib/Select.js +147 -187
- package/dist/commonjs/select/lib/SelectBase.js +106 -101
- package/dist/commonjs/select/lib/SelectMenu.js +53 -84
- package/dist/commonjs/select/lib/SelectOption.js +33 -47
- package/dist/commonjs/select/lib/scrolling.js +6 -7
- package/dist/commonjs/select/lib/utils.js +4 -4
- package/dist/commonjs/side-panel/lib/SidePanel.d.ts +13 -26
- package/dist/commonjs/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/commonjs/side-panel/lib/SidePanel.js +95 -133
- package/dist/commonjs/side-panel/lib/SidePanelToggleButton.d.ts +17 -0
- package/dist/commonjs/side-panel/lib/SidePanelToggleButton.d.ts.map +1 -0
- package/dist/commonjs/side-panel/lib/SidePanelToggleButton.js +65 -0
- package/dist/commonjs/side-panel/lib/hooks.d.ts +20 -0
- package/dist/commonjs/side-panel/lib/hooks.d.ts.map +1 -1
- package/dist/commonjs/side-panel/lib/hooks.js +40 -21
- package/dist/commonjs/status-indicator/index.d.ts +2 -0
- package/dist/commonjs/status-indicator/index.d.ts.map +1 -1
- package/dist/commonjs/status-indicator/index.js +4 -0
- package/dist/commonjs/status-indicator/lib/StatusIndicator.d.ts +32 -8
- package/dist/commonjs/status-indicator/lib/StatusIndicator.d.ts.map +1 -1
- package/dist/commonjs/status-indicator/lib/StatusIndicator.js +37 -35
- package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.d.ts +10 -0
- package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.d.ts.map +1 -1
- package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.js +11 -23
- package/dist/commonjs/status-indicator/lib/StatusIndicatorLabel.js +5 -28
- package/dist/commonjs/status-indicator/lib/hooks/useStatusIndicatorModel.js +6 -15
- package/dist/commonjs/table/index.d.ts +2 -0
- package/dist/commonjs/table/index.d.ts.map +1 -0
- package/dist/commonjs/{text-area/lib/hooks → table}/index.js +1 -1
- package/dist/commonjs/table/lib/Table.d.ts +207 -0
- package/dist/commonjs/table/lib/Table.d.ts.map +1 -0
- package/dist/commonjs/table/lib/Table.js +229 -0
- package/dist/commonjs/table/lib/TableBody.d.ts +2 -0
- package/dist/commonjs/table/lib/TableBody.d.ts.map +1 -0
- package/dist/commonjs/table/lib/TableBody.js +35 -0
- package/dist/commonjs/table/lib/TableCaption.d.ts +2 -0
- package/dist/commonjs/table/lib/TableCaption.d.ts.map +1 -0
- package/dist/commonjs/table/lib/TableCaption.js +16 -0
- package/dist/commonjs/table/lib/TableCell.d.ts +2 -0
- package/dist/commonjs/table/lib/TableCell.d.ts.map +1 -0
- package/dist/commonjs/table/lib/TableCell.js +16 -0
- package/dist/commonjs/table/lib/TableFooter.d.ts +2 -0
- package/dist/commonjs/table/lib/TableFooter.d.ts.map +1 -0
- package/dist/commonjs/table/lib/TableFooter.js +15 -0
- package/dist/commonjs/table/lib/TableHead.d.ts +2 -0
- package/dist/commonjs/table/lib/TableHead.d.ts.map +1 -0
- package/dist/commonjs/table/lib/TableHead.js +23 -0
- package/dist/commonjs/table/lib/TableHeader.d.ts +2 -0
- package/dist/commonjs/table/lib/TableHeader.d.ts.map +1 -0
- package/dist/commonjs/table/lib/TableHeader.js +16 -0
- package/dist/commonjs/table/lib/TableRow.d.ts +2 -0
- package/dist/commonjs/table/lib/TableRow.d.ts.map +1 -0
- package/dist/commonjs/table/lib/TableRow.js +19 -0
- package/dist/commonjs/text-area/lib/TextArea.d.ts +2 -2
- package/dist/commonjs/text-area/lib/TextArea.d.ts.map +1 -1
- package/dist/commonjs/text-area/lib/TextArea.js +9 -33
- package/dist/commonjs/text-area/lib/TextAreaField.d.ts +1 -1
- package/dist/commonjs/text-area/lib/TextAreaField.d.ts.map +1 -1
- package/dist/commonjs/text-area/lib/TextAreaField.js +12 -36
- package/dist/commonjs/text-input/lib/TextInput.d.ts +4 -4
- package/dist/commonjs/text-input/lib/TextInput.d.ts.map +1 -1
- package/dist/commonjs/text-input/lib/TextInput.js +9 -33
- package/dist/commonjs/text-input/lib/TextInputField.d.ts +1 -1
- package/dist/commonjs/text-input/lib/TextInputField.d.ts.map +1 -1
- package/dist/commonjs/text-input/lib/TextInputField.js +13 -25
- package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts +3 -5
- package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts.map +1 -1
- package/dist/commonjs/text-input/lib/hooks/useTextInputField.js +3 -3
- package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts +1 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -1
- package/dist/commonjs/text-input/lib/hooks/useTextInputModel.js +2 -1
- package/dist/es6/color-picker/lib/ColorPicker.js +16 -39
- package/dist/es6/color-picker/lib/parts/ColorReset.js +27 -18
- package/dist/es6/color-picker/lib/parts/SwatchBook.js +21 -34
- package/dist/es6/form-field/lib/FormField.d.ts +4 -10
- package/dist/es6/form-field/lib/FormField.d.ts.map +1 -1
- package/dist/es6/form-field/lib/FormField.js +5 -28
- package/dist/es6/form-field/lib/FormFieldHint.d.ts +1 -1
- package/dist/es6/form-field/lib/FormFieldHint.js +4 -27
- package/dist/es6/form-field/lib/FormFieldInput.d.ts +1 -1
- package/dist/es6/form-field/lib/FormFieldInput.js +3 -14
- package/dist/es6/form-field/lib/FormFieldLabel.d.ts +2 -8
- package/dist/es6/form-field/lib/FormFieldLabel.d.ts.map +1 -1
- package/dist/es6/form-field/lib/FormFieldLabel.js +5 -28
- package/dist/es6/form-field/lib/hooks/useFormFieldHint.d.ts +3 -5
- package/dist/es6/form-field/lib/hooks/useFormFieldHint.d.ts.map +1 -1
- package/dist/es6/form-field/lib/hooks/useFormFieldHint.js +2 -3
- package/dist/es6/form-field/lib/hooks/useFormFieldInput.d.ts +3 -5
- package/dist/es6/form-field/lib/hooks/useFormFieldInput.d.ts.map +1 -1
- package/dist/es6/form-field/lib/hooks/useFormFieldInput.js +3 -4
- package/dist/es6/form-field/lib/hooks/useFormFieldLabel.d.ts +3 -5
- package/dist/es6/form-field/lib/hooks/useFormFieldLabel.d.ts.map +1 -1
- package/dist/es6/form-field/lib/hooks/useFormFieldLabel.js +2 -3
- package/dist/es6/form-field/lib/hooks/useFormFieldModel.d.ts +2 -12
- package/dist/es6/form-field/lib/hooks/useFormFieldModel.d.ts.map +1 -1
- package/dist/es6/form-field/lib/hooks/useFormFieldModel.js +9 -19
- package/dist/es6/form-field/lib/hooks/useFormFieldOrientation.d.ts +4 -4
- package/dist/es6/form-field/lib/hooks/useFormFieldOrientation.d.ts.map +1 -1
- package/dist/es6/form-field/lib/hooks/useFormFieldOrientation.js +4 -4
- package/dist/es6/menu/lib/Menu.d.ts +16 -9
- package/dist/es6/menu/lib/Menu.d.ts.map +1 -1
- package/dist/es6/menu/lib/Menu.js +103 -128
- package/dist/es6/menu/lib/MenuItem.d.ts +17 -7
- package/dist/es6/menu/lib/MenuItem.d.ts.map +1 -1
- package/dist/es6/menu/lib/MenuItem.js +107 -111
- package/dist/es6/pill/lib/Pill.d.ts +103 -5
- package/dist/es6/pill/lib/Pill.d.ts.map +1 -1
- package/dist/es6/pill/lib/Pill.js +149 -55
- package/dist/es6/pill/lib/PillAvatar.js +3 -14
- package/dist/es6/pill/lib/PillCount.js +4 -27
- package/dist/es6/pill/lib/PillIcon.js +3 -26
- package/dist/es6/pill/lib/PillIconButton.js +7 -30
- package/dist/es6/pill/lib/PillLabel.js +5 -28
- package/dist/es6/pill/lib/usePillModel.js +8 -16
- package/dist/es6/segmented-control/index.d.ts +2 -0
- package/dist/es6/segmented-control/index.d.ts.map +1 -1
- package/dist/es6/segmented-control/index.js +2 -0
- package/dist/es6/segmented-control/lib/SegmentedControl.d.ts +267 -82
- package/dist/es6/segmented-control/lib/SegmentedControl.d.ts.map +1 -1
- package/dist/es6/segmented-control/lib/SegmentedControl.js +38 -3
- package/dist/es6/segmented-control/lib/SegmentedControlItem.d.ts +9 -5
- package/dist/es6/segmented-control/lib/SegmentedControlItem.d.ts.map +1 -1
- package/dist/es6/segmented-control/lib/SegmentedControlItem.js +17 -42
- package/dist/es6/segmented-control/lib/SegmentedControlList.d.ts +71 -2
- package/dist/es6/segmented-control/lib/SegmentedControlList.d.ts.map +1 -1
- package/dist/es6/segmented-control/lib/SegmentedControlList.js +9 -34
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlItem.d.ts +28 -9
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlItem.d.ts.map +1 -1
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlItem.js +5 -7
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.d.ts +233 -83
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.d.ts.map +1 -1
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.js +31 -30
- package/dist/es6/select/lib/Select.js +144 -184
- package/dist/es6/select/lib/SelectBase.js +99 -94
- package/dist/es6/select/lib/SelectMenu.js +49 -80
- package/dist/es6/select/lib/SelectOption.js +30 -44
- package/dist/es6/select/lib/scrolling.js +6 -7
- package/dist/es6/select/lib/utils.js +4 -4
- package/dist/es6/side-panel/lib/SidePanel.d.ts +13 -26
- package/dist/es6/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/es6/side-panel/lib/SidePanel.js +93 -130
- package/dist/es6/side-panel/lib/SidePanelToggleButton.d.ts +17 -0
- package/dist/es6/side-panel/lib/SidePanelToggleButton.d.ts.map +1 -0
- package/dist/es6/side-panel/lib/SidePanelToggleButton.js +43 -0
- package/dist/es6/side-panel/lib/hooks.d.ts +20 -0
- package/dist/es6/side-panel/lib/hooks.d.ts.map +1 -1
- package/dist/es6/side-panel/lib/hooks.js +37 -18
- package/dist/es6/status-indicator/index.d.ts +2 -0
- package/dist/es6/status-indicator/index.d.ts.map +1 -1
- package/dist/es6/status-indicator/index.js +2 -0
- package/dist/es6/status-indicator/lib/StatusIndicator.d.ts +32 -8
- package/dist/es6/status-indicator/lib/StatusIndicator.d.ts.map +1 -1
- package/dist/es6/status-indicator/lib/StatusIndicator.js +33 -31
- package/dist/es6/status-indicator/lib/StatusIndicatorIcon.d.ts +10 -0
- package/dist/es6/status-indicator/lib/StatusIndicatorIcon.d.ts.map +1 -1
- package/dist/es6/status-indicator/lib/StatusIndicatorIcon.js +6 -18
- package/dist/es6/status-indicator/lib/StatusIndicatorLabel.js +3 -26
- package/dist/es6/status-indicator/lib/hooks/useStatusIndicatorModel.js +6 -15
- package/dist/es6/table/index.d.ts +2 -0
- package/dist/es6/table/index.d.ts.map +1 -0
- package/dist/es6/table/index.js +1 -0
- package/dist/es6/table/lib/Table.d.ts +207 -0
- package/dist/es6/table/lib/Table.d.ts.map +1 -0
- package/dist/es6/table/lib/Table.js +223 -0
- package/dist/es6/table/lib/TableBody.d.ts +2 -0
- package/dist/es6/table/lib/TableBody.d.ts.map +1 -0
- package/dist/es6/table/lib/TableBody.js +29 -0
- package/dist/es6/table/lib/TableCaption.d.ts +2 -0
- package/dist/es6/table/lib/TableCaption.d.ts.map +1 -0
- package/dist/es6/table/lib/TableCaption.js +10 -0
- package/dist/es6/table/lib/TableCell.d.ts +2 -0
- package/dist/es6/table/lib/TableCell.d.ts.map +1 -0
- package/dist/es6/table/lib/TableCell.js +10 -0
- package/dist/es6/table/lib/TableFooter.d.ts +2 -0
- package/dist/es6/table/lib/TableFooter.d.ts.map +1 -0
- package/dist/es6/table/lib/TableFooter.js +9 -0
- package/dist/es6/table/lib/TableHead.d.ts +2 -0
- package/dist/es6/table/lib/TableHead.d.ts.map +1 -0
- package/dist/es6/table/lib/TableHead.js +17 -0
- package/dist/es6/table/lib/TableHeader.d.ts +2 -0
- package/dist/es6/table/lib/TableHeader.d.ts.map +1 -0
- package/dist/es6/table/lib/TableHeader.js +10 -0
- package/dist/es6/table/lib/TableRow.d.ts +2 -0
- package/dist/es6/table/lib/TableRow.d.ts.map +1 -0
- package/dist/es6/table/lib/TableRow.js +13 -0
- package/dist/es6/text-area/lib/TextArea.d.ts +2 -2
- package/dist/es6/text-area/lib/TextArea.d.ts.map +1 -1
- package/dist/es6/text-area/lib/TextArea.js +7 -31
- package/dist/es6/text-area/lib/TextAreaField.d.ts +1 -1
- package/dist/es6/text-area/lib/TextAreaField.d.ts.map +1 -1
- package/dist/es6/text-area/lib/TextAreaField.js +9 -33
- package/dist/es6/text-input/lib/TextInput.d.ts +4 -4
- package/dist/es6/text-input/lib/TextInput.d.ts.map +1 -1
- package/dist/es6/text-input/lib/TextInput.js +7 -31
- package/dist/es6/text-input/lib/TextInputField.d.ts +1 -1
- package/dist/es6/text-input/lib/TextInputField.d.ts.map +1 -1
- package/dist/es6/text-input/lib/TextInputField.js +12 -24
- package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts +3 -5
- package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts.map +1 -1
- package/dist/es6/text-input/lib/hooks/useTextInputField.js +1 -1
- package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts +1 -0
- package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -1
- package/dist/es6/text-input/lib/hooks/useTextInputModel.js +2 -1
- package/form-field/lib/FormField.tsx +5 -10
- package/form-field/lib/FormFieldLabel.tsx +6 -11
- package/form-field/lib/hooks/useFormFieldModel.tsx +1 -3
- package/form-field/lib/hooks/useFormFieldOrientation.tsx +6 -6
- package/menu/lib/Menu.tsx +16 -9
- package/menu/lib/MenuItem.tsx +19 -8
- package/package.json +4 -5
- package/pill/lib/Pill.tsx +109 -10
- package/pill/lib/PillCount.tsx +1 -1
- package/pill/lib/PillIcon.tsx +1 -1
- package/segmented-control/index.ts +2 -0
- package/segmented-control/lib/SegmentedControl.tsx +36 -0
- package/segmented-control/lib/SegmentedControlList.tsx +1 -1
- package/segmented-control/lib/hooks/useSegmentedControlItem.tsx +1 -5
- package/side-panel/lib/SidePanel.tsx +119 -169
- package/side-panel/lib/SidePanelToggleButton.tsx +78 -0
- package/side-panel/lib/hooks.ts +20 -0
- package/status-indicator/index.ts +2 -0
- package/status-indicator/lib/StatusIndicator.tsx +32 -6
- package/status-indicator/lib/StatusIndicatorIcon.tsx +1 -1
- package/table/LICENSE +51 -0
- package/table/README.md +5 -0
- package/table/index.ts +1 -0
- package/table/lib/Table.tsx +236 -0
- package/table/lib/TableBody.tsx +35 -0
- package/table/lib/TableCaption.tsx +22 -0
- package/table/lib/TableCell.tsx +27 -0
- package/table/lib/TableFooter.tsx +14 -0
- package/table/lib/TableHead.tsx +23 -0
- package/table/lib/TableHeader.tsx +28 -0
- package/table/lib/TableRow.tsx +26 -0
- package/table/package.json +6 -0
- package/text-area/lib/TextArea.tsx +9 -6
- package/text-area/lib/TextAreaField.tsx +6 -2
- package/text-input/lib/TextInput.tsx +9 -6
- package/text-input/lib/TextInputField.tsx +9 -5
- package/text-input/lib/hooks/useTextInputModel.ts +1 -0
- package/dist/commonjs/text-area/lib/hooks/index.d.ts +0 -2
- package/dist/commonjs/text-area/lib/hooks/index.d.ts.map +0 -1
- package/dist/commonjs/text-area/lib/hooks/useTextAreaModel.d.ts +0 -28
- package/dist/commonjs/text-area/lib/hooks/useTextAreaModel.d.ts.map +0 -1
- package/dist/commonjs/text-area/lib/hooks/useTextAreaModel.js +0 -5
- package/dist/es6/text-area/lib/hooks/index.d.ts +0 -2
- package/dist/es6/text-area/lib/hooks/index.d.ts.map +0 -1
- package/dist/es6/text-area/lib/hooks/index.js +0 -1
- package/dist/es6/text-area/lib/hooks/useTextAreaModel.d.ts +0 -28
- package/dist/es6/text-area/lib/hooks/useTextAreaModel.d.ts.map +0 -1
- package/dist/es6/text-area/lib/hooks/useTextAreaModel.js +0 -2
- package/text-area/lib/hooks/index.ts +0 -1
- package/text-area/lib/hooks/useTextAreaModel.ts +0 -3
|
@@ -1,29 +1,7 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
1
|
import React from 'react';
|
|
24
2
|
import { BaseButton } from '@workday/canvas-kit-react/button';
|
|
25
3
|
import { createContainer, focusRing, mouseFocusBehavior, styled, } from '@workday/canvas-kit-react/common';
|
|
26
|
-
import { boxStyleFn,
|
|
4
|
+
import { boxStyleFn, Flex } from '@workday/canvas-kit-react/layout';
|
|
27
5
|
import { borderRadius, colors, space, type } from '@workday/canvas-kit-react/tokens';
|
|
28
6
|
import { usePillModel } from './usePillModel';
|
|
29
7
|
import { PillIcon } from './PillIcon';
|
|
@@ -31,7 +9,7 @@ import { PillIconButton } from './PillIconButton';
|
|
|
31
9
|
import { PillCount } from './PillCount';
|
|
32
10
|
import { PillAvatar } from './PillAvatar';
|
|
33
11
|
import { PillLabel } from './PillLabel';
|
|
34
|
-
|
|
12
|
+
const getButtonPillColors = () => {
|
|
35
13
|
return {
|
|
36
14
|
default: {
|
|
37
15
|
background: colors.soap300,
|
|
@@ -70,7 +48,7 @@ var getButtonPillColors = function () {
|
|
|
70
48
|
},
|
|
71
49
|
};
|
|
72
50
|
};
|
|
73
|
-
|
|
51
|
+
const getRemovablePillColors = (disabled) => {
|
|
74
52
|
return {
|
|
75
53
|
default: {
|
|
76
54
|
background: disabled ? colors.soap100 : colors.soap300,
|
|
@@ -103,63 +81,179 @@ var getRemovablePillColors = function (disabled) {
|
|
|
103
81
|
disabled: {},
|
|
104
82
|
};
|
|
105
83
|
};
|
|
106
|
-
|
|
107
|
-
|
|
84
|
+
const pillBaseStyles = {
|
|
85
|
+
display: 'inline-flex',
|
|
86
|
+
alignItems: 'center',
|
|
87
|
+
borderRadius: borderRadius.m,
|
|
88
|
+
flexShrink: 0,
|
|
89
|
+
...type.levels.subtext.large,
|
|
90
|
+
color: colors.blackPepper400,
|
|
91
|
+
boxShadow: 'none',
|
|
92
|
+
outline: 'none',
|
|
93
|
+
fontWeight: type.properties.fontWeights.medium,
|
|
94
|
+
WebkitFontSmoothing: 'antialiased',
|
|
95
|
+
MozOsxFontSmoothing: 'grayscale',
|
|
96
|
+
width: 'fit-content',
|
|
97
|
+
padding: `2px ${space.xxs}`,
|
|
98
|
+
height: space.m,
|
|
99
|
+
position: 'relative',
|
|
100
|
+
};
|
|
101
|
+
const StyledBasePill = styled(BaseButton.as('button'))({
|
|
102
|
+
...pillBaseStyles,
|
|
103
|
+
'&:focus': {
|
|
108
104
|
'span[data-count="ck-pill-count"]': {
|
|
109
|
-
borderTop:
|
|
110
|
-
borderBottom:
|
|
111
|
-
borderRight:
|
|
105
|
+
borderTop: `1px solid ${colors.blueberry400}`,
|
|
106
|
+
borderBottom: `1px solid ${colors.blueberry400}`,
|
|
107
|
+
borderRight: `1px solid ${colors.blueberry400}`,
|
|
112
108
|
},
|
|
113
|
-
},
|
|
109
|
+
},
|
|
110
|
+
'&:active, &:active:hover, &:active:focus': {
|
|
114
111
|
'span[data-count="ck-pill-count"]': {
|
|
115
112
|
backgroundColor: colors.soap600,
|
|
116
113
|
border: 'none',
|
|
117
114
|
},
|
|
118
|
-
} }), mouseFocusBehavior({
|
|
119
|
-
'&:focus': {
|
|
120
|
-
'span[data-count="ck-pill-count"]': {
|
|
121
|
-
border: 'none',
|
|
122
|
-
},
|
|
123
115
|
},
|
|
124
|
-
|
|
125
|
-
var variant = _a.variant;
|
|
126
|
-
return ({
|
|
116
|
+
...mouseFocusBehavior({
|
|
127
117
|
'&:focus': {
|
|
128
|
-
|
|
118
|
+
'span[data-count="ck-pill-count"]': {
|
|
119
|
+
border: 'none',
|
|
120
|
+
},
|
|
129
121
|
},
|
|
130
|
-
})
|
|
131
|
-
},
|
|
132
|
-
|
|
122
|
+
}),
|
|
123
|
+
}, ({ variant }) => ({
|
|
124
|
+
'&:focus': {
|
|
125
|
+
borderColor: variant === 'removable' ? undefined : colors.blueberry400,
|
|
126
|
+
},
|
|
127
|
+
}), boxStyleFn);
|
|
128
|
+
const StyledNonInteractivePill = styled(StyledBasePill)({
|
|
133
129
|
cursor: 'default',
|
|
134
130
|
overflow: 'revert',
|
|
135
131
|
position: 'relative',
|
|
136
132
|
});
|
|
137
|
-
|
|
133
|
+
/**
|
|
134
|
+
* By default, a `Pill` renders an interactive element that accepts subcomponents. By "interactive"
|
|
135
|
+
* we mean that the Pill container is a focusable element (a `<button>`). All leading elements
|
|
136
|
+
* (icons or avatars) are intended to be descriptive, helping support the label. They should not
|
|
137
|
+
* receive focus.
|
|
138
|
+
*
|
|
139
|
+
* `Pill` is the container component. It also provides a React context model for its subcomponents.
|
|
140
|
+
* Based on the `variant` prop this component will render different styled `Pill`s.
|
|
141
|
+
*
|
|
142
|
+
* Example of read only:
|
|
143
|
+
*
|
|
144
|
+
* ```tsx
|
|
145
|
+
* <Pill variant="readOnly">This is a read only</Pill>
|
|
146
|
+
* ```
|
|
147
|
+
*
|
|
148
|
+
* Example of interactive:
|
|
149
|
+
*
|
|
150
|
+
* ```tsx
|
|
151
|
+
* <Pill onClick={() => console.log('clicked')}>
|
|
152
|
+
* <Pill.Avatar /> Regina Skeltor
|
|
153
|
+
* </Pill>
|
|
154
|
+
* ```
|
|
155
|
+
*
|
|
156
|
+
* Example of removable:
|
|
157
|
+
*
|
|
158
|
+
* ```tsx
|
|
159
|
+
* <Pill variant="removable">
|
|
160
|
+
* <Pill.Avatar /> Regina Skeltor
|
|
161
|
+
* <Pill.IconButton onClick={() => console.log('clicked')} />
|
|
162
|
+
* </Pill>
|
|
163
|
+
* ```
|
|
164
|
+
*
|
|
165
|
+
* If you set the `Pill` `variant` to `removable`, it will render a `<span>` element. You can then
|
|
166
|
+
* provide a `Pill.IconButton` that acts as the focus target. This creates a smaller, more
|
|
167
|
+
* intentional click target that prevents users from accidentally deleting an item.
|
|
168
|
+
*
|
|
169
|
+
* ```tsx
|
|
170
|
+
* <Pill variant="removable">
|
|
171
|
+
* Shoes
|
|
172
|
+
* <Pill.IconButton onClick={() => console.log('handle remove')} />
|
|
173
|
+
* </Pill>
|
|
174
|
+
* ```
|
|
175
|
+
*/
|
|
176
|
+
export const Pill = createContainer('button')({
|
|
177
|
+
displayName: 'Pill',
|
|
138
178
|
modelHook: usePillModel,
|
|
139
179
|
subComponents: {
|
|
140
|
-
|
|
180
|
+
/**
|
|
181
|
+
* This component renders an avatar. It supports all props of the `Avatar` component.
|
|
182
|
+
*
|
|
183
|
+
* ```tsx
|
|
184
|
+
* <Pill variant="removable">
|
|
185
|
+
* <Pill.Avatar url={avatarUrl} />
|
|
186
|
+
* Regina Skeltor
|
|
187
|
+
* <Pill.IconButton onClick={() => console.log('handle remove')} />
|
|
188
|
+
* </Pill>
|
|
189
|
+
* ```
|
|
190
|
+
*/
|
|
141
191
|
Avatar: PillAvatar,
|
|
192
|
+
/**
|
|
193
|
+
* This component renders its `children` as the count.
|
|
194
|
+
*
|
|
195
|
+
* ```tsx
|
|
196
|
+
* <Pill onClick={() => console.warn('clicked')}>
|
|
197
|
+
* Shoes
|
|
198
|
+
* <Pill.Count>30</Pill.Count>
|
|
199
|
+
* </Pill>
|
|
200
|
+
* ```
|
|
201
|
+
*/
|
|
142
202
|
Count: PillCount,
|
|
143
|
-
|
|
203
|
+
/**
|
|
204
|
+
* This component renders an `icon`. It not be used with the `default` styling – not `readOnly`
|
|
205
|
+
* or `removable` variants. By default it renders a `plusIcon` but it can be overridden by
|
|
206
|
+
* providing an icon to the `icon` prop.
|
|
207
|
+
*
|
|
208
|
+
* ```tsx
|
|
209
|
+
* <Pill onClick={() => console.warn('clicked')}>
|
|
210
|
+
* <Pill.Icon />
|
|
211
|
+
* <Pill.Label>Regina Skeltor</Pill.Label>
|
|
212
|
+
* </Pill>
|
|
213
|
+
* ```
|
|
214
|
+
*/
|
|
215
|
+
Icon: PillIcon,
|
|
216
|
+
/**
|
|
217
|
+
* This component renders a custom icon button. It is only intended to be used with the
|
|
218
|
+
* `removable` variant. By default, it renders a `xSmallIcon` but can be overridden by providing
|
|
219
|
+
* an icon to the `icon` prop.
|
|
220
|
+
*
|
|
221
|
+
* ```tsx
|
|
222
|
+
* <Pill variant="removable">
|
|
223
|
+
* Pink Shirts
|
|
224
|
+
* <Pill.IconButton onClick={() => console.warn('clicked')} />
|
|
225
|
+
* </Pill>
|
|
226
|
+
* ```
|
|
227
|
+
*/
|
|
144
228
|
IconButton: PillIconButton,
|
|
229
|
+
/**
|
|
230
|
+
* This component renders a `<span>` that automatically handles overflow by rendering a tooltip.
|
|
231
|
+
* There's no need to use this component directly since the overflow is handled for you automatically.
|
|
232
|
+
*
|
|
233
|
+
* ```tsx
|
|
234
|
+
* <Pill variant="readOnly">
|
|
235
|
+
* <Pill.Label>Read-only</Pill.Label>
|
|
236
|
+
* </Pill>
|
|
237
|
+
* ```
|
|
238
|
+
*/
|
|
239
|
+
Label: PillLabel,
|
|
145
240
|
},
|
|
146
|
-
})(
|
|
147
|
-
var _b = _a.variant, variant = _b === void 0 ? 'default' : _b, maxWidth = _a.maxWidth, elemProps = __rest(_a, ["variant", "maxWidth"]);
|
|
241
|
+
})(({ variant = 'default', maxWidth, ...elemProps }, Element, model) => {
|
|
148
242
|
return (React.createElement(React.Fragment, null,
|
|
149
|
-
variant === 'readOnly' && (React.createElement(StyledNonInteractivePill,
|
|
243
|
+
variant === 'readOnly' && (React.createElement(StyledNonInteractivePill, Object.assign({ maxWidth: model.state.maxWidth, as: Element !== 'button' ? Element : 'span', border: `1px solid ${colors.licorice200}`, id: model.state.id }, elemProps),
|
|
150
244
|
React.createElement(PillLabel, null, elemProps.children))),
|
|
151
|
-
variant === 'default' && (React.createElement(StyledBasePill,
|
|
152
|
-
React.createElement(
|
|
245
|
+
variant === 'default' && (React.createElement(StyledBasePill, Object.assign({ colors: getButtonPillColors(), as: Element }, elemProps, { disabled: model.state.disabled }),
|
|
246
|
+
React.createElement(Flex, { gap: "xxxs", display: "inline-flex", alignItems: "center" }, React.Children.map(elemProps.children, (child, index) => {
|
|
153
247
|
if (typeof child === 'string') {
|
|
154
248
|
return React.createElement(PillLabel, { key: index }, child);
|
|
155
249
|
}
|
|
156
|
-
return (React.createElement(
|
|
250
|
+
return (React.createElement(Flex.Item, { key: index, display: "inline-flex" }, child));
|
|
157
251
|
})))),
|
|
158
|
-
variant === 'removable' && (React.createElement(StyledNonInteractivePill,
|
|
159
|
-
React.createElement(
|
|
252
|
+
variant === 'removable' && (React.createElement(StyledNonInteractivePill, Object.assign({ colors: getRemovablePillColors(model.state.disabled), as: Element !== 'button' ? Element : 'span', variant: variant }, elemProps),
|
|
253
|
+
React.createElement(Flex, { gap: "xxxs", display: "inline-flex", alignItems: "center", justifyContent: "center" }, React.Children.map(elemProps.children, (child, index) => {
|
|
160
254
|
if (typeof child === 'string') {
|
|
161
255
|
return React.createElement(PillLabel, { key: index }, child);
|
|
162
256
|
}
|
|
163
|
-
return React.createElement(
|
|
257
|
+
return React.createElement(Flex.Item, { key: index }, child);
|
|
164
258
|
}))))));
|
|
165
259
|
});
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
import React from 'react';
|
|
13
2
|
import { createSubcomponent } from '@workday/canvas-kit-react/common';
|
|
14
3
|
import { Avatar } from '@workday/canvas-kit-react/avatar';
|
|
@@ -16,8 +5,8 @@ import { usePillModel } from './usePillModel';
|
|
|
16
5
|
// When the component is created, it needs to be a button element to match AvatarProps.
|
|
17
6
|
// Once Avatar becomes a `createComponent` we can default the element type to a `div`
|
|
18
7
|
// and the types should be properly extracted
|
|
19
|
-
export
|
|
8
|
+
export const PillAvatar = createSubcomponent('button')({
|
|
20
9
|
modelHook: usePillModel,
|
|
21
|
-
})(
|
|
22
|
-
return (React.createElement(Avatar,
|
|
10
|
+
})((elemProps, Element, model) => {
|
|
11
|
+
return (React.createElement(Avatar, Object.assign({ style: { opacity: model.state.disabled ? '.7' : '1' }, as: "div", size: 18, altText: undefined }, elemProps, { disabled: model.state.disabled }), elemProps.children));
|
|
23
12
|
});
|
|
@@ -1,39 +1,16 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
1
|
import React from 'react';
|
|
24
2
|
import { createComponent, styled } from '@workday/canvas-kit-react/common';
|
|
25
3
|
import { Flex } from '@workday/canvas-kit-react/layout';
|
|
26
4
|
import { borderRadius, colors, space } from '@workday/canvas-kit-react/tokens';
|
|
27
|
-
|
|
5
|
+
const StyledCountContainer = styled(Flex.as('span'))({
|
|
28
6
|
borderTopLeftRadius: borderRadius.zero,
|
|
29
7
|
borderTopRightRadius: borderRadius.m,
|
|
30
8
|
borderBottomLeftRadius: borderRadius.zero,
|
|
31
9
|
borderBottomRightRadius: borderRadius.m,
|
|
32
10
|
});
|
|
33
|
-
export
|
|
11
|
+
export const PillCount = createComponent('span')({
|
|
34
12
|
displayName: 'Pill.Avatar',
|
|
35
|
-
Component:
|
|
36
|
-
|
|
37
|
-
return (React.createElement(StyledCountContainer, __assign({ display: "inline-flex", alignItems: "center", justifyContent: "center", as: Element, height: 22, minWidth: 22, padding: "0 " + space.xxxs, marginInlineEnd: "-" + space.xxs, marginInlineStart: "" + space.xxxs, backgroundColor: colors.soap500, "data-count": "ck-pill-count", ref: ref }, elemProps), children));
|
|
13
|
+
Component: ({ children, ...elemProps }, ref, Element) => {
|
|
14
|
+
return (React.createElement(StyledCountContainer, Object.assign({ display: "inline-flex", alignItems: "center", justifyContent: "center", as: Element, height: 22, minWidth: 22, padding: `0 ${space.xxxs}`, marginInlineEnd: `-${space.xxs}`, marginInlineStart: `${space.xxxs}`, backgroundColor: colors.soap500, "data-count": "ck-pill-count", ref: ref }, elemProps), children));
|
|
38
15
|
},
|
|
39
16
|
});
|
|
@@ -1,34 +1,11 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
1
|
import React from 'react';
|
|
24
2
|
import { createSubcomponent } from '@workday/canvas-kit-react/common';
|
|
25
3
|
import { SystemIcon } from '@workday/canvas-kit-react/icon';
|
|
26
4
|
import { usePillModel } from './usePillModel';
|
|
27
5
|
import { plusIcon } from '@workday/canvas-system-icons-web';
|
|
28
6
|
import { space } from '@workday/canvas-kit-react/tokens';
|
|
29
|
-
export
|
|
7
|
+
export const PillIcon = createSubcomponent('span')({
|
|
30
8
|
modelHook: usePillModel,
|
|
31
|
-
})(
|
|
32
|
-
|
|
33
|
-
return (React.createElement(SystemIcon, __assign({ marginInlineStart: "-" + space.xxxs, display: "flex", as: Element, size: 20, role: "img", "aria-label": "add", icon: icon || plusIcon }, elemProps)));
|
|
9
|
+
})(({ size, icon, ...elemProps }, Element) => {
|
|
10
|
+
return (React.createElement(SystemIcon, Object.assign({ marginInlineStart: `-${space.xxxs}`, display: "flex", as: Element, size: 20, role: "img", "aria-label": "add", icon: icon || plusIcon }, elemProps)));
|
|
34
11
|
});
|
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
1
|
import React from 'react';
|
|
24
2
|
import { focusRing, styled, createSubcomponent } from '@workday/canvas-kit-react/common';
|
|
25
3
|
import { SystemIcon } from '@workday/canvas-kit-react/icon';
|
|
@@ -27,7 +5,7 @@ import { usePillModel } from './usePillModel';
|
|
|
27
5
|
import { xSmallIcon } from '@workday/canvas-system-icons-web';
|
|
28
6
|
import { colors, space } from '@workday/canvas-kit-react/tokens';
|
|
29
7
|
import { BaseButton } from '@workday/canvas-kit-react/button';
|
|
30
|
-
|
|
8
|
+
const getIconColors = () => {
|
|
31
9
|
return {
|
|
32
10
|
default: {
|
|
33
11
|
icon: colors.licorice200,
|
|
@@ -50,9 +28,9 @@ var getIconColors = function () {
|
|
|
50
28
|
},
|
|
51
29
|
};
|
|
52
30
|
};
|
|
53
|
-
|
|
31
|
+
const StyledIconButton = styled(BaseButton)({
|
|
54
32
|
marginInlineEnd: '-7px',
|
|
55
|
-
marginInlineStart:
|
|
33
|
+
marginInlineStart: `-2px`,
|
|
56
34
|
overflow: 'visible',
|
|
57
35
|
'::after': {
|
|
58
36
|
content: '""',
|
|
@@ -66,10 +44,9 @@ var StyledIconButton = styled(BaseButton)({
|
|
|
66
44
|
cursor: 'pointer',
|
|
67
45
|
},
|
|
68
46
|
});
|
|
69
|
-
export
|
|
47
|
+
export const PillIconButton = createSubcomponent('button')({
|
|
70
48
|
modelHook: usePillModel,
|
|
71
|
-
})(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
React.createElement(SystemIcon, { "aria-label": ariaLabel, id: "removable-" + model.state.id, icon: icon, size: space.m, "aria-hidden": true, role: "img" })));
|
|
49
|
+
})(({ size, icon = xSmallIcon, maxWidth, children, 'aria-label': ariaLabel = 'remove', ...elemProps }, Element, model) => {
|
|
50
|
+
return (React.createElement(StyledIconButton, Object.assign({ borderRadius: "s", height: 20, width: 20, padding: "zero", disabled: model.state.disabled, colors: getIconColors(), "aria-labelledby": `removable-${model.state.id} label-${model.state.id}`, as: Element, position: "relative" }, elemProps),
|
|
51
|
+
React.createElement(SystemIcon, { "aria-label": ariaLabel, id: `removable-${model.state.id}`, icon: icon, size: space.m, "aria-hidden": true, role: "img" })));
|
|
75
52
|
});
|
|
@@ -1,41 +1,18 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
1
|
import React from 'react';
|
|
24
2
|
import { createSubcomponent, styled } from '@workday/canvas-kit-react/common';
|
|
25
3
|
import { Box } from '@workday/canvas-kit-react/layout';
|
|
26
4
|
import { OverflowTooltip } from '@workday/canvas-kit-react/tooltip';
|
|
27
5
|
import { usePillModel } from './usePillModel';
|
|
28
6
|
import { colors } from '@workday/canvas-kit-react/tokens';
|
|
29
|
-
|
|
7
|
+
const StyledLabelContainer = styled(Box.as('span'))({
|
|
30
8
|
whiteSpace: 'nowrap',
|
|
31
9
|
overflow: 'hidden',
|
|
32
10
|
textOverflow: 'ellipsis',
|
|
33
11
|
display: 'block',
|
|
34
12
|
});
|
|
35
|
-
export
|
|
13
|
+
export const PillLabel = createSubcomponent('span')({
|
|
36
14
|
modelHook: usePillModel,
|
|
37
|
-
})(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
React.createElement(StyledLabelContainer, __assign({ color: model.state.disabled ? colors.licorice100 : 'inherit', maxWidth: model.state.maxWidth, as: Element, id: "label-" + model.state.id }, elemProps), elemProps.children)));
|
|
15
|
+
})(({ tooltipProps, ...elemProps }, Element, model) => {
|
|
16
|
+
return (React.createElement(OverflowTooltip, Object.assign({}, tooltipProps),
|
|
17
|
+
React.createElement(StyledLabelContainer, Object.assign({ color: model.state.disabled ? colors.licorice100 : 'inherit', maxWidth: model.state.maxWidth, as: Element, id: `label-${model.state.id}` }, elemProps), elemProps.children)));
|
|
41
18
|
});
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
import { createModelHook, useUniqueId } from '@workday/canvas-kit-react/common';
|
|
13
|
-
export
|
|
2
|
+
export const usePillModel = createModelHook({
|
|
14
3
|
defaultConfig: {
|
|
15
4
|
/**
|
|
16
5
|
* Determines the max width of the pill. If the pill text is longer than the max width,
|
|
@@ -27,8 +16,11 @@ export var usePillModel = createModelHook({
|
|
|
27
16
|
*/
|
|
28
17
|
id: '',
|
|
29
18
|
},
|
|
30
|
-
})(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
19
|
+
})(config => {
|
|
20
|
+
const id = useUniqueId(config.id);
|
|
21
|
+
const state = {
|
|
22
|
+
...config,
|
|
23
|
+
id,
|
|
24
|
+
};
|
|
25
|
+
return { state, events: {} };
|
|
34
26
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../segmented-control/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,sCAAsC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../segmented-control/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,sCAAsC,CAAC;AACrD,cAAc,qCAAqC,CAAC;AACpD,OAAO,EAAC,uBAAuB,EAAC,MAAM,4BAA4B,CAAC"}
|