@pantheon-systems/pds-toolkit-react 1.0.0-dev.22 → 1.0.0-dev.221

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.
Files changed (238) hide show
  1. package/README.md +31 -1
  2. package/_dist/components/Avatar/Avatar.d.ts +37 -0
  3. package/_dist/components/BranchDiff/BranchDiff.d.ts +35 -0
  4. package/_dist/components/CTALink/CTALink.d.ts +20 -0
  5. package/_dist/components/CTASlice/CTASlice.d.ts +43 -0
  6. package/_dist/components/Callout/Callout.d.ts +31 -0
  7. package/_dist/components/Callout/sample-callout-content.d.ts +2 -0
  8. package/_dist/components/CodeBlock/CodeBlock.d.ts +56 -0
  9. package/_dist/components/CodeBlock/code-examples.d.ts +5 -0
  10. package/_dist/components/CodeBlock/themes/index.d.ts +2 -0
  11. package/_dist/components/CodeBlock/themes/pdsDark.d.ts +2 -0
  12. package/_dist/components/CodeBlock/themes/pdsLight.d.ts +2 -0
  13. package/_dist/components/ComparisonList/ComparisonList.d.ts +42 -0
  14. package/_dist/components/DashboardStat/DashboardStat.d.ts +28 -0
  15. package/_dist/components/FileDiff/FileDiff.d.ts +35 -0
  16. package/_dist/components/FlowSteps/FlowSteps.d.ts +33 -0
  17. package/_dist/components/FlowSteps/example-steps.d.ts +15 -0
  18. package/_dist/components/Icon/Icon.d.ts +686 -0
  19. package/_dist/components/LinkNewWindow/LinkNewWindow.d.ts +31 -0
  20. package/_dist/components/Modal/Modal.d.ts +40 -0
  21. package/_dist/components/Pagination/Pagination.d.ts +54 -0
  22. package/_dist/components/Pagination/usePagination.d.ts +7 -0
  23. package/_dist/components/PantheonLogo/PantheonLogo.d.ts +32 -0
  24. package/_dist/components/PantheonLogo/pantheon-logo-data.d.ts +4 -0
  25. package/_dist/components/PlatformIcon/PlatformIcon.d.ts +12 -0
  26. package/_dist/components/Popover/Popover.d.ts +58 -0
  27. package/_dist/components/PullQuote/PullQuote.d.ts +34 -0
  28. package/_dist/components/RefreshChecker/RefreshChecker.d.ts +46 -0
  29. package/_dist/components/SiteDashboardHeading/SiteDashboardHeading.d.ts +28 -0
  30. package/_dist/components/Skiplink/Skiplink.d.ts +21 -0
  31. package/_dist/components/SocialLinks/SocialLinks.d.ts +23 -0
  32. package/_dist/components/StatusIndicator/StatusIndicator.d.ts +24 -0
  33. package/_dist/components/Stepper/Stepper.d.ts +49 -0
  34. package/_dist/components/Table/Table.d.ts +27 -0
  35. package/_dist/components/TableOfContents/TableOfContents.d.ts +45 -0
  36. package/_dist/components/Tabs/Tabs.d.ts +63 -0
  37. package/_dist/components/Tag/Tag.d.ts +39 -0
  38. package/_dist/components/Tooltip/Tooltip.d.ts +51 -0
  39. package/_dist/components/badges/IndicatorBadge/IndicatorBadge.d.ts +27 -0
  40. package/_dist/components/badges/StatusBadge/StatusBadge.d.ts +35 -0
  41. package/_dist/components/badges/Tally/Tally.d.ts +38 -0
  42. package/_dist/components/buttons/Button/Button.d.ts +62 -0
  43. package/_dist/components/buttons/ButtonLink/ButtonLink.d.ts +44 -0
  44. package/_dist/components/buttons/ClipboardButton/ClipboardButton.d.ts +31 -0
  45. package/_dist/components/buttons/IconButton/IconButton.d.ts +50 -0
  46. package/_dist/components/buttons/MenuButton/MenuButton.d.ts +75 -0
  47. package/_dist/components/buttons/SegmentedButton/SegmentedButton.d.ts +62 -0
  48. package/_dist/components/buttons/SplitButton/SplitButton.d.ts +37 -0
  49. package/_dist/components/buttons/UtilityButton/UtilityButton.d.ts +48 -0
  50. package/_dist/components/cards/Card/Card.d.ts +29 -0
  51. package/_dist/components/cards/CardHeading/CardHeading.d.ts +32 -0
  52. package/_dist/components/cards/CardSelectGroup/CardSelectGroup.d.ts +60 -0
  53. package/_dist/components/cards/LinksCard/LinksCard.d.ts +29 -0
  54. package/_dist/components/cards/LinksCard/links-card-sample-data.d.ts +2 -0
  55. package/_dist/components/cards/NewSiteCard/NewSiteCard.d.ts +57 -0
  56. package/_dist/components/cards/PricingCard/PricingCard.d.ts +90 -0
  57. package/_dist/components/cards/SiteCard/SiteCard.d.ts +45 -0
  58. package/_dist/components/footer/FooterHeading/FooterHeading.d.ts +22 -0
  59. package/_dist/components/footer/FooterLinks/FooterLinks.d.ts +26 -0
  60. package/_dist/components/footer/SiteFooter/SiteFooter.d.ts +26 -0
  61. package/_dist/components/footer/SiteFooter/footer-content.d.ts +2 -0
  62. package/_dist/components/inputs/Checkbox/Checkbox.d.ts +96 -0
  63. package/_dist/components/inputs/CheckboxFieldset/CheckboxFieldset.d.ts +60 -0
  64. package/_dist/components/inputs/CheckboxGroup/CheckboxGroup.d.ts +76 -0
  65. package/_dist/components/inputs/Combobox/Combobox.d.ts +134 -0
  66. package/_dist/components/inputs/FileUpload/FileUpload.d.ts +89 -0
  67. package/_dist/components/inputs/InputGroup/InputGroup.d.ts +19 -0
  68. package/_dist/components/inputs/RadioGroup/RadioGroup.d.ts +100 -0
  69. package/_dist/components/inputs/Select/Select.d.ts +118 -0
  70. package/_dist/components/inputs/Switch/Switch.d.ts +74 -0
  71. package/_dist/components/inputs/TextInput/TextInput.d.ts +131 -0
  72. package/_dist/components/inputs/Textarea/Textarea.d.ts +106 -0
  73. package/_dist/components/inputs/input-types.d.ts +1 -0
  74. package/_dist/components/inputs/input-utilities.d.ts +90 -0
  75. package/_dist/components/navigation/Breadcrumb/Breadcrumb.d.ts +23 -0
  76. package/_dist/components/navigation/DashboardNav/DashboardNav.d.ts +35 -0
  77. package/_dist/components/navigation/DashboardNav/DashboardNavItem.d.ts +25 -0
  78. package/_dist/components/navigation/DashboardNav/dashboard-nav-utilities.d.ts +4 -0
  79. package/_dist/components/navigation/DashboardSearch/DashboardSearch.d.ts +70 -0
  80. package/_dist/components/navigation/DashboardSearch/SiteOptionDisplay.d.ts +39 -0
  81. package/_dist/components/navigation/DropdownMenu/DropdownMenu.d.ts +28 -0
  82. package/_dist/components/navigation/NavMenu/NavMenu.d.ts +43 -0
  83. package/_dist/components/navigation/NavMenu/NavMenuDropdown.d.ts +24 -0
  84. package/_dist/components/navigation/Navbar/Navbar.d.ts +60 -0
  85. package/_dist/components/navigation/SideNav/SideNav.d.ts +47 -0
  86. package/_dist/components/navigation/SideNavCompact/SideNavCompact.d.ts +47 -0
  87. package/_dist/components/navigation/TabMenu/TabMenu.d.ts +43 -0
  88. package/_dist/components/navigation/TabMenu/TabMenuDropdown.d.ts +33 -0
  89. package/_dist/components/navigation/UserMenu/UserMenu.d.ts +69 -0
  90. package/_dist/components/navigation/WorkspaceSelector/WorkspaceSelector.d.ts +80 -0
  91. package/_dist/components/navigation/navigation-types.d.ts +29 -0
  92. package/_dist/components/navigation/navigation-utilities.d.ts +7 -0
  93. package/_dist/components/notifications/Banner/Banner.d.ts +47 -0
  94. package/_dist/components/notifications/InlineMessage/InlineMessage.d.ts +37 -0
  95. package/_dist/components/notifications/SectionMessage/SectionMessage.d.ts +47 -0
  96. package/_dist/components/notifications/Toaster/Toast.d.ts +46 -0
  97. package/_dist/components/notifications/Toaster/Toaster.d.ts +29 -0
  98. package/_dist/components/notifications/Toaster/useToast.d.ts +13 -0
  99. package/_dist/components/panels/ExpansionPanel/ExpansionPanel.d.ts +32 -0
  100. package/_dist/components/panels/ExpansionPanelGroup/ExpansionPanelGroup.d.ts +24 -0
  101. package/_dist/components/panels/Panel/Panel.d.ts +35 -0
  102. package/_dist/components/panels/PanelList/PanelList.d.ts +28 -0
  103. package/_dist/components/panels/PanelList/PanelRow.d.ts +19 -0
  104. package/_dist/components/progress-indicators/ProgressBar/ProgressBar.d.ts +53 -0
  105. package/_dist/components/progress-indicators/ProgressRing/ProgressRing.d.ts +41 -0
  106. package/_dist/components/progress-indicators/Spinner/Spinner.d.ts +32 -0
  107. package/_dist/components/tiles/AvatarTileList/AvatarTileList.d.ts +28 -0
  108. package/_dist/components/tiles/Tile/Tile.d.ts +42 -0
  109. package/_dist/components/tiles/TileGrid/TileGrid.d.ts +29 -0
  110. package/_dist/css/component-css/pds-avatar-tile-list.css +1 -0
  111. package/_dist/css/component-css/pds-avatar.css +1 -0
  112. package/_dist/css/component-css/pds-banner.css +1 -0
  113. package/_dist/css/component-css/pds-branch-diff.css +1 -0
  114. package/_dist/css/component-css/pds-breadcrumb.css +1 -0
  115. package/_dist/css/component-css/pds-button-link.css +1 -0
  116. package/_dist/css/component-css/pds-button.css +81 -0
  117. package/_dist/css/component-css/pds-callout.css +1 -0
  118. package/_dist/css/component-css/pds-card-heading.css +1 -0
  119. package/_dist/css/component-css/pds-card-select-group.css +1 -0
  120. package/_dist/css/component-css/pds-card.css +1 -0
  121. package/_dist/css/component-css/pds-checkbox-group.css +1 -0
  122. package/_dist/css/component-css/pds-checkbox.css +1 -0
  123. package/_dist/css/component-css/pds-clipboard-button.css +0 -0
  124. package/_dist/css/component-css/pds-code-block.css +1 -0
  125. package/_dist/css/component-css/pds-combobox.css +1 -0
  126. package/_dist/css/component-css/pds-comparison-list.css +1 -0
  127. package/_dist/css/component-css/pds-cta-link.css +1 -0
  128. package/_dist/css/component-css/pds-cta-slice.css +1 -0
  129. package/_dist/css/component-css/pds-dashboard-nav.css +5 -0
  130. package/_dist/css/component-css/pds-dashboard-search.css +1 -0
  131. package/_dist/css/component-css/pds-dashboard-stat.css +1 -0
  132. package/_dist/css/component-css/pds-dropdown-menu.css +2 -0
  133. package/_dist/css/component-css/pds-expansion-panel-group.css +1 -0
  134. package/_dist/css/component-css/pds-expansion-panel.css +1 -0
  135. package/_dist/css/component-css/pds-file-diff.css +1 -0
  136. package/_dist/css/component-css/pds-file-upload.css +7 -0
  137. package/_dist/css/component-css/pds-flow-steps.css +1 -0
  138. package/_dist/css/component-css/pds-footer-heading.css +1 -0
  139. package/_dist/css/component-css/pds-footer-links.css +1 -0
  140. package/_dist/css/component-css/pds-icon-button.css +13 -0
  141. package/_dist/css/component-css/pds-icon-story-only.css +1 -0
  142. package/_dist/css/component-css/pds-index.css +150 -0
  143. package/_dist/css/component-css/pds-indicator-badge.css +39 -0
  144. package/_dist/css/component-css/pds-inline-message.css +1 -0
  145. package/_dist/css/component-css/pds-input-group.css +1 -0
  146. package/_dist/css/component-css/pds-input-utilities.css +1 -0
  147. package/_dist/css/component-css/pds-link-new-window.css +1 -0
  148. package/_dist/css/component-css/pds-links-card.css +1 -0
  149. package/_dist/css/component-css/pds-menu-button.css +1 -0
  150. package/_dist/css/component-css/pds-modal.css +1 -0
  151. package/_dist/css/component-css/pds-nav-menu.css +5 -0
  152. package/_dist/css/component-css/pds-navbar.css +1 -0
  153. package/_dist/css/component-css/pds-new-site-card.css +1 -0
  154. package/_dist/css/component-css/pds-pagination.css +1 -0
  155. package/_dist/css/component-css/pds-panel-list.css +1 -0
  156. package/_dist/css/component-css/pds-panel.css +1 -0
  157. package/_dist/css/component-css/pds-pantheon-logo.css +1 -0
  158. package/_dist/css/component-css/pds-platform-icon.css +1 -0
  159. package/_dist/css/component-css/pds-popover.css +1 -0
  160. package/_dist/css/component-css/pds-pricing-card-local.css +1 -0
  161. package/_dist/css/component-css/pds-pricing-card.css +1 -0
  162. package/_dist/css/component-css/pds-progress-bar.css +1 -0
  163. package/_dist/css/component-css/pds-progress-ring.css +1 -0
  164. package/_dist/css/component-css/pds-pull-quote.css +1 -0
  165. package/_dist/css/component-css/pds-radio-group.css +1 -0
  166. package/_dist/css/component-css/pds-refresh-checker.css +1 -0
  167. package/_dist/css/component-css/pds-section-message.css +1 -0
  168. package/_dist/css/component-css/pds-segmented-button.css +1 -0
  169. package/_dist/css/component-css/pds-select.css +1 -0
  170. package/_dist/css/component-css/pds-side-nav-compact.css +1 -0
  171. package/_dist/css/component-css/pds-side-nav.css +1 -0
  172. package/_dist/css/component-css/pds-site-card.css +1 -0
  173. package/_dist/css/component-css/pds-site-dashboard-heading.css +1 -0
  174. package/_dist/css/component-css/pds-site-footer.css +1 -0
  175. package/_dist/css/component-css/pds-skiplink.css +1 -0
  176. package/_dist/css/component-css/pds-social-links.css +1 -0
  177. package/_dist/css/component-css/pds-spinner.css +1 -0
  178. package/_dist/css/component-css/pds-split-button.css +2 -0
  179. package/_dist/css/component-css/pds-status-badge.css +1 -0
  180. package/_dist/css/component-css/pds-status-indicator.css +1 -0
  181. package/_dist/css/component-css/pds-stepper.css +1 -0
  182. package/_dist/css/component-css/pds-switch.css +3 -0
  183. package/_dist/css/component-css/pds-tab-menu.css +2 -0
  184. package/_dist/css/component-css/pds-table-of-contents.css +1 -0
  185. package/_dist/css/component-css/pds-table.css +1 -0
  186. package/_dist/css/component-css/pds-tabs.css +1 -0
  187. package/_dist/css/component-css/pds-tag.css +1 -0
  188. package/_dist/css/component-css/pds-tally.css +1 -0
  189. package/_dist/css/component-css/pds-text-input.css +1 -0
  190. package/_dist/css/component-css/pds-textarea.css +1 -0
  191. package/_dist/css/component-css/pds-tile.css +1 -0
  192. package/_dist/css/component-css/pds-tiles-common.css +1 -0
  193. package/_dist/css/component-css/pds-toaster.css +1 -0
  194. package/_dist/css/component-css/pds-tooltip.css +1 -0
  195. package/_dist/css/component-css/pds-user-menu-story-only.css +1 -0
  196. package/_dist/css/component-css/pds-user-menu.css +1 -0
  197. package/_dist/css/component-css/pds-utility-button.css +1 -0
  198. package/_dist/css/component-css/pds-workspace-selector.css +1 -0
  199. package/_dist/css/design-tokens/pds-design-tokens-dark-mode.css +206 -0
  200. package/_dist/css/design-tokens/pds-design-tokens-light-mode.css +301 -0
  201. package/_dist/css/design-tokens/pds-design-tokens.css +130 -0
  202. package/_dist/css/pds-components.css +150 -0
  203. package/_dist/css/pds-core.css +6 -2
  204. package/_dist/css/pds-layouts.css +8 -0
  205. package/_dist/index.css +1 -0
  206. package/_dist/index.d.ts +103 -0
  207. package/_dist/index.js +10097 -0
  208. package/_dist/index.js.map +1 -0
  209. package/_dist/layouts/Container/Container.d.ts +25 -0
  210. package/_dist/layouts/DashboardGlobal/DashboardGlobal.d.ts +57 -0
  211. package/_dist/layouts/DashboardInner/DashboardInner.d.ts +20 -0
  212. package/_dist/layouts/FlexContainer/FlexContainer.d.ts +72 -0
  213. package/_dist/layouts/GlobalWrapper/GlobalWrapper.d.ts +19 -0
  214. package/_dist/layouts/SidebarLayout/SidebarLayout.d.ts +36 -0
  215. package/_dist/layouts/StepperLayout/StepperLayout.d.ts +20 -0
  216. package/_dist/layouts/ThreeItemLayout/ThreeItemLayout.d.ts +30 -0
  217. package/_dist/layouts/TwoItemLayout/TwoItemLayout.d.ts +34 -0
  218. package/_dist/layouts/layout-types.d.ts +2 -0
  219. package/_dist/libs/components/utility-components.d.ts +15 -0
  220. package/_dist/libs/components/utils.d.ts +4 -0
  221. package/_dist/libs/types/custom-types.d.ts +103 -0
  222. package/_dist/mocks/data/navigation-items.d.ts +382 -0
  223. package/_dist/mocks/data/pagination-items.d.ts +16 -0
  224. package/_dist/mocks/markup/dashboard-main-content.d.ts +10 -0
  225. package/_dist/mocks/markup/dashboard-navigation.d.ts +11 -0
  226. package/_dist/mocks/markup/inputs.d.ts +2 -0
  227. package/_dist/mocks/markup/modal.d.ts +2 -0
  228. package/_dist/mocks/markup/panel-row-content.d.ts +7 -0
  229. package/_dist/utilities/context-providers/ResponsiveContext/ResponsiveContext.d.ts +6 -0
  230. package/_dist/utilities/hooks/useClipboard.d.ts +6 -0
  231. package/_dist/utilities/hooks/useWindowWidth.d.ts +1 -0
  232. package/_dist/vars/spacing.d.ts +17 -0
  233. package/_dist/vars/z-index.d.ts +5 -0
  234. package/package.json +91 -44
  235. package/_dist/cjs/index.js +0 -98
  236. package/_dist/cjs/index.js.map +0 -1
  237. package/_dist/esm/index.js +0 -98
  238. package/_dist/esm/index.js.map +0 -1
