@workday/canvas-kit-preview-react 8.0.0-alpha.253-next.22 → 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,35 +1,27 @@
|
|
|
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 * as React from 'react';
|
|
13
2
|
import styled from '@emotion/styled';
|
|
14
3
|
import { borderRadius, colors, space } from '@workday/canvas-kit-react/tokens';
|
|
15
4
|
import { focusRing, mouseFocusBehavior } from '@workday/canvas-kit-react/common';
|
|
16
5
|
import { ColorSwatch } from '@workday/canvas-kit-react/color-picker';
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
const accessibilityBorder = `${colors.frenchVanilla100} 0px 0px 0px 2px, ${colors.licorice200} 0px 0px 0px 3px`;
|
|
7
|
+
const SwatchContainer = styled('div')({
|
|
19
8
|
display: 'flex',
|
|
20
9
|
width: 20,
|
|
21
10
|
height: 20,
|
|
22
11
|
cursor: 'pointer',
|
|
23
12
|
borderRadius: borderRadius.s,
|
|
24
13
|
transition: 'box-shadow 120ms ease',
|
|
25
|
-
margin:
|
|
14
|
+
margin: `0px ${space.xxs} ${space.xxs} 0px`,
|
|
26
15
|
'&:hover': {
|
|
27
16
|
boxShadow: accessibilityBorder,
|
|
28
17
|
},
|
|
29
|
-
'&:focus':
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
'&:focus': {
|
|
19
|
+
outline: 'none',
|
|
20
|
+
...focusRing({ separation: 2 }),
|
|
21
|
+
},
|
|
22
|
+
}, ({ isSelected }) => ({
|
|
23
|
+
boxShadow: isSelected ? accessibilityBorder : undefined,
|
|
24
|
+
...mouseFocusBehavior({
|
|
33
25
|
'&:focus': {
|
|
34
26
|
animation: 'none',
|
|
35
27
|
boxShadow: 'none',
|
|
@@ -40,22 +32,17 @@ var SwatchContainer = styled('div')({
|
|
|
40
32
|
'&': {
|
|
41
33
|
boxShadow: isSelected ? accessibilityBorder : undefined,
|
|
42
34
|
},
|
|
43
|
-
})
|
|
44
|
-
});
|
|
45
|
-
|
|
35
|
+
}),
|
|
36
|
+
}));
|
|
37
|
+
const Container = styled('div')({
|
|
46
38
|
display: 'flex',
|
|
47
39
|
flexWrap: 'wrap',
|
|
48
|
-
margin:
|
|
40
|
+
margin: `0px -${space.xxs} -${space.xxs} 0px`,
|
|
49
41
|
});
|
|
50
|
-
export
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
};
|
|
58
|
-
return (React.createElement(SwatchContainer, { key: index + '-' + color, onClick: handleClick, onKeyDown: handleKeyDown, tabIndex: 0, isSelected: isSelected },
|
|
59
|
-
React.createElement(ColorSwatch, { color: color, showCheck: isSelected })));
|
|
60
|
-
})));
|
|
61
|
-
};
|
|
42
|
+
export const SwatchBook = ({ colors, value, onSelect }) => (React.createElement(Container, null, colors.map((color, index) => {
|
|
43
|
+
const isSelected = value ? color.toLowerCase() === value.toLowerCase() : false;
|
|
44
|
+
const handleClick = () => onSelect(color);
|
|
45
|
+
const handleKeyDown = (event) => (event.key === 'Enter' || event.key === ' ') && onSelect(color);
|
|
46
|
+
return (React.createElement(SwatchContainer, { key: index + '-' + color, onClick: handleClick, onKeyDown: handleKeyDown, tabIndex: 0, isSelected: isSelected },
|
|
47
|
+
React.createElement(ColorSwatch, { color: color, showCheck: isSelected })));
|
|
48
|
+
})));
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export interface FormFieldProps extends Omit<ExtractProps<typeof Stack, never>, 'spacing'> {
|
|
2
|
+
import { FlexProps } from '@workday/canvas-kit-react/layout';
|
|
3
|
+
export interface FormFieldProps extends FlexProps {
|
|
5
4
|
/**
|
|
6
5
|
* Children of the Text Input. Should contain a `<FormField.Input>`, a `<FormField.Label>` and an optional `<FormField.Hint>`
|
|
7
6
|
*/
|
|
@@ -10,11 +9,6 @@ export interface FormFieldProps extends Omit<ExtractProps<typeof Stack, never>,
|
|
|
10
9
|
* The direction the child elements should stack
|
|
11
10
|
*/
|
|
12
11
|
orientation: 'vertical' | 'horizontal';
|
|
13
|
-
/**
|
|
14
|
-
* Spacing between children elements
|
|
15
|
-
* @default xxxs when vertical l when orientation is horizontal
|
|
16
|
-
*/
|
|
17
|
-
spacing?: StackSpacing;
|
|
18
12
|
}
|
|
19
13
|
export declare const FormField: import("@workday/canvas-kit-react/common").ElementComponentM<"div", FormFieldProps & Partial<{
|
|
20
14
|
hasError: boolean;
|
|
@@ -28,7 +22,7 @@ export declare const FormField: import("@workday/canvas-kit-react/common").Eleme
|
|
|
28
22
|
};
|
|
29
23
|
events: {};
|
|
30
24
|
}> & {
|
|
31
|
-
Input: import("@workday/canvas-kit-react/common").ElementComponentM<"input", import("@workday/canvas-kit-react/layout").
|
|
25
|
+
Input: import("@workday/canvas-kit-react/common").ElementComponentM<"input", import("@workday/canvas-kit-react/layout").BackgroundStyleProps & import("@workday/canvas-kit-react/layout/lib/utils/border/color").BorderColorStyleProps & import("@workday/canvas-kit-react/layout/lib/utils/border/lineStyle").BorderLineStyleProps & import("@workday/canvas-kit-react/layout/lib/utils/border/radius").BorderRadiusStyleProps & import("@workday/canvas-kit-react/layout/lib/utils/border/shorthand").BorderShorthandStyleProps & import("@workday/canvas-kit-react/layout/lib/utils/border/width").BorderWidthStyleProps & import("@workday/canvas-kit-react/layout").ColorStyleProps & import("@workday/canvas-kit-react/layout").DepthStyleProps & import("@workday/canvas-kit-react/layout").FlexItemStyleProps & import("@workday/canvas-kit-react/layout").GridItemStyleProps & import("@workday/canvas-kit-react/layout").LayoutStyleProps & import("@workday/canvas-kit-react/layout").OtherStyleProps & import("@workday/canvas-kit-react/layout").PositionStyleProps & import("@workday/canvas-kit-react/layout").SpaceStyleProps & import("@workday/canvas-kit-react/layout").TextStyleProps, {
|
|
32
26
|
state: {
|
|
33
27
|
id: string;
|
|
34
28
|
hasError: boolean;
|
|
@@ -44,7 +38,7 @@ export declare const FormField: import("@workday/canvas-kit-react/common").Eleme
|
|
|
44
38
|
};
|
|
45
39
|
events: {};
|
|
46
40
|
}>;
|
|
47
|
-
Hint: import("@workday/canvas-kit-react/common").ElementComponentM<"p",
|
|
41
|
+
Hint: import("@workday/canvas-kit-react/common").ElementComponentM<"p", Omit<import("@workday/canvas-kit-react/text").TypeLevelProps, "size">, {
|
|
48
42
|
state: {
|
|
49
43
|
id: string;
|
|
50
44
|
hasError: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormField.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FormField.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAO,SAAS,EAAC,MAAM,kCAAkC,CAAC;AAOjE,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC/C;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,WAAW,EAAE,UAAU,GAAG,YAAY,CAAC;CACxC;AAED,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBpB,CAAC"}
|
|
@@ -1,33 +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 { createContainer } from '@workday/canvas-kit-react/common';
|
|
25
|
-
import {
|
|
3
|
+
import { Flex } from '@workday/canvas-kit-react/layout';
|
|
26
4
|
import { useFormFieldModel, useFormFieldOrientation } from './hooks';
|
|
27
5
|
import { FormFieldInput } from './FormFieldInput';
|
|
28
6
|
import { FormFieldLabel } from './FormFieldLabel';
|
|
29
7
|
import { FormFieldHint } from './FormFieldHint';
|
|
30
|
-
export
|
|
8
|
+
export const FormField = createContainer('div')({
|
|
31
9
|
displayName: 'FormField',
|
|
32
10
|
modelHook: useFormFieldModel,
|
|
33
11
|
subComponents: {
|
|
@@ -35,8 +13,7 @@ export var FormField = createContainer('div')({
|
|
|
35
13
|
Label: FormFieldLabel,
|
|
36
14
|
Hint: FormFieldHint,
|
|
37
15
|
},
|
|
38
|
-
})(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return (React.createElement(Stack, __assign({ as: Element }, layoutProps, elemProps), children));
|
|
16
|
+
})(({ children, orientation, ...elemProps }, Element) => {
|
|
17
|
+
const layoutProps = useFormFieldOrientation(orientation);
|
|
18
|
+
return (React.createElement(Flex, Object.assign({ as: Element }, layoutProps, elemProps), children));
|
|
42
19
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const FormFieldHint: import("@workday/canvas-kit-react/common").ElementComponentM<"p",
|
|
1
|
+
export declare const FormFieldHint: import("@workday/canvas-kit-react/common").ElementComponentM<"p", Omit<import("@workday/canvas-kit-react/text").TypeLevelProps, "size">, {
|
|
2
2
|
state: {
|
|
3
3
|
id: string;
|
|
4
4
|
hasError: boolean;
|
|
@@ -1,40 +1,17 @@
|
|
|
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, useTheme } from '@workday/canvas-kit-react/common';
|
|
25
3
|
import { space } from '@workday/canvas-kit-react/tokens';
|
|
26
4
|
import { useFormFieldHint, useFormFieldModel } from './hooks';
|
|
27
5
|
import { Subtext } from '@workday/canvas-kit-react/text';
|
|
28
|
-
export
|
|
6
|
+
export const FormFieldHint = createSubcomponent('p')({
|
|
29
7
|
displayName: 'FormField.Hint',
|
|
30
8
|
modelHook: useFormFieldModel,
|
|
31
9
|
elemPropsHook: useFormFieldHint,
|
|
32
|
-
})(
|
|
33
|
-
|
|
34
|
-
var theme = useTheme();
|
|
10
|
+
})(({ children, ...elemProps }, Element, model) => {
|
|
11
|
+
const theme = useTheme();
|
|
35
12
|
if (!children) {
|
|
36
13
|
// If there is no hint text just skip rendering
|
|
37
14
|
return null;
|
|
38
15
|
}
|
|
39
|
-
return (React.createElement(Subtext,
|
|
16
|
+
return (React.createElement(Subtext, Object.assign({ as: Element, size: "medium", color: model.state.hasError ? theme.canvas.palette.error.main : undefined, marginY: space.xxs }, elemProps), children));
|
|
40
17
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const FormFieldInput: import("@workday/canvas-kit-react/common").ElementComponentM<"input", import("@workday/canvas-kit-react/layout").
|
|
1
|
+
export declare const FormFieldInput: import("@workday/canvas-kit-react/common").ElementComponentM<"input", import("@workday/canvas-kit-react/layout").BackgroundStyleProps & import("@workday/canvas-kit-react/layout/lib/utils/border/color").BorderColorStyleProps & import("@workday/canvas-kit-react/layout/lib/utils/border/lineStyle").BorderLineStyleProps & import("@workday/canvas-kit-react/layout/lib/utils/border/radius").BorderRadiusStyleProps & import("@workday/canvas-kit-react/layout/lib/utils/border/shorthand").BorderShorthandStyleProps & import("@workday/canvas-kit-react/layout/lib/utils/border/width").BorderWidthStyleProps & import("@workday/canvas-kit-react/layout").ColorStyleProps & import("@workday/canvas-kit-react/layout").DepthStyleProps & import("@workday/canvas-kit-react/layout").FlexItemStyleProps & import("@workday/canvas-kit-react/layout").GridItemStyleProps & import("@workday/canvas-kit-react/layout").LayoutStyleProps & import("@workday/canvas-kit-react/layout").OtherStyleProps & import("@workday/canvas-kit-react/layout").PositionStyleProps & import("@workday/canvas-kit-react/layout").SpaceStyleProps & import("@workday/canvas-kit-react/layout").TextStyleProps, {
|
|
2
2
|
state: {
|
|
3
3
|
id: string;
|
|
4
4
|
hasError: boolean;
|
|
@@ -1,22 +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
1
|
import React from 'react';
|
|
13
2
|
import { createSubcomponent } from '@workday/canvas-kit-react/common';
|
|
14
3
|
import { Box } from '@workday/canvas-kit-react/layout';
|
|
15
4
|
import { useFormFieldInput, useFormFieldModel } from './hooks';
|
|
16
|
-
export
|
|
5
|
+
export const FormFieldInput = createSubcomponent('input')({
|
|
17
6
|
displayName: 'FormField.Input',
|
|
18
7
|
modelHook: useFormFieldModel,
|
|
19
8
|
elemPropsHook: useFormFieldInput,
|
|
20
|
-
})(
|
|
21
|
-
return React.createElement(Box,
|
|
9
|
+
})((elemProps, Element) => {
|
|
10
|
+
return React.createElement(Box, Object.assign({ as: Element }, elemProps));
|
|
22
11
|
});
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export interface FormFieldLabelProps extends Omit<ExtractProps<typeof HStack, never>, 'spacing'> {
|
|
2
|
+
import { FlexProps } from '@workday/canvas-kit-react/layout';
|
|
3
|
+
export interface FormFieldLabelProps extends FlexProps {
|
|
5
4
|
/**
|
|
6
5
|
* The text of the label.
|
|
7
6
|
*/
|
|
8
7
|
children: React.ReactNode;
|
|
9
|
-
/**
|
|
10
|
-
* When the input is required, this is spacing between label and asterisk.
|
|
11
|
-
* @default xxxs
|
|
12
|
-
*/
|
|
13
|
-
spacing?: StackSpacing;
|
|
14
8
|
}
|
|
15
9
|
export declare const FormFieldLabel: import("@workday/canvas-kit-react/common").ElementComponentM<"label", FormFieldLabelProps, {
|
|
16
10
|
state: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormFieldLabel.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormFieldLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FormFieldLabel.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormFieldLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAO,SAAS,EAAC,MAAM,kCAAkC,CAAC;AAIjE,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,cAAc;;;;;;;EAyBzB,CAAC"}
|
|
@@ -1,38 +1,15 @@
|
|
|
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, useTheme } from '@workday/canvas-kit-react/common';
|
|
25
|
-
import {
|
|
3
|
+
import { Flex } from '@workday/canvas-kit-react/layout';
|
|
26
4
|
import { LabelText, Text } from '@workday/canvas-kit-react/text';
|
|
27
5
|
import { useFormFieldLabel, useFormFieldModel } from './hooks';
|
|
28
|
-
export
|
|
6
|
+
export const FormFieldLabel = createSubcomponent('label')({
|
|
29
7
|
displayName: 'FormField.Label',
|
|
30
8
|
modelHook: useFormFieldModel,
|
|
31
9
|
elemPropsHook: useFormFieldLabel,
|
|
32
|
-
})(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return (React.createElement(HStack, __assign({ as: Element, spacing: spacing, minWidth: "180px" }, elemProps),
|
|
10
|
+
})(({ gap = 'xxxs', children, ...elemProps }, Element, model) => {
|
|
11
|
+
const theme = useTheme();
|
|
12
|
+
return (React.createElement(Flex, Object.assign({ as: Element, gap: gap, minWidth: "180px" }, elemProps),
|
|
36
13
|
React.createElement(LabelText, { as: "span", fontWeight: "medium" }, children),
|
|
37
14
|
model.state.isRequired && (React.createElement(Text, { fontSize: 20, fontWeight: "regular", textDecoration: "unset", color: theme.canvas.palette.error.main, "aria-hidden": "true" }, "*"))));
|
|
38
15
|
});
|
|
@@ -2,16 +2,14 @@
|
|
|
2
2
|
* Adds the necessary props to a `Hint` component.
|
|
3
3
|
* Used by the FormField.Hint subcomponent and other input type components
|
|
4
4
|
*/
|
|
5
|
-
export declare const useFormFieldHint: <
|
|
5
|
+
export declare const useFormFieldHint: import("@workday/canvas-kit-react/common").BehaviorHook<{
|
|
6
6
|
state: {
|
|
7
7
|
id: string;
|
|
8
8
|
hasError: boolean;
|
|
9
9
|
isRequired: boolean;
|
|
10
10
|
};
|
|
11
11
|
events: {};
|
|
12
|
-
},
|
|
12
|
+
}, {
|
|
13
13
|
id: string;
|
|
14
|
-
}
|
|
15
|
-
ref: import("react").Ref<R>;
|
|
16
|
-
} : {});
|
|
14
|
+
}>;
|
|
17
15
|
//# sourceMappingURL=useFormFieldHint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFormFieldHint.d.ts","sourceRoot":"","sources":["../../../../../form-field/lib/hooks/useFormFieldHint.tsx"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"useFormFieldHint.d.ts","sourceRoot":"","sources":["../../../../../form-field/lib/hooks/useFormFieldHint.tsx"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;EAI3B,CAAC"}
|
|
@@ -4,9 +4,8 @@ import { useFormFieldModel } from './useFormFieldModel';
|
|
|
4
4
|
* Adds the necessary props to a `Hint` component.
|
|
5
5
|
* Used by the FormField.Hint subcomponent and other input type components
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
8
|
-
var state = _a.state;
|
|
7
|
+
export const useFormFieldHint = createElemPropsHook(useFormFieldModel)(({ state }) => {
|
|
9
8
|
return {
|
|
10
|
-
id:
|
|
9
|
+
id: `hint-${state.id}`,
|
|
11
10
|
};
|
|
12
11
|
});
|
|
@@ -2,19 +2,17 @@
|
|
|
2
2
|
* Adds the necessary props to an `Input` component.
|
|
3
3
|
* Used by the FormField.Input subcomponent and other input type components
|
|
4
4
|
*/
|
|
5
|
-
export declare const useFormFieldInput: <
|
|
5
|
+
export declare const useFormFieldInput: import("@workday/canvas-kit-react/common").BehaviorHook<{
|
|
6
6
|
state: {
|
|
7
7
|
id: string;
|
|
8
8
|
hasError: boolean;
|
|
9
9
|
isRequired: boolean;
|
|
10
10
|
};
|
|
11
11
|
events: {};
|
|
12
|
-
},
|
|
12
|
+
}, {
|
|
13
13
|
required: boolean | undefined;
|
|
14
14
|
'aria-invalid': boolean | undefined;
|
|
15
15
|
'aria-describedby': string;
|
|
16
16
|
id: string;
|
|
17
|
-
}
|
|
18
|
-
ref: import("react").Ref<R>;
|
|
19
|
-
} : {});
|
|
17
|
+
}>;
|
|
20
18
|
//# sourceMappingURL=useFormFieldInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFormFieldInput.d.ts","sourceRoot":"","sources":["../../../../../form-field/lib/hooks/useFormFieldInput.tsx"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"useFormFieldInput.d.ts","sourceRoot":"","sources":["../../../../../form-field/lib/hooks/useFormFieldInput.tsx"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;EAO5B,CAAC"}
|
|
@@ -4,12 +4,11 @@ import { useFormFieldModel } from './useFormFieldModel';
|
|
|
4
4
|
* Adds the necessary props to an `Input` component.
|
|
5
5
|
* Used by the FormField.Input subcomponent and other input type components
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
8
|
-
var state = _a.state;
|
|
7
|
+
export const useFormFieldInput = createElemPropsHook(useFormFieldModel)(({ state }) => {
|
|
9
8
|
return {
|
|
10
9
|
required: state.isRequired ? true : undefined,
|
|
11
10
|
'aria-invalid': state.hasError ? true : undefined,
|
|
12
|
-
'aria-describedby':
|
|
13
|
-
id:
|
|
11
|
+
'aria-describedby': `hint-${state.id}`,
|
|
12
|
+
id: `input-${state.id}`,
|
|
14
13
|
};
|
|
15
14
|
});
|
|
@@ -2,16 +2,14 @@
|
|
|
2
2
|
* Adds the necessary props to a `Label` component.
|
|
3
3
|
* Used by the FormField.Label subcomponent and other input type components
|
|
4
4
|
*/
|
|
5
|
-
export declare const useFormFieldLabel: <
|
|
5
|
+
export declare const useFormFieldLabel: import("@workday/canvas-kit-react/common").BehaviorHook<{
|
|
6
6
|
state: {
|
|
7
7
|
id: string;
|
|
8
8
|
hasError: boolean;
|
|
9
9
|
isRequired: boolean;
|
|
10
10
|
};
|
|
11
11
|
events: {};
|
|
12
|
-
},
|
|
12
|
+
}, {
|
|
13
13
|
htmlFor: string;
|
|
14
|
-
}
|
|
15
|
-
ref: import("react").Ref<R>;
|
|
16
|
-
} : {});
|
|
14
|
+
}>;
|
|
17
15
|
//# sourceMappingURL=useFormFieldLabel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFormFieldLabel.d.ts","sourceRoot":"","sources":["../../../../../form-field/lib/hooks/useFormFieldLabel.tsx"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"useFormFieldLabel.d.ts","sourceRoot":"","sources":["../../../../../form-field/lib/hooks/useFormFieldLabel.tsx"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;EAI5B,CAAC"}
|
|
@@ -4,9 +4,8 @@ import { useFormFieldModel } from './useFormFieldModel';
|
|
|
4
4
|
* Adds the necessary props to a `Label` component.
|
|
5
5
|
* Used by the FormField.Label subcomponent and other input type components
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
8
|
-
var state = _a.state;
|
|
7
|
+
export const useFormFieldLabel = createElemPropsHook(useFormFieldModel)(({ state }) => {
|
|
9
8
|
return {
|
|
10
|
-
htmlFor:
|
|
9
|
+
htmlFor: `input-${state.id}`,
|
|
11
10
|
};
|
|
12
11
|
});
|
|
@@ -2,7 +2,6 @@ export declare const useFormFieldModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
2
2
|
/**
|
|
3
3
|
* Optional flag to denote if this field has an error to display. When true the `FormField.Input` will have
|
|
4
4
|
* `required` set to true, and usually some subcomponents will have a error color applied.
|
|
5
|
-
* @default false
|
|
6
5
|
*/
|
|
7
6
|
hasError: boolean;
|
|
8
7
|
/**
|
|
@@ -13,13 +12,12 @@ export declare const useFormFieldModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
13
12
|
* - `FormField.Hint` will set `id` to `hint-${id}`
|
|
14
13
|
*
|
|
15
14
|
* If a value is not provided, a unique id will be automatically created by `useUniqueId()`.
|
|
16
|
-
* @default
|
|
15
|
+
* @default {useUniqueId}
|
|
17
16
|
*/
|
|
18
17
|
id: string;
|
|
19
18
|
/**
|
|
20
19
|
* Optional flag to denote if this field is required. When true the `FormField.Input` will have
|
|
21
20
|
* `required` set to true, and an asterisk will be appended to the `FormField.Label`.
|
|
22
|
-
* @default false
|
|
23
21
|
*/
|
|
24
22
|
isRequired: boolean;
|
|
25
23
|
}> & {} & {}) | undefined) => {
|
|
@@ -28,13 +26,11 @@ export declare const useFormFieldModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
28
26
|
/**
|
|
29
27
|
* Optional flag to denote if this field has an error to display. When true the `FormField.Input` will have
|
|
30
28
|
* `required` set to true, and usually some subcomponents will have a error color applied.
|
|
31
|
-
* @default false
|
|
32
29
|
*/
|
|
33
30
|
hasError: boolean;
|
|
34
31
|
/**
|
|
35
32
|
* Optional flag to denote if this field is required. When true the `FormField.Input` will have
|
|
36
33
|
* `required` set to true, and an asterisk will be appended to the `FormField.Label`.
|
|
37
|
-
* @default false
|
|
38
34
|
*/
|
|
39
35
|
isRequired: boolean;
|
|
40
36
|
};
|
|
@@ -43,7 +39,6 @@ export declare const useFormFieldModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
43
39
|
/**
|
|
44
40
|
* Optional flag to denote if this field has an error to display. When true the `FormField.Input` will have
|
|
45
41
|
* `required` set to true, and usually some subcomponents will have a error color applied.
|
|
46
|
-
* @default false
|
|
47
42
|
*/
|
|
48
43
|
hasError: boolean;
|
|
49
44
|
/**
|
|
@@ -54,13 +49,12 @@ export declare const useFormFieldModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
54
49
|
* - `FormField.Hint` will set `id` to `hint-${id}`
|
|
55
50
|
*
|
|
56
51
|
* If a value is not provided, a unique id will be automatically created by `useUniqueId()`.
|
|
57
|
-
* @default
|
|
52
|
+
* @default {useUniqueId}
|
|
58
53
|
*/
|
|
59
54
|
id: string;
|
|
60
55
|
/**
|
|
61
56
|
* Optional flag to denote if this field is required. When true the `FormField.Input` will have
|
|
62
57
|
* `required` set to true, and an asterisk will be appended to the `FormField.Label`.
|
|
63
|
-
* @default false
|
|
64
58
|
*/
|
|
65
59
|
isRequired: boolean;
|
|
66
60
|
}, {}, {
|
|
@@ -68,13 +62,11 @@ export declare const useFormFieldModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
68
62
|
/**
|
|
69
63
|
* Optional flag to denote if this field has an error to display. When true the `FormField.Input` will have
|
|
70
64
|
* `required` set to true, and usually some subcomponents will have a error color applied.
|
|
71
|
-
* @default false
|
|
72
65
|
*/
|
|
73
66
|
hasError: boolean;
|
|
74
67
|
/**
|
|
75
68
|
* Optional flag to denote if this field is required. When true the `FormField.Input` will have
|
|
76
69
|
* `required` set to true, and an asterisk will be appended to the `FormField.Label`.
|
|
77
|
-
* @default false
|
|
78
70
|
*/
|
|
79
71
|
isRequired: boolean;
|
|
80
72
|
}, {}, {
|
|
@@ -83,13 +75,11 @@ export declare const useFormFieldModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
83
75
|
/**
|
|
84
76
|
* Optional flag to denote if this field has an error to display. When true the `FormField.Input` will have
|
|
85
77
|
* `required` set to true, and usually some subcomponents will have a error color applied.
|
|
86
|
-
* @default false
|
|
87
78
|
*/
|
|
88
79
|
hasError: boolean;
|
|
89
80
|
/**
|
|
90
81
|
* Optional flag to denote if this field is required. When true the `FormField.Input` will have
|
|
91
82
|
* `required` set to true, and an asterisk will be appended to the `FormField.Label`.
|
|
92
|
-
* @default false
|
|
93
83
|
*/
|
|
94
84
|
isRequired: boolean;
|
|
95
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFormFieldModel.d.ts","sourceRoot":"","sources":["../../../../../form-field/lib/hooks/useFormFieldModel.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB;IAE1B
|
|
1
|
+
{"version":3,"file":"useFormFieldModel.d.ts","sourceRoot":"","sources":["../../../../../form-field/lib/hooks/useFormFieldModel.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB;IAE1B;;;OAGG;;IAEH;;;;;;;;;OASG;;IAEH;;;OAGG;;;;;QAnBH;;;WAGG;;QAaH;;;WAGG;;;;;IAnBH;;;OAGG;;IAEH;;;;;;;;;OASG;;IAEH;;;OAGG;;;;IAnBH;;;OAGG;;IAaH;;;OAGG;;;;;QAnBH;;;WAGG;;QAaH;;;WAGG;;;;EAeL,CAAC"}
|
|
@@ -1,21 +1,9 @@
|
|
|
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 useFormFieldModel = createModelHook({
|
|
14
3
|
defaultConfig: {
|
|
15
4
|
/**
|
|
16
5
|
* Optional flag to denote if this field has an error to display. When true the `FormField.Input` will have
|
|
17
6
|
* `required` set to true, and usually some subcomponents will have a error color applied.
|
|
18
|
-
* @default false
|
|
19
7
|
*/
|
|
20
8
|
hasError: false,
|
|
21
9
|
/**
|
|
@@ -26,21 +14,23 @@ export var useFormFieldModel = createModelHook({
|
|
|
26
14
|
* - `FormField.Hint` will set `id` to `hint-${id}`
|
|
27
15
|
*
|
|
28
16
|
* If a value is not provided, a unique id will be automatically created by `useUniqueId()`.
|
|
29
|
-
* @default
|
|
17
|
+
* @default {useUniqueId}
|
|
30
18
|
*/
|
|
31
19
|
id: '',
|
|
32
20
|
/**
|
|
33
21
|
* Optional flag to denote if this field is required. When true the `FormField.Input` will have
|
|
34
22
|
* `required` set to true, and an asterisk will be appended to the `FormField.Label`.
|
|
35
|
-
* @default false
|
|
36
23
|
*/
|
|
37
24
|
isRequired: false,
|
|
38
25
|
},
|
|
39
|
-
})(
|
|
40
|
-
|
|
41
|
-
|
|
26
|
+
})(config => {
|
|
27
|
+
const id = useUniqueId(config.id);
|
|
28
|
+
const state = {
|
|
29
|
+
...config,
|
|
30
|
+
id,
|
|
31
|
+
};
|
|
42
32
|
return {
|
|
43
|
-
state
|
|
33
|
+
state,
|
|
44
34
|
events: {},
|
|
45
35
|
};
|
|
46
36
|
});
|