@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
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {GridProps, Grid} from '@workday/canvas-kit-react/layout';
|
|
3
|
+
import {type, colors} from '@workday/canvas-kit-react/tokens';
|
|
4
|
+
import {createComponent} from '@workday/canvas-kit-react/common';
|
|
5
|
+
import {TableHead} from './TableHead';
|
|
6
|
+
import {TableBody} from './TableBody';
|
|
7
|
+
import {TableRow} from './TableRow';
|
|
8
|
+
import {TableHeader} from './TableHeader';
|
|
9
|
+
import {TableCell} from './TableCell';
|
|
10
|
+
import {TableFooter} from './TableFooter';
|
|
11
|
+
import {TableCaption} from './TableCaption';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* `Table` is a simple styled compound component that renders a [table](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/table) element. It is used to present information in a two-dimensional table comprised of rows and columns of cells containing data.
|
|
15
|
+
*
|
|
16
|
+
*
|
|
17
|
+
* ```tsx
|
|
18
|
+
import {Table} from '@workday/canvas-kit-preview-react/table';
|
|
19
|
+
|
|
20
|
+
export default function App() {
|
|
21
|
+
return (
|
|
22
|
+
<Table>
|
|
23
|
+
<Table.Caption>Table Caption</Table.Caption>
|
|
24
|
+
<Table.Head>
|
|
25
|
+
<Table.Row>
|
|
26
|
+
<Table.Header>Table Header</Table.Header>
|
|
27
|
+
<Table.Header>Table Header</Table.Header>
|
|
28
|
+
</Table.Row>
|
|
29
|
+
</Table.Head>
|
|
30
|
+
<Table.Body>
|
|
31
|
+
<Table.Row>
|
|
32
|
+
<Table.Header>Table Header</Table.Header>
|
|
33
|
+
<Table.Header>Table Header</Table.Header>
|
|
34
|
+
</Table.Row>
|
|
35
|
+
<Table.Row>
|
|
36
|
+
<Table.Header>Table Header</Table.Header>
|
|
37
|
+
<Table.Cell>Table Data Cell</Table.Cell>
|
|
38
|
+
</Table.Row>
|
|
39
|
+
<Table.Row>
|
|
40
|
+
<Table.Header>Table Header</Table.Header>
|
|
41
|
+
<Table.Cell>Table Data Cell</Table.Cell>
|
|
42
|
+
</Table.Row>
|
|
43
|
+
</Table.Body>
|
|
44
|
+
<Table.Footer>
|
|
45
|
+
<Table.Row>
|
|
46
|
+
<Table.Header>Table Header</Table.Header>
|
|
47
|
+
<Table.Cell>Table Data Cell</Table.Cell>
|
|
48
|
+
</Table.Row>
|
|
49
|
+
</Table.Footer>
|
|
50
|
+
</Table>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
*/
|
|
55
|
+
export const Table = createComponent('table')({
|
|
56
|
+
displayName: 'Table',
|
|
57
|
+
Component: ({children, ...elemProps}: GridProps, ref, Element) => {
|
|
58
|
+
return (
|
|
59
|
+
<Grid
|
|
60
|
+
as={Element}
|
|
61
|
+
ref={ref}
|
|
62
|
+
border={`1px solid ${colors.soap500}`}
|
|
63
|
+
borderRadius="l"
|
|
64
|
+
overflow="scroll"
|
|
65
|
+
{...type.levels.subtext.large}
|
|
66
|
+
{...elemProps}
|
|
67
|
+
>
|
|
68
|
+
{children}
|
|
69
|
+
</Grid>
|
|
70
|
+
);
|
|
71
|
+
},
|
|
72
|
+
subComponents: {
|
|
73
|
+
/**
|
|
74
|
+
* `Table.Caption` renders a [caption](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/caption) element.
|
|
75
|
+
*
|
|
76
|
+
*
|
|
77
|
+
* ```tsx
|
|
78
|
+
import {Table} from '@workday/canvas-kit-preview-react/table';
|
|
79
|
+
|
|
80
|
+
export default function App() {
|
|
81
|
+
return (
|
|
82
|
+
<Table>
|
|
83
|
+
<Table.Caption>Table Caption</Table.Caption>
|
|
84
|
+
<Table.Body>
|
|
85
|
+
<Table.Row>
|
|
86
|
+
<Table.Header>Table Header</Table.Header>
|
|
87
|
+
<Table.Cell>Table Cell</Table.Cell>
|
|
88
|
+
</Table.Row>
|
|
89
|
+
</Table.Body>
|
|
90
|
+
</Table>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
*/
|
|
95
|
+
Caption: TableCaption,
|
|
96
|
+
/**
|
|
97
|
+
* `Table.Head` renders a [thead](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/thead) element.
|
|
98
|
+
*
|
|
99
|
+
*
|
|
100
|
+
* ```tsx
|
|
101
|
+
import {Table} from '@workday/canvas-kit-preview-react/table';
|
|
102
|
+
|
|
103
|
+
export default function App() {
|
|
104
|
+
return (
|
|
105
|
+
<Table>
|
|
106
|
+
<Table.Head>
|
|
107
|
+
<Table.Row>
|
|
108
|
+
<Table.Header>Table Header</Table.Header>
|
|
109
|
+
<Table.Cell>Table Cell</Table.Cell>
|
|
110
|
+
</Table.Row>
|
|
111
|
+
</Table.Head>
|
|
112
|
+
</Table>
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
*/
|
|
117
|
+
Head: TableHead,
|
|
118
|
+
/**
|
|
119
|
+
* `Table.Body` renders a [tbody](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tbody) element.
|
|
120
|
+
*
|
|
121
|
+
*
|
|
122
|
+
* ```tsx
|
|
123
|
+
import {Table} from '@workday/canvas-kit-preview-react/table';
|
|
124
|
+
|
|
125
|
+
export default function App() {
|
|
126
|
+
return (
|
|
127
|
+
<Table>
|
|
128
|
+
<Table.Body>
|
|
129
|
+
<Table.Row>
|
|
130
|
+
<Table.Header>Table Header</Table.Header>
|
|
131
|
+
<Table.Cell>Table Cell</Table.Cell>
|
|
132
|
+
</Table.Row>
|
|
133
|
+
</Table.Body>
|
|
134
|
+
</Table>
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
*/
|
|
139
|
+
Body: TableBody,
|
|
140
|
+
/**
|
|
141
|
+
* `Table.Row` renders a [tr](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tr) element.
|
|
142
|
+
*
|
|
143
|
+
* **Note**: `Table.Row` is built on [Grid](/docs/components-layout-grid--basic). It will look for
|
|
144
|
+
* how many children are there and if those children are valid React Elements. This will adjust the
|
|
145
|
+
* amount of columns automatically using the `gridTemplateColumns` style prop and the width of the
|
|
146
|
+
* columns is also set using a `minmax` function in the `gridTemplateColumns` style prop. If a user
|
|
147
|
+
* would like to adjust this, it can be overwritten on `Table.Row`. See the example below for how to
|
|
148
|
+
* overwrite `gridTemplateColumns`.
|
|
149
|
+
*
|
|
150
|
+
*
|
|
151
|
+
* ```tsx
|
|
152
|
+
import {Table} from '@workday/canvas-kit-preview-react/table';
|
|
153
|
+
|
|
154
|
+
export default function App() {
|
|
155
|
+
return (
|
|
156
|
+
<Table>
|
|
157
|
+
<Table.Head>
|
|
158
|
+
<Table.Row gridTemplateColumns="repeat(4, minmax(100px, 1fr))">
|
|
159
|
+
<Table.Header>Table Header</Table.Header>
|
|
160
|
+
<Table.Cell>Table Cell</Table.Cell>
|
|
161
|
+
</Table.Row>
|
|
162
|
+
</Table.Head>
|
|
163
|
+
</Table>
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
*/
|
|
168
|
+
Row: TableRow,
|
|
169
|
+
/**
|
|
170
|
+
* `Table.Header` renders a [th](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th) element.
|
|
171
|
+
*
|
|
172
|
+
*
|
|
173
|
+
* ```tsx
|
|
174
|
+
import {Table} from '@workday/canvas-kit-preview-react/table';
|
|
175
|
+
|
|
176
|
+
export default function App() {
|
|
177
|
+
return (
|
|
178
|
+
<Table>
|
|
179
|
+
<Table.Head>
|
|
180
|
+
<Table.Row>
|
|
181
|
+
<Table.Header>Table Header</Table.Header>
|
|
182
|
+
<Table.Cell>Table Cell</Table.Cell>
|
|
183
|
+
</Table.Row>
|
|
184
|
+
</Table.Head>
|
|
185
|
+
</Table>
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
*/
|
|
190
|
+
Header: TableHeader,
|
|
191
|
+
/**
|
|
192
|
+
* `Table.Cell` renders a [td](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td) element.
|
|
193
|
+
*
|
|
194
|
+
*
|
|
195
|
+
* ```tsx
|
|
196
|
+
import {Table} from '@workday/canvas-kit-preview-react/table';
|
|
197
|
+
|
|
198
|
+
export default function App() {
|
|
199
|
+
return (
|
|
200
|
+
<Table>
|
|
201
|
+
<Table.Body>
|
|
202
|
+
<Table.Row>
|
|
203
|
+
<Table.Header>Table Header</Table.Header>
|
|
204
|
+
<Table.Cell>Table Cell</Table.Cell>
|
|
205
|
+
</Table.Row>
|
|
206
|
+
</Table.Body>
|
|
207
|
+
</Table>
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
*/
|
|
212
|
+
Cell: TableCell,
|
|
213
|
+
/**
|
|
214
|
+
* `Table.Footer` renders a [tfoot](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tfoot) element.
|
|
215
|
+
*
|
|
216
|
+
*
|
|
217
|
+
* ```tsx
|
|
218
|
+
import {Table} from '@workday/canvas-kit-preview-react/table';
|
|
219
|
+
|
|
220
|
+
export default function App() {
|
|
221
|
+
return (
|
|
222
|
+
<Table>
|
|
223
|
+
<Table.Footer>
|
|
224
|
+
<Table.Row>
|
|
225
|
+
<Table.Header>Table Header</Table.Header>
|
|
226
|
+
<Table.Cell>Table Cell</Table.Cell>
|
|
227
|
+
</Table.Row>
|
|
228
|
+
</Table.Footer>
|
|
229
|
+
</Table>
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
```
|
|
233
|
+
*/
|
|
234
|
+
Footer: TableFooter,
|
|
235
|
+
},
|
|
236
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Grid, GridProps} from '@workday/canvas-kit-react/layout';
|
|
3
|
+
import {createComponent, styled, StyledType} from '@workday/canvas-kit-react/common';
|
|
4
|
+
|
|
5
|
+
const StyledBody = styled(Grid.as('tbody'))<StyledType>({
|
|
6
|
+
'tr:last-of-type td': {
|
|
7
|
+
borderBottom: 'none',
|
|
8
|
+
},
|
|
9
|
+
'tr:last-of-type th': {
|
|
10
|
+
borderBottom: 'none',
|
|
11
|
+
},
|
|
12
|
+
'tr:first-of-type td': {
|
|
13
|
+
borderTop: 'none',
|
|
14
|
+
},
|
|
15
|
+
'tr:first-of-type th': {
|
|
16
|
+
borderTop: 'none',
|
|
17
|
+
},
|
|
18
|
+
'td:last-of-type': {
|
|
19
|
+
borderRight: 'none',
|
|
20
|
+
},
|
|
21
|
+
'td:first-of-type': {
|
|
22
|
+
borderLeft: 'none',
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export const TableBody = createComponent('tbody')({
|
|
27
|
+
displayName: 'Table.Body',
|
|
28
|
+
Component: ({children, ...elemProps}: GridProps, ref, Element) => {
|
|
29
|
+
return (
|
|
30
|
+
<StyledBody as={Element} ref={ref} {...elemProps}>
|
|
31
|
+
{children}
|
|
32
|
+
</StyledBody>
|
|
33
|
+
);
|
|
34
|
+
},
|
|
35
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {colors} from '@workday/canvas-kit-react/tokens';
|
|
3
|
+
import {FlexProps, Flex} from '@workday/canvas-kit-react/layout';
|
|
4
|
+
import {createComponent} from '@workday/canvas-kit-react/common';
|
|
5
|
+
|
|
6
|
+
export const TableCaption = createComponent('caption')({
|
|
7
|
+
displayName: 'Table.Caption',
|
|
8
|
+
Component: ({children, ...elemProps}: FlexProps, ref, Element) => {
|
|
9
|
+
return (
|
|
10
|
+
<Flex
|
|
11
|
+
as={Element}
|
|
12
|
+
ref={ref}
|
|
13
|
+
borderBottom={`1px solid ${colors.soap500}`}
|
|
14
|
+
paddingY="xxs"
|
|
15
|
+
paddingX="s"
|
|
16
|
+
{...elemProps}
|
|
17
|
+
>
|
|
18
|
+
{children}
|
|
19
|
+
</Flex>
|
|
20
|
+
);
|
|
21
|
+
},
|
|
22
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Grid, GridProps} from '@workday/canvas-kit-react/layout';
|
|
3
|
+
import {colors} from '@workday/canvas-kit-react/tokens';
|
|
4
|
+
import {createComponent} from '@workday/canvas-kit-react/common';
|
|
5
|
+
|
|
6
|
+
export const TableCell = createComponent('td')({
|
|
7
|
+
displayName: 'Table.Cell',
|
|
8
|
+
Component: ({children, ...elemProps}: GridProps, ref, Element) => {
|
|
9
|
+
return (
|
|
10
|
+
<Grid
|
|
11
|
+
as={Element}
|
|
12
|
+
ref={ref}
|
|
13
|
+
alignItems="center"
|
|
14
|
+
backgroundColor="frenchVanilla100"
|
|
15
|
+
borderBottom={`1px solid ${colors.soap400}`}
|
|
16
|
+
justifyContent="left"
|
|
17
|
+
minHeight="56px"
|
|
18
|
+
paddingY="xxs"
|
|
19
|
+
paddingX="s"
|
|
20
|
+
wordBreak="break-word"
|
|
21
|
+
{...elemProps}
|
|
22
|
+
>
|
|
23
|
+
{children}
|
|
24
|
+
</Grid>
|
|
25
|
+
);
|
|
26
|
+
},
|
|
27
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Grid, GridProps} from '@workday/canvas-kit-react/layout';
|
|
3
|
+
import {createComponent} from '@workday/canvas-kit-react/common';
|
|
4
|
+
|
|
5
|
+
export const TableFooter = createComponent('tfoot')({
|
|
6
|
+
displayName: 'Table.Footer',
|
|
7
|
+
Component: ({children, ...elemProps}: GridProps, ref, Element) => {
|
|
8
|
+
return (
|
|
9
|
+
<Grid as={Element} ref={ref} {...elemProps}>
|
|
10
|
+
{children}
|
|
11
|
+
</Grid>
|
|
12
|
+
);
|
|
13
|
+
},
|
|
14
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {GridProps, Grid} from '@workday/canvas-kit-react/layout';
|
|
3
|
+
import {createComponent, styled, StyledType} from '@workday/canvas-kit-react/common';
|
|
4
|
+
|
|
5
|
+
const StyledHead = styled(Grid.as('thead'))<StyledType>({
|
|
6
|
+
'th:last-of-type': {
|
|
7
|
+
borderRight: 'none',
|
|
8
|
+
},
|
|
9
|
+
'th:first-of-type': {
|
|
10
|
+
borderLeft: 'none',
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export const TableHead = createComponent('thead')({
|
|
15
|
+
displayName: 'Table.Head',
|
|
16
|
+
Component: ({children, ...elemProps}: GridProps, ref, Element) => {
|
|
17
|
+
return (
|
|
18
|
+
<StyledHead as={Element} ref={ref} backgroundColor="soap100" minHeight="48px" {...elemProps}>
|
|
19
|
+
{children}
|
|
20
|
+
</StyledHead>
|
|
21
|
+
);
|
|
22
|
+
},
|
|
23
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Grid, GridProps} from '@workday/canvas-kit-react/layout';
|
|
3
|
+
import {colors} from '@workday/canvas-kit-react/tokens';
|
|
4
|
+
import {createComponent} from '@workday/canvas-kit-react/common';
|
|
5
|
+
|
|
6
|
+
export const TableHeader = createComponent('th')({
|
|
7
|
+
displayName: 'Table.Header',
|
|
8
|
+
Component: ({children, ...elemProps}: GridProps, ref, Element) => {
|
|
9
|
+
return (
|
|
10
|
+
<Grid
|
|
11
|
+
as={Element}
|
|
12
|
+
ref={ref}
|
|
13
|
+
alignItems="center"
|
|
14
|
+
backgroundColor="frenchVanilla100"
|
|
15
|
+
borderBottom={`1px solid ${colors.soap400}`}
|
|
16
|
+
justifyContent="left"
|
|
17
|
+
minHeight="56px"
|
|
18
|
+
paddingY="xxs"
|
|
19
|
+
paddingX="s"
|
|
20
|
+
wordBreak="break-word"
|
|
21
|
+
fontWeight="medium"
|
|
22
|
+
{...elemProps}
|
|
23
|
+
>
|
|
24
|
+
{children}
|
|
25
|
+
</Grid>
|
|
26
|
+
);
|
|
27
|
+
},
|
|
28
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {GridProps, Grid} from '@workday/canvas-kit-react/layout';
|
|
3
|
+
import {createComponent} from '@workday/canvas-kit-react/common';
|
|
4
|
+
|
|
5
|
+
export const TableRow = createComponent('tr')({
|
|
6
|
+
displayName: 'Table.Row',
|
|
7
|
+
Component: ({children, ...elemProps}: GridProps, ref, Element) => {
|
|
8
|
+
const validChildren = (children: React.ReactNode) => {
|
|
9
|
+
return React.Children.toArray(children).filter(child =>
|
|
10
|
+
React.isValidElement(child)
|
|
11
|
+
) as React.ReactElement[];
|
|
12
|
+
};
|
|
13
|
+
const childrenArray = validChildren(children).length;
|
|
14
|
+
return (
|
|
15
|
+
<Grid
|
|
16
|
+
as={Element}
|
|
17
|
+
ref={ref}
|
|
18
|
+
gridAutoFlow="column"
|
|
19
|
+
gridTemplateColumns={`repeat(${childrenArray}, minmax(10rem, 1fr))`}
|
|
20
|
+
{...elemProps}
|
|
21
|
+
>
|
|
22
|
+
{children}
|
|
23
|
+
</Grid>
|
|
24
|
+
);
|
|
25
|
+
},
|
|
26
|
+
});
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import {createContainer, ExtractProps} from '@workday/canvas-kit-react/common';
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import {
|
|
5
|
+
FormField,
|
|
6
|
+
useFormFieldModel,
|
|
7
|
+
useFormFieldOrientation,
|
|
8
|
+
} from '@workday/canvas-kit-preview-react/form-field';
|
|
9
|
+
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
6
10
|
|
|
7
|
-
import {useTextAreaModel} from './hooks';
|
|
8
11
|
import {TextAreaField} from './TextAreaField';
|
|
9
12
|
|
|
10
13
|
export interface TextAreaProps extends ExtractProps<typeof FormField, never> {
|
|
@@ -16,7 +19,7 @@ export interface TextAreaProps extends ExtractProps<typeof FormField, never> {
|
|
|
16
19
|
|
|
17
20
|
export const TextArea = createContainer('div')({
|
|
18
21
|
displayName: 'TextArea',
|
|
19
|
-
modelHook:
|
|
22
|
+
modelHook: useFormFieldModel,
|
|
20
23
|
subComponents: {
|
|
21
24
|
Field: TextAreaField,
|
|
22
25
|
Label: FormField.Label,
|
|
@@ -26,8 +29,8 @@ export const TextArea = createContainer('div')({
|
|
|
26
29
|
const layoutProps = useFormFieldOrientation(orientation);
|
|
27
30
|
|
|
28
31
|
return (
|
|
29
|
-
<
|
|
32
|
+
<Flex as={Element} {...layoutProps} {...elemProps}>
|
|
30
33
|
{children}
|
|
31
|
-
</
|
|
34
|
+
</Flex>
|
|
32
35
|
);
|
|
33
36
|
});
|
|
@@ -9,8 +9,12 @@ import {
|
|
|
9
9
|
spaceNumbers,
|
|
10
10
|
type,
|
|
11
11
|
} from '@workday/canvas-kit-react/tokens';
|
|
12
|
-
import {
|
|
13
|
-
|
|
12
|
+
import {
|
|
13
|
+
createSubcomponent,
|
|
14
|
+
ExtractProps,
|
|
15
|
+
useTheme,
|
|
16
|
+
useThemedRing,
|
|
17
|
+
} from '@workday/canvas-kit-react/common';
|
|
14
18
|
import {FormField} from '@workday/canvas-kit-preview-react/form-field';
|
|
15
19
|
import {useTextInputModel} from '@workday/canvas-kit-preview-react/text-input';
|
|
16
20
|
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import {createContainer, ExtractProps} from '@workday/canvas-kit-react/common';
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import {
|
|
5
|
+
FormField,
|
|
6
|
+
useFormFieldModel,
|
|
7
|
+
useFormFieldOrientation,
|
|
8
|
+
} from '@workday/canvas-kit-preview-react/form-field';
|
|
9
|
+
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
6
10
|
|
|
7
|
-
import {useTextInputModel} from './hooks';
|
|
8
11
|
import {TextInputField} from './TextInputField';
|
|
9
12
|
|
|
10
13
|
export interface TextInputProps extends ExtractProps<typeof FormField, never> {
|
|
@@ -16,7 +19,7 @@ export interface TextInputProps extends ExtractProps<typeof FormField, never> {
|
|
|
16
19
|
|
|
17
20
|
export const TextInput = createContainer('div')({
|
|
18
21
|
displayName: 'TextInput',
|
|
19
|
-
modelHook:
|
|
22
|
+
modelHook: useFormFieldModel,
|
|
20
23
|
subComponents: {
|
|
21
24
|
Field: TextInputField,
|
|
22
25
|
Label: FormField.Label,
|
|
@@ -26,8 +29,8 @@ export const TextInput = createContainer('div')({
|
|
|
26
29
|
const layoutProps = useFormFieldOrientation(orientation);
|
|
27
30
|
|
|
28
31
|
return (
|
|
29
|
-
<
|
|
32
|
+
<Flex as={Element} {...layoutProps} {...elemProps}>
|
|
30
33
|
{children}
|
|
31
|
-
</
|
|
34
|
+
</Flex>
|
|
32
35
|
);
|
|
33
36
|
});
|
|
@@ -9,11 +9,15 @@ import {
|
|
|
9
9
|
space,
|
|
10
10
|
type,
|
|
11
11
|
} from '@workday/canvas-kit-react/tokens';
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
import {
|
|
13
|
+
createSubcomponent,
|
|
14
|
+
ExtractProps,
|
|
15
|
+
useTheme,
|
|
16
|
+
useThemedRing,
|
|
17
|
+
} from '@workday/canvas-kit-react/common';
|
|
18
|
+
import {FormField, useFormFieldModel} from '@workday/canvas-kit-preview-react/form-field';
|
|
15
19
|
|
|
16
|
-
import {useTextInputField
|
|
20
|
+
import {useTextInputField} from './hooks';
|
|
17
21
|
|
|
18
22
|
const baseStyles: CSSProperties = {
|
|
19
23
|
transition: '0.2s box-shadow, 0.2s border-color',
|
|
@@ -41,7 +45,7 @@ const baseStyles: CSSProperties = {
|
|
|
41
45
|
|
|
42
46
|
export const TextInputField = createSubcomponent('input')({
|
|
43
47
|
displayName: 'TextInput.Field',
|
|
44
|
-
modelHook:
|
|
48
|
+
modelHook: useFormFieldModel,
|
|
45
49
|
elemPropsHook: useTextInputField,
|
|
46
50
|
})<ExtractProps<typeof FormField.Input, never>>((elemProps, Element, model) => {
|
|
47
51
|
const theme = useTheme();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../text-area/lib/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export declare const useTextAreaModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
2
|
-
hasError: boolean;
|
|
3
|
-
id: string;
|
|
4
|
-
isRequired: boolean;
|
|
5
|
-
}> & {} & {}) | undefined) => {
|
|
6
|
-
state: {
|
|
7
|
-
id: string;
|
|
8
|
-
hasError: boolean;
|
|
9
|
-
isRequired: boolean;
|
|
10
|
-
};
|
|
11
|
-
events: {};
|
|
12
|
-
}) & import("@workday/canvas-kit-react/common").ModelExtras<{
|
|
13
|
-
hasError: boolean;
|
|
14
|
-
id: string;
|
|
15
|
-
isRequired: boolean;
|
|
16
|
-
}, {}, {
|
|
17
|
-
id: string;
|
|
18
|
-
hasError: boolean;
|
|
19
|
-
isRequired: boolean;
|
|
20
|
-
}, {}, {
|
|
21
|
-
state: {
|
|
22
|
-
id: string;
|
|
23
|
-
hasError: boolean;
|
|
24
|
-
isRequired: boolean;
|
|
25
|
-
};
|
|
26
|
-
events: {};
|
|
27
|
-
}>;
|
|
28
|
-
//# sourceMappingURL=useTextAreaModel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useTextAreaModel.d.ts","sourceRoot":"","sources":["../../../../../text-area/lib/hooks/useTextAreaModel.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;EAAoB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../text-area/lib/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './useTextAreaModel';
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export declare const useTextAreaModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
2
|
-
hasError: boolean;
|
|
3
|
-
id: string;
|
|
4
|
-
isRequired: boolean;
|
|
5
|
-
}> & {} & {}) | undefined) => {
|
|
6
|
-
state: {
|
|
7
|
-
id: string;
|
|
8
|
-
hasError: boolean;
|
|
9
|
-
isRequired: boolean;
|
|
10
|
-
};
|
|
11
|
-
events: {};
|
|
12
|
-
}) & import("@workday/canvas-kit-react/common").ModelExtras<{
|
|
13
|
-
hasError: boolean;
|
|
14
|
-
id: string;
|
|
15
|
-
isRequired: boolean;
|
|
16
|
-
}, {}, {
|
|
17
|
-
id: string;
|
|
18
|
-
hasError: boolean;
|
|
19
|
-
isRequired: boolean;
|
|
20
|
-
}, {}, {
|
|
21
|
-
state: {
|
|
22
|
-
id: string;
|
|
23
|
-
hasError: boolean;
|
|
24
|
-
isRequired: boolean;
|
|
25
|
-
};
|
|
26
|
-
events: {};
|
|
27
|
-
}>;
|
|
28
|
-
//# sourceMappingURL=useTextAreaModel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useTextAreaModel.d.ts","sourceRoot":"","sources":["../../../../../text-area/lib/hooks/useTextAreaModel.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;EAAoB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './useTextAreaModel';
|