@@ -0,0 +1,89 @@
1
+ import React, { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ import { ValidationStatus } from '../input-types';
3
+ import './file-upload.css';
4
+ type LabelStrings = {
5
+ chooseFile: string;
6
+ clearButton: string;
7
+ };
8
+ /**
9
+ * Prop types for FileUpload
10
+ */
11
+ export interface FileUploadProps extends ComponentPropsWithoutRef<'div'> {
12
+ /**
13
+ * File types the input should accept. Leave null for all file types.
14
+ */
15
+ accept?: string;
16
+ /**
17
+ * Default value for the input field as a string that represents the path to a file.
18
+ */
19
+ defaultValue?: string;
20
+ /**
21
+ * Is the field disabled?
22
+ */
23
+ disabled?: boolean;
24
+ /**
25
+ * Label to be rendered above the input field. Describes the fields purpose. Optional.
26
+ */
27
+ fieldLabel?: string;
28
+ /**
29
+ * Input ID.
30
+ */
31
+ id: string;
32
+ /**
33
+ * Additional props for the `<input>` element.
34
+ */
35
+ inputProps?: ComponentPropsWithoutRef<'input'>;
36
+ /**
37
+ * Width of the input field. Accepts a number in pixels. Leave blank for width: 100%.
38
+ */
39
+ inputWidth?: number;
40
+ /**
41
+ * Translation strings for various labels or other visually-hidden text.
42
+ */
43
+ labelStrings?: LabelStrings;
44
+ /**
45
+ * Message or description used to help clarify the usage of the input.
46
+ */
47
+ message?: string | ReactNode;
48
+ /**
49
+ * Should the input accept multiple files?
50
+ */
51
+ multiple?: boolean;
52
+ /**
53
+ * Callback function that will run when the clear button is clicked.
54
+ */
55
+ onClear?: () => void;
56
+ /**
57
+ * Callback function that will run when the file input changes.
58
+ */
59
+ onFileChange?: (files: FileList) => void;
60
+ /**
61
+ * Is the field required?
62
+ */
63
+ required?: boolean;
64
+ /**
65
+ * Should the full path of the file be displayed for the default value?
66
+ */
67
+ showFullPath?: boolean;
68
+ /**
69
+ * Should the label be visible? If false, it will render for screen readers only.
70
+ */
71
+ showLabel?: boolean;
72
+ /**
73
+ * Validation message for the input field based on the validation status.
74
+ */
75
+ validationMessage?: string;
76
+ /**
77
+ * Validation status of the input field.
78
+ */
79
+ validationStatus?: ValidationStatus;
80
+ /**
81
+ * Additional class names
82
+ */
83
+ className?: string;
84
+ }
85
+ /**
86
+ * FileUpload UI component
87
+ */
88
+ export declare const FileUpload: React.ForwardRefExoticComponent<FileUploadProps & React.RefAttributes<HTMLInputElement>>;
89
+ export {};
@@ -0,0 +1,19 @@
1
+ import React, { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ import './input-group.css';
3
+ /**
4
+ * Prop types for InputGroup
5
+ */
6
+ export interface InputGroupProps extends ComponentPropsWithoutRef<'div'> {
7
+ /**
8
+ * Input and button elements
9
+ */
10
+ children: ReactNode;
11
+ /**
12
+ * Additional class names
13
+ */
14
+ className?: string;
15
+ }
16
+ /**
17
+ * InputGroup UI component
18
+ */
19
+ export declare const InputGroup: ({ children, className, ...props }: InputGroupProps) => React.JSX.Element;
@@ -0,0 +1,100 @@
1
+ import React, { ChangeEvent, ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ import { ValidationStatus } from '../input-types';
3
+ import './radio-group.css';
4
+ export interface RadioOption {
5
+ /**
6
+ * Option is disabled
7
+ * @default false
8
+ */
9
+ disabled?: boolean;
10
+ /**
11
+ * Unique ID for the option
12
+ * @default ''
13
+ */
14
+ id?: string;
15
+ /**
16
+ * Option label
17
+ */
18
+ label: string | ReactNode;
19
+ /**
20
+ * Option value
21
+ */
22
+ value: string;
23
+ }
24
+ export interface RadioGroupProps extends ComponentPropsWithoutRef<'div'> {
25
+ /**
26
+ * Optional default value
27
+ */
28
+ defaultValue?: string;
29
+ /**
30
+ * Additional props for the `<fieldset>` element.
31
+ */
32
+ fieldsetProps?: ComponentPropsWithoutRef<'fieldset'>;
33
+ /**
34
+ * is the radio group disabled
35
+ * @default false
36
+ */
37
+ disabled?: boolean;
38
+ /**
39
+ * Unique ID for the radio group
40
+ */
41
+ id: string;
42
+ /**
43
+ * Input width in rem
44
+ */
45
+ inputWidth?: number;
46
+ /**
47
+ * Label for the radio group
48
+ */
49
+ label: string;
50
+ /**
51
+ * Input message
52
+ */
53
+ message?: string | ReactNode;
54
+ /**
55
+ * Callback function that will return the updated value from the instance when it changes.
56
+ */
57
+ onBlur?: (event: React.FocusEvent<HTMLDivElement>) => void;
58
+ /**
59
+ * onChange event handler. Controlled inputs should use this to manage the input value. Uncontrolled inputs will manage their own state, but may still use this to access the event object.
60
+ */
61
+ onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
62
+ /**
63
+ * Callback function that will return the updated value from the instance when it changes.
64
+ */
65
+ onValueChange?: (value: string) => void;
66
+ /**
67
+ * Array of radio options
68
+ */
69
+ options: RadioOption[];
70
+ /**
71
+ * Is the radio group required
72
+ * @default false
73
+ */
74
+ required?: boolean;
75
+ /**
76
+ * Show the label
77
+ * @default true
78
+ */
79
+ showLabel?: boolean;
80
+ /**
81
+ * Validation message
82
+ */
83
+ validationMessage?: string;
84
+ /**
85
+ * Validation status of the input field.
86
+ */
87
+ validationStatus?: ValidationStatus;
88
+ /**
89
+ * Value of the radio group. Used to set the value of the field when controlled. Cannot be used in conjunction with the `defaultValue` prop.
90
+ */
91
+ value?: string;
92
+ /**
93
+ * Additional class names
94
+ */
95
+ className?: string;
96
+ }
97
+ /**
98
+ * RadioGroup UI component
99
+ */
100
+ export declare const RadioGroup: ({ defaultValue, disabled, fieldsetProps, id, inputWidth, label, message, onBlur, onChange, onValueChange, options, required, showLabel, validationMessage, validationStatus, value, className, ...props }: RadioGroupProps) => React.JSX.Element;
@@ -0,0 +1,118 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { ValidationStatus } from '../input-types';
3
+ import './select.css';
4
+ type LabelStrings = {
5
+ selectOptionText: string;
6
+ triggerButton: string;
7
+ };
8
+ export type SelectOptionType = {
9
+ /**
10
+ * Option label.
11
+ */
12
+ label: string;
13
+ /**
14
+ * Option value.
15
+ */
16
+ value: string;
17
+ /**
18
+ * Option disabled.
19
+ */
20
+ disabled?: boolean;
21
+ };
22
+ export type SelectOptionGroupType = {
23
+ /**
24
+ * Group label.
25
+ */
26
+ groupLabel: string;
27
+ /**
28
+ * Options within this group.
29
+ */
30
+ options: SelectOptionType[];
31
+ };
32
+ export type SelectOptionsType = (SelectOptionType | SelectOptionGroupType)[];
33
+ interface SelectOptionGroupProps {
34
+ label: string;
35
+ children: ReactNode;
36
+ }
37
+ /**
38
+ * Prop types for Select
39
+ */
40
+ export interface SelectProps {
41
+ /**
42
+ * Optional default value for the field. Must match the value of one of the options. Cannot be used in conjunction with the `value` prop.
43
+ */
44
+ defaultValue?: string;
45
+ /**
46
+ * Is the field disabled?
47
+ */
48
+ disabled?: boolean;
49
+ /**
50
+ * Input ID.
51
+ */
52
+ id: string;
53
+ /**
54
+ * Width of the input field. Accepts a number in pixels. Leave blank for width: 100%.
55
+ */
56
+ inputWidth?: number;
57
+ /**
58
+ * Field label.
59
+ */
60
+ label: string;
61
+ /**
62
+ * Translation strings for various labels or other visually-hidden text.
63
+ */
64
+ labelStrings?: LabelStrings;
65
+ /**
66
+ * Message or description used to help clarify the usage of the input.
67
+ */
68
+ message?: string | ReactNode;
69
+ /**
70
+ * onBlur event handler to provide the current value of the input.
71
+ */
72
+ onBlur?: (currentValue: string) => void;
73
+ /**
74
+ * onFocus event handler to provide the current value of the input.
75
+ */
76
+ onFocus?: (currentValue: string) => void;
77
+ /**
78
+ * Callback function when an option is selected.
79
+ */
80
+ onOptionSelect?: (option: SelectOptionType) => void;
81
+ /**
82
+ * Array of options for the select field.
83
+ */
84
+ options?: SelectOptionsType;
85
+ /**
86
+ * Is this field required?
87
+ */
88
+ required?: boolean;
89
+ /**
90
+ * Should the label be visible? If false, it will render for screen readers only.
91
+ */
92
+ showLabel?: boolean;
93
+ /**
94
+ * Validation message for the input field based on the validation status.
95
+ */
96
+ validationMessage?: string;
97
+ /**
98
+ * Validation status of the input field.
99
+ */
100
+ validationStatus?: ValidationStatus;
101
+ /**
102
+ * Value of the field. Must match the value of one of the options. Used to set the value of the field when controlled. Cannot be used in conjunction with the `defaultValue` prop.
103
+ */
104
+ value?: string;
105
+ /**
106
+ * Additional class names
107
+ */
108
+ className?: string;
109
+ }
110
+ /**
111
+ * SelectOptionGroup component
112
+ */
113
+ export declare const SelectOptionGroup: ({ label, children, }: SelectOptionGroupProps) => React.JSX.Element;
114
+ /**
115
+ * Select UI component
116
+ */
117
+ export declare const Select: ({ defaultValue, disabled, id, inputWidth, label, labelStrings, message, onBlur, onFocus, onOptionSelect, options, required, showLabel, validationMessage, validationStatus, value, className, ...props }: SelectProps) => React.JSX.Element;
118
+ export {};
@@ -0,0 +1,74 @@
1
+ import React, { ChangeEvent, ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ import './switch.css';
3
+ type SwitchPlacement = 'right' | 'below';
4
+ /**
5
+ * Prop types for Switch
6
+ */
7
+ export interface SwitchProps extends ComponentPropsWithoutRef<'div'> {
8
+ /**
9
+ * Is the field checked?
10
+ */
11
+ checked?: boolean;
12
+ /**
13
+ * Initial value for the input field. Only valid if the input is uncontrolled. Cannot be used in conjunction with the `checked` prop.
14
+ */
15
+ defaultChecked?: boolean;
16
+ /**
17
+ * Is the field disabled?
18
+ */
19
+ disabled?: boolean;
20
+ /**
21
+ * Input ID.
22
+ */
23
+ id: string;
24
+ /**
25
+ * Additional props for the `<input>` element.
26
+ */
27
+ inputProps?: ComponentPropsWithoutRef<'input'>;
28
+ /**
29
+ * Width of the input field. Accepts a number in pixels. Leave blank for width: 100%.
30
+ */
31
+ inputWidth?: number;
32
+ /**
33
+ * Label of the switch field.
34
+ */
35
+ label: string;
36
+ /**
37
+ * Message or description used to help clarify the usage of the input.
38
+ */
39
+ message?: string | ReactNode;
40
+ /**
41
+ * Status text for when switch is off.
42
+ */
43
+ offLabel?: string;
44
+ /**
45
+ * onChange event handler. Controlled inputs should use this to manage the input value. Uncontrolled inputs will manage their own state, but may still use this to access the event object.
46
+ */
47
+ onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
48
+ /**
49
+ * Status text for when switch is on.
50
+ */
51
+ onLabel?: string;
52
+ /**
53
+ * Is this field required?
54
+ */
55
+ required?: boolean;
56
+ /**
57
+ * Should the label be visible? If false, it will render for screen readers only.
58
+ */
59
+ showLabel?: boolean;
60
+ /**
61
+ * Show toggle status label next to switch. If false, icons will render and the text will still be available to screen readers.
62
+ */
63
+ showStatusLabel?: boolean;
64
+ /**
65
+ * Determines switch placement, default set to `right`.
66
+ */
67
+ switchPlacement?: SwitchPlacement;
68
+ /**
69
+ * Additional class names for input.
70
+ */
71
+ className?: string;
72
+ }
73
+ export declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLInputElement>>;
74
+ export {};
@@ -0,0 +1,131 @@
1
+ import React, { ComponentPropsWithoutRef, ChangeEvent, FocusEvent, ReactNode } from 'react';
2
+ import { ValidationStatus } from '../input-types';
3
+ import './text-input.css';
4
+ type TranslationStringProps = {
5
+ clearButton: string;
6
+ counterOverLimit?: string;
7
+ searchShortcut: string;
8
+ visibilityStatus: string;
9
+ visibilityToggleHide: string;
10
+ visibilityToggleShow: string;
11
+ };
12
+ type HtmlInputTypes = 'text' | 'number' | 'email' | 'password' | 'tel' | 'url' | 'search';
13
+ /**
14
+ * Prop types for TextInput
15
+ */
16
+ export interface TextInputProps extends ComponentPropsWithoutRef<'div'> {
17
+ /**
18
+ * Auto complete attribute for the input field. The attribute value is either the keyword `off` or `on`, or an ordered list of space-separated tokens. Password fields are automatically off.
19
+ */
20
+ autoComplete?: string;
21
+ /**
22
+ * Maximum character count for the character counter. Leave blank for no counter. Not valid for type `password`.
23
+ */
24
+ counterMaxLength?: number;
25
+ /**
26
+ * Initial value for the input field. Setting this prop automatically makes the input uncontrolled. Cannot be used in conjunction with the `value` prop.
27
+ */
28
+ defaultValue?: string;
29
+ /**
30
+ * Is the field disabled?
31
+ */
32
+ disabled?: boolean;
33
+ /**
34
+ * Does the input contain a clear button?
35
+ */
36
+ hasClearButton?: boolean;
37
+ /**
38
+ * Does the input contain the search shortcut?
39
+ * Only valid if the input type is `search`.
40
+ */
41
+ hasSearchShortcut?: boolean;
42
+ /**
43
+ * Input ID.
44
+ */
45
+ id: string;
46
+ /**
47
+ * Additional props for the `<input>` element.
48
+ */
49
+ inputProps?: ComponentPropsWithoutRef<'input'>;
50
+ /**
51
+ * Width of the input field. Accepts a number in pixels. Leave blank for width: 100%.
52
+ */
53
+ inputWidth?: number;
54
+ /**
55
+ * Input label.
56
+ */
57
+ label: string;
58
+ /**
59
+ * Input message. Used to provide supplemental text. Will be displayed below the input field.
60
+ */
61
+ message?: string | ReactNode;
62
+ /**
63
+ * onBlur event handler.
64
+ */
65
+ onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
66
+ /**
67
+ * onChange event handler. Controlled inputs should use this to manage the input value. Uncontrolled inputs will manage their own state, but may still use this to access the event object.
68
+ */
69
+ onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
70
+ /**
71
+ * Function to clear the input field. Only necessary if the input is controlled. This functionality is built-in for uncontrolled inputs.
72
+ */
73
+ onClear?: () => void;
74
+ /**
75
+ * onFocus event handler.
76
+ */
77
+ onFocus?: (e: FocusEvent<HTMLInputElement>) => void;
78
+ /**
79
+ * Optional placeholder text to display when the input field is empty.
80
+ */
81
+ placeholder?: string;
82
+ /**
83
+ * Is the field read-only?
84
+ */
85
+ readonly?: boolean;
86
+ /**
87
+ * Is this field required?
88
+ */
89
+ required?: boolean;
90
+ /**
91
+ * Icon to use when type is search.
92
+ */
93
+ searchIcon?: 'search' | 'filter';
94
+ /**
95
+ * Should the label be visible? If false, it will render for screen readers only.
96
+ */
97
+ showLabel?: boolean;
98
+ /**
99
+ * Show Toggle visibility control for input. Valid for type `password` only.
100
+ */
101
+ showVisibilityToggle?: boolean;
102
+ /**
103
+ * Translation strings for various labels or other visually-hidden text.
104
+ */
105
+ translationStrings?: TranslationStringProps;
106
+ /**
107
+ * Type of input field to use.
108
+ */
109
+ type?: HtmlInputTypes;
110
+ /**
111
+ * Validation message for the input field based on the validation status.
112
+ */
113
+ validationMessage?: string;
114
+ /**
115
+ * Validation status of the input field.
116
+ */
117
+ validationStatus?: ValidationStatus;
118
+ /**
119
+ * Value of the input field. Used to set the value of the input field when controlled. Cannot be used in conjunction with the `defaultValue` prop.
120
+ */
121
+ value?: string;
122
+ /**
123
+ * Additional class names for input.
124
+ */
125
+ className?: string;
126
+ }
127
+ /**
128
+ * TextInput UI component
129
+ */
130
+ export declare const TextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<HTMLInputElement>>;
131
+ export {};
@@ -0,0 +1,106 @@
1
+ import React, { ComponentPropsWithoutRef, FocusEvent, ReactNode } from 'react';
2
+ import { ValidationStatus } from '../input-types';
3
+ import './textarea.css';
4
+ export type TranslationStringProps = {
5
+ clearButton: string;
6
+ counterOverLimit?: string;
7
+ searchShortcut: string;
8
+ visibilityStatus: string;
9
+ visibilityToggleHide: string;
10
+ visibilityToggleShow: string;
11
+ };
12
+ export interface TextareaProps {
13
+ /**
14
+ * Maximum character count for the character counter. Leave blank for no counter.
15
+ */
16
+ counterMaxLength?: number;
17
+ /**
18
+ * Initial value for the input field. Setting this prop automatically makes the input uncontrolled. Cannot be used in conjunction with the `value` prop.
19
+ */
20
+ defaultValue?: string;
21
+ /**
22
+ * Is the field disabled?
23
+ */
24
+ disabled?: boolean;
25
+ /**
26
+ * ID of the textarea.
27
+ */
28
+ id: string;
29
+ /**
30
+ * Should the textarea be resizable by the user?
31
+ */
32
+ isResizable?: boolean;
33
+ /**
34
+ * Width of the input field. Accepts a number in pixels. Leave blank for width: 100%.
35
+ */
36
+ inputWidth?: number;
37
+ /**
38
+ * Text label associated with the input field.
39
+ */
40
+ label: string;
41
+ /**
42
+ * Message or description used to help clarify the usage of the input.
43
+ */
44
+ message?: string | ReactNode;
45
+ /**
46
+ * onBlur event handler.
47
+ */
48
+ onBlur?: (e: FocusEvent<HTMLTextAreaElement>) => void;
49
+ /**
50
+ * Function to help lift the state and retrieve the input's value.
51
+ * Should accept one argument, the input's value
52
+ */
53
+ onChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;
54
+ /**
55
+ * onFocus event handler.
56
+ */
57
+ onFocus?: (e: FocusEvent<HTMLTextAreaElement>) => void;
58
+ /**
59
+ * Optional placeholder text to display when the input field is empty.
60
+ */
61
+ placeholder?: string;
62
+ /**
63
+ * Is the field read-only?
64
+ */
65
+ readonly?: boolean;
66
+ /**
67
+ * Is the field required?
68
+ */
69
+ required?: boolean;
70
+ /**
71
+ * Rows value to be given to the textarea type.
72
+ */
73
+ rows?: number;
74
+ /**
75
+ * Should the label be visible? If false, it will render for screen readers only.
76
+ */
77
+ showLabel?: boolean;
78
+ /**
79
+ * Additional props for the `<textarea>` element.
80
+ */
81
+ textareaProps?: ComponentPropsWithoutRef<'textarea'>;
82
+ /**
83
+ * Translation strings for various labels or other visually-hidden text.
84
+ */
85
+ translationStrings?: TranslationStringProps;
86
+ /**
87
+ * Validation message for the textarea field based on the validation status.
88
+ */
89
+ validationMessage?: string;
90
+ /**
91
+ * Validation status of the textarea field.
92
+ */
93
+ validationStatus?: ValidationStatus;
94
+ /**
95
+ * Value of the textarea field. Used to set the value of the textarea field when controlled. Cannot be used in conjunction with the `defaultValue` prop.
96
+ */
97
+ value?: string;
98
+ /**
99
+ * Additional class names
100
+ */
101
+ className?: string;
102
+ }
103
+ /**
104
+ * Textarea UI component
105
+ */
106
+ export declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
@@ -0,0 +1 @@
1
+ export type ValidationStatus = 'success' | 'error';