@workday/canvas-kit-labs-react 6.0.0-beta.0-next.15 → 6.0.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.
Files changed (233) hide show
  1. package/combobox/lib/AutocompleteList.tsx +5 -2
  2. package/combobox/lib/Combobox.tsx +0 -1
  3. package/common/lib/theming/index.ts +1 -0
  4. package/common/lib/theming/useThemedRing.ts +84 -0
  5. package/dist/commonjs/combobox/lib/AutocompleteList.d.ts.map +1 -1
  6. package/dist/commonjs/combobox/lib/AutocompleteList.js +5 -2
  7. package/dist/commonjs/combobox/lib/Combobox.d.ts.map +1 -1
  8. package/dist/commonjs/combobox/lib/Combobox.js +0 -1
  9. package/dist/commonjs/common/lib/theming/index.d.ts +1 -0
  10. package/dist/commonjs/common/lib/theming/index.d.ts.map +1 -1
  11. package/dist/commonjs/common/lib/theming/index.js +1 -0
  12. package/dist/commonjs/common/lib/theming/useThemedRing.d.ts +11 -0
  13. package/dist/commonjs/common/lib/theming/useThemedRing.d.ts.map +1 -0
  14. package/dist/commonjs/common/lib/theming/useThemedRing.js +61 -0
  15. package/dist/commonjs/header/index.d.ts +5 -5
  16. package/dist/commonjs/header/index.d.ts.map +1 -1
  17. package/dist/commonjs/header/index.js +2 -2
  18. package/dist/commonjs/header/lib/GlobalHeader.d.ts +11 -2
  19. package/dist/commonjs/header/lib/GlobalHeader.d.ts.map +1 -1
  20. package/dist/commonjs/header/lib/GlobalHeader.js +19 -8
  21. package/dist/commonjs/header/lib/Header.d.ts +17 -8
  22. package/dist/commonjs/header/lib/Header.d.ts.map +1 -1
  23. package/dist/commonjs/header/lib/Header.js +27 -14
  24. package/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts +13 -4
  25. package/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts.map +1 -1
  26. package/dist/commonjs/header/lib/parts/DubLogoTitle.js +22 -11
  27. package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts +14 -5
  28. package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts.map +1 -1
  29. package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.js +25 -12
  30. package/dist/commonjs/header/lib/parts/index.d.ts +2 -3
  31. package/dist/commonjs/header/lib/parts/index.d.ts.map +1 -1
  32. package/dist/commonjs/header/lib/parts/index.js +2 -4
  33. package/dist/commonjs/header/lib/shared/themes.d.ts +28 -19
  34. package/dist/commonjs/header/lib/shared/themes.d.ts.map +1 -1
  35. package/dist/commonjs/header/lib/shared/themes.js +13 -36
  36. package/dist/commonjs/header/lib/shared/types.d.ts +3 -8
  37. package/dist/commonjs/header/lib/shared/types.d.ts.map +1 -1
  38. package/dist/commonjs/header/lib/shared/types.js +17 -23
  39. package/dist/commonjs/index.d.ts +2 -0
  40. package/dist/commonjs/index.d.ts.map +1 -1
  41. package/dist/commonjs/index.js +2 -0
  42. package/dist/commonjs/layout/lib/utils/getValidChildren.d.ts +1 -1
  43. package/dist/commonjs/layout/lib/utils/getValidChildren.d.ts.map +1 -1
  44. package/dist/commonjs/search-form/index.d.ts +3 -0
  45. package/dist/commonjs/search-form/index.d.ts.map +1 -0
  46. package/dist/commonjs/search-form/index.js +7 -0
  47. package/dist/commonjs/{header/lib/parts/SearchBar.d.ts → search-form/lib/SearchForm.d.ts} +22 -23
  48. package/dist/commonjs/search-form/lib/SearchForm.d.ts.map +1 -0
  49. package/dist/commonjs/{header/lib/parts/SearchBar.js → search-form/lib/SearchForm.js} +13 -14
  50. package/dist/commonjs/search-form/lib/themes.d.ts +21 -0
  51. package/dist/commonjs/search-form/lib/themes.d.ts.map +1 -0
  52. package/dist/commonjs/search-form/lib/themes.js +41 -0
  53. package/dist/commonjs/text-input/index.d.ts +7 -0
  54. package/dist/commonjs/text-input/index.d.ts.map +1 -0
  55. package/dist/commonjs/text-input/index.js +11 -0
  56. package/dist/commonjs/text-input/lib/TextInput.d.ts +21 -0
  57. package/dist/commonjs/text-input/lib/TextInput.d.ts.map +1 -0
  58. package/dist/commonjs/text-input/lib/TextInput.js +36 -0
  59. package/dist/commonjs/text-input/lib/TextInputField.d.ts +8 -0
  60. package/dist/commonjs/text-input/lib/TextInputField.d.ts.map +1 -0
  61. package/dist/commonjs/text-input/lib/TextInputField.js +66 -0
  62. package/dist/commonjs/text-input/lib/TextInputHint.d.ts +13 -0
  63. package/dist/commonjs/text-input/lib/TextInputHint.d.ts.map +1 -0
  64. package/dist/commonjs/text-input/lib/TextInputHint.js +46 -0
  65. package/dist/commonjs/text-input/lib/TextInputLabel.d.ts +17 -0
  66. package/dist/commonjs/text-input/lib/TextInputLabel.d.ts.map +1 -0
  67. package/dist/commonjs/text-input/lib/TextInputLabel.js +54 -0
  68. package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts +19 -0
  69. package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts.map +1 -0
  70. package/dist/commonjs/text-input/lib/hooks/useTextInputField.js +16 -0
  71. package/dist/commonjs/text-input/lib/hooks/useTextInputHint.d.ts +15 -0
  72. package/dist/commonjs/text-input/lib/hooks/useTextInputHint.d.ts.map +1 -0
  73. package/dist/commonjs/text-input/lib/hooks/useTextInputHint.js +12 -0
  74. package/dist/commonjs/text-input/lib/hooks/useTextInputLabel.d.ts +15 -0
  75. package/dist/commonjs/text-input/lib/hooks/useTextInputLabel.d.ts.map +1 -0
  76. package/dist/commonjs/text-input/lib/hooks/useTextInputLabel.js +12 -0
  77. package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts +17 -0
  78. package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -0
  79. package/dist/commonjs/text-input/lib/hooks/useTextInputModel.js +23 -0
  80. package/dist/es6/combobox/lib/AutocompleteList.d.ts.map +1 -1
  81. package/dist/es6/combobox/lib/AutocompleteList.js +5 -2
  82. package/dist/es6/combobox/lib/Combobox.d.ts.map +1 -1
  83. package/dist/es6/combobox/lib/Combobox.js +0 -1
  84. package/dist/es6/common/lib/theming/index.d.ts +1 -0
  85. package/dist/es6/common/lib/theming/index.d.ts.map +1 -1
  86. package/dist/es6/common/lib/theming/index.js +1 -0
  87. package/dist/es6/common/lib/theming/useThemedRing.d.ts +11 -0
  88. package/dist/es6/common/lib/theming/useThemedRing.d.ts.map +1 -0
  89. package/dist/es6/common/lib/theming/useThemedRing.js +55 -0
  90. package/dist/es6/header/index.d.ts +5 -5
  91. package/dist/es6/header/index.d.ts.map +1 -1
  92. package/dist/es6/header/index.js +5 -5
  93. package/dist/es6/header/lib/GlobalHeader.d.ts +11 -2
  94. package/dist/es6/header/lib/GlobalHeader.d.ts.map +1 -1
  95. package/dist/es6/header/lib/GlobalHeader.js +22 -11
  96. package/dist/es6/header/lib/Header.d.ts +17 -8
  97. package/dist/es6/header/lib/Header.d.ts.map +1 -1
  98. package/dist/es6/header/lib/Header.js +30 -17
  99. package/dist/es6/header/lib/parts/DubLogoTitle.d.ts +13 -4
  100. package/dist/es6/header/lib/parts/DubLogoTitle.d.ts.map +1 -1
  101. package/dist/es6/header/lib/parts/DubLogoTitle.js +23 -12
  102. package/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts +14 -5
  103. package/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts.map +1 -1
  104. package/dist/es6/header/lib/parts/WorkdayLogoTitle.js +26 -13
  105. package/dist/es6/header/lib/parts/index.d.ts +2 -3
  106. package/dist/es6/header/lib/parts/index.d.ts.map +1 -1
  107. package/dist/es6/header/lib/parts/index.js +2 -3
  108. package/dist/es6/header/lib/shared/themes.d.ts +28 -19
  109. package/dist/es6/header/lib/shared/themes.d.ts.map +1 -1
  110. package/dist/es6/header/lib/shared/themes.js +14 -37
  111. package/dist/es6/header/lib/shared/types.d.ts +3 -8
  112. package/dist/es6/header/lib/shared/types.d.ts.map +1 -1
  113. package/dist/es6/header/lib/shared/types.js +17 -23
  114. package/dist/es6/index.d.ts +2 -0
  115. package/dist/es6/index.d.ts.map +1 -1
  116. package/dist/es6/index.js +2 -0
  117. package/dist/es6/layout/lib/utils/getValidChildren.d.ts +1 -1
  118. package/dist/es6/layout/lib/utils/getValidChildren.d.ts.map +1 -1
  119. package/dist/es6/search-form/index.d.ts +3 -0
  120. package/dist/es6/search-form/index.d.ts.map +1 -0
  121. package/dist/es6/search-form/index.js +2 -0
  122. package/dist/es6/{header/lib/parts/SearchBar.d.ts → search-form/lib/SearchForm.d.ts} +22 -23
  123. package/dist/es6/search-form/lib/SearchForm.d.ts.map +1 -0
  124. package/dist/es6/{header/lib/parts/SearchBar.js → search-form/lib/SearchForm.js} +11 -12
  125. package/dist/es6/search-form/lib/themes.d.ts +21 -0
  126. package/dist/es6/search-form/lib/themes.d.ts.map +1 -0
  127. package/dist/es6/search-form/lib/themes.js +39 -0
  128. package/dist/es6/text-input/index.d.ts +7 -0
  129. package/dist/es6/text-input/index.d.ts.map +1 -0
  130. package/dist/es6/text-input/index.js +6 -0
  131. package/dist/es6/text-input/lib/TextInput.d.ts +21 -0
  132. package/dist/es6/text-input/lib/TextInput.d.ts.map +1 -0
  133. package/dist/es6/text-input/lib/TextInput.js +31 -0
  134. package/dist/es6/text-input/lib/TextInputField.d.ts +8 -0
  135. package/dist/es6/text-input/lib/TextInputField.d.ts.map +1 -0
  136. package/dist/es6/text-input/lib/TextInputField.js +64 -0
  137. package/dist/es6/text-input/lib/TextInputHint.d.ts +13 -0
  138. package/dist/es6/text-input/lib/TextInputHint.d.ts.map +1 -0
  139. package/dist/es6/text-input/lib/TextInputHint.js +44 -0
  140. package/dist/es6/text-input/lib/TextInputLabel.d.ts +17 -0
  141. package/dist/es6/text-input/lib/TextInputLabel.d.ts.map +1 -0
  142. package/dist/es6/text-input/lib/TextInputLabel.js +52 -0
  143. package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts +19 -0
  144. package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts.map +1 -0
  145. package/dist/es6/text-input/lib/hooks/useTextInputField.js +14 -0
  146. package/dist/es6/text-input/lib/hooks/useTextInputHint.d.ts +15 -0
  147. package/dist/es6/text-input/lib/hooks/useTextInputHint.d.ts.map +1 -0
  148. package/dist/es6/text-input/lib/hooks/useTextInputHint.js +10 -0
  149. package/dist/es6/text-input/lib/hooks/useTextInputLabel.d.ts +15 -0
  150. package/dist/es6/text-input/lib/hooks/useTextInputLabel.d.ts.map +1 -0
  151. package/dist/es6/text-input/lib/hooks/useTextInputLabel.js +10 -0
  152. package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts +17 -0
  153. package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -0
  154. package/dist/es6/text-input/lib/hooks/useTextInputModel.js +21 -0
  155. package/header/README.md +37 -181
  156. package/header/index.ts +5 -5
  157. package/header/lib/GlobalHeader.tsx +26 -9
  158. package/header/lib/Header.tsx +58 -26
  159. package/header/lib/parts/DubLogoTitle.tsx +26 -9
  160. package/header/lib/parts/WorkdayLogoTitle.tsx +40 -11
  161. package/header/lib/parts/index.ts +2 -3
  162. package/header/lib/shared/themes.tsx +32 -56
  163. package/header/lib/shared/types.tsx +3 -9
  164. package/index.ts +2 -0
  165. package/package.json +7 -5
  166. package/search-form/LICENSE +52 -0
  167. package/search-form/README.md +6 -0
  168. package/search-form/index.ts +2 -0
  169. package/{header/lib/parts/SearchBar.tsx → search-form/lib/SearchForm.tsx} +30 -31
  170. package/search-form/lib/themes.ts +54 -0
  171. package/search-form/package.json +5 -0
  172. package/text-input/LICENSE +52 -0
  173. package/text-input/README.md +11 -0
  174. package/text-input/index.ts +6 -0
  175. package/text-input/lib/TextInput.tsx +34 -0
  176. package/text-input/lib/TextInputField.tsx +75 -0
  177. package/text-input/lib/TextInputHint.tsx +52 -0
  178. package/text-input/lib/TextInputLabel.tsx +74 -0
  179. package/text-input/lib/hooks/useTextInputField.tsx +15 -0
  180. package/text-input/lib/hooks/useTextInputHint.tsx +11 -0
  181. package/text-input/lib/hooks/useTextInputLabel.tsx +11 -0
  182. package/text-input/lib/hooks/useTextInputModel.tsx +45 -0
  183. package/text-input/package.json +5 -0
  184. package/ts3.5/dist/commonjs/common/lib/theming/index.d.ts +1 -0
  185. package/ts3.5/dist/commonjs/common/lib/theming/useThemedRing.d.ts +11 -0
  186. package/ts3.5/dist/commonjs/header/index.d.ts +5 -5
  187. package/ts3.5/dist/commonjs/header/lib/GlobalHeader.d.ts +11 -2
  188. package/ts3.5/dist/commonjs/header/lib/Header.d.ts +17 -8
  189. package/ts3.5/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts +13 -4
  190. package/ts3.5/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts +14 -5
  191. package/ts3.5/dist/commonjs/header/lib/parts/index.d.ts +2 -3
  192. package/ts3.5/dist/commonjs/header/lib/shared/themes.d.ts +28 -19
  193. package/ts3.5/dist/commonjs/header/lib/shared/types.d.ts +3 -8
  194. package/ts3.5/dist/commonjs/index.d.ts +2 -0
  195. package/ts3.5/dist/commonjs/layout/lib/utils/getValidChildren.d.ts +1 -1
  196. package/ts3.5/dist/commonjs/search-form/index.d.ts +3 -0
  197. package/ts3.5/dist/commonjs/{header/lib/parts/SearchBar.d.ts → search-form/lib/SearchForm.d.ts} +22 -23
  198. package/ts3.5/dist/commonjs/search-form/lib/themes.d.ts +21 -0
  199. package/ts3.5/dist/commonjs/text-input/index.d.ts +7 -0
  200. package/ts3.5/dist/commonjs/text-input/lib/TextInput.d.ts +21 -0
  201. package/ts3.5/dist/commonjs/text-input/lib/TextInputField.d.ts +8 -0
  202. package/ts3.5/dist/commonjs/text-input/lib/TextInputHint.d.ts +13 -0
  203. package/ts3.5/dist/commonjs/text-input/lib/TextInputLabel.d.ts +17 -0
  204. package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts +19 -0
  205. package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputHint.d.ts +15 -0
  206. package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputLabel.d.ts +15 -0
  207. package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts +17 -0
  208. package/ts3.5/dist/es6/common/lib/theming/index.d.ts +1 -0
  209. package/ts3.5/dist/es6/common/lib/theming/useThemedRing.d.ts +11 -0
  210. package/ts3.5/dist/es6/header/index.d.ts +5 -5
  211. package/ts3.5/dist/es6/header/lib/GlobalHeader.d.ts +11 -2
  212. package/ts3.5/dist/es6/header/lib/Header.d.ts +17 -8
  213. package/ts3.5/dist/es6/header/lib/parts/DubLogoTitle.d.ts +13 -4
  214. package/ts3.5/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts +14 -5
  215. package/ts3.5/dist/es6/header/lib/parts/index.d.ts +2 -3
  216. package/ts3.5/dist/es6/header/lib/shared/themes.d.ts +28 -19
  217. package/ts3.5/dist/es6/header/lib/shared/types.d.ts +3 -8
  218. package/ts3.5/dist/es6/index.d.ts +2 -0
  219. package/ts3.5/dist/es6/layout/lib/utils/getValidChildren.d.ts +1 -1
  220. package/ts3.5/dist/es6/search-form/index.d.ts +3 -0
  221. package/ts3.5/dist/es6/{header/lib/parts/SearchBar.d.ts → search-form/lib/SearchForm.d.ts} +22 -23
  222. package/ts3.5/dist/es6/search-form/lib/themes.d.ts +21 -0
  223. package/ts3.5/dist/es6/text-input/index.d.ts +7 -0
  224. package/ts3.5/dist/es6/text-input/lib/TextInput.d.ts +21 -0
  225. package/ts3.5/dist/es6/text-input/lib/TextInputField.d.ts +8 -0
  226. package/ts3.5/dist/es6/text-input/lib/TextInputHint.d.ts +13 -0
  227. package/ts3.5/dist/es6/text-input/lib/TextInputLabel.d.ts +17 -0
  228. package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputField.d.ts +19 -0
  229. package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputHint.d.ts +15 -0
  230. package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputLabel.d.ts +15 -0
  231. package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts +17 -0
  232. package/dist/commonjs/header/lib/parts/SearchBar.d.ts.map +0 -1
  233. package/dist/es6/header/lib/parts/SearchBar.d.ts.map +0 -1
@@ -0,0 +1,64 @@
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
+ /** @jsx jsx */
24
+ import { jsx } from '@emotion/core';
25
+ import { borderRadius, inputColors, space, type, } from '@workday/canvas-kit-react/tokens';
26
+ import { createComponent, useModelContext } from '@workday/canvas-kit-react/common';
27
+ import { Box, useThemedRing, useThemeRTL } from '@workday/canvas-kit-labs-react/common';
28
+ import { TextInputModelContext } from './TextInput';
29
+ import { useTextInputField } from './hooks/useTextInputField';
30
+ var baseStyles = __assign(__assign({}, type.levels.subtext.large), { padding: space.xxs, margin: 0, minWidth: '280px', border: "1px solid " + inputColors.border, backgroundColor: inputColors.background, borderRadius: borderRadius.m, display: 'block', height: '40px', transition: '0.2s box-shadow, 0.2s border-color', '&::placeholder': {
31
+ color: inputColors.placeholder,
32
+ }, '&:hover': {
33
+ borderColor: inputColors.hoverBorder,
34
+ }, '&:focus:not([disabled])': {
35
+ outline: 'none',
36
+ }, '&:disabled': {
37
+ backgroundColor: inputColors.disabled.background,
38
+ borderColor: inputColors.disabled.border,
39
+ color: inputColors.disabled.text,
40
+ '&::placeholder': {
41
+ color: inputColors.disabled.text,
42
+ },
43
+ }, '::-ms-clear': {
44
+ display: 'none',
45
+ } });
46
+ export var TextInputField = createComponent('input')({
47
+ displayName: 'TextInput.Field',
48
+ Component: function (_a, ref) {
49
+ var model = _a.model, elemProps = __rest(_a, ["model"]);
50
+ var localModel = useModelContext(TextInputModelContext, model);
51
+ var props = useTextInputField(localModel, elemProps, ref);
52
+ var _b = useThemeRTL(), themeRTL = _b.themeRTL, theme = _b.theme;
53
+ var errorRing = useThemedRing('error');
54
+ var focusStyles = localModel.state.hasError
55
+ ? errorRing
56
+ : themeRTL({
57
+ '&:focus:not([disabled])': {
58
+ borderColor: theme.canvas.palette.common.focusOutline,
59
+ boxShadow: "inset 0 0 0 1px " + theme.canvas.palette.common.focusOutline,
60
+ },
61
+ });
62
+ return jsx(Box, __assign({ as: "input", css: [themeRTL(baseStyles), focusStyles] }, props));
63
+ },
64
+ });
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { ExtractProps } from '@workday/canvas-kit-react/common';
3
+ import { Box } from '@workday/canvas-kit-labs-react/common';
4
+ import { TextInputModel } from './hooks/useTextInputModel';
5
+ export interface TextInputHintProps extends ExtractProps<typeof Box, never> {
6
+ model?: TextInputModel;
7
+ /**
8
+ * Hint text to show to the user regarding the Error/Alert
9
+ */
10
+ children?: React.ReactNode;
11
+ }
12
+ export declare const TextInputHint: import("@workday/canvas-kit-react/common").ElementComponent<"p", TextInputHintProps>;
13
+ //# sourceMappingURL=TextInputHint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextInputHint.d.ts","sourceRoot":"","sources":["../../../../text-input/lib/TextInputHint.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAkB,YAAY,EAAkB,MAAM,kCAAkC,CAAC;AAEhG,OAAO,EAAC,GAAG,EAAc,MAAM,uCAAuC,CAAC;AAGvE,OAAO,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAGzD,MAAM,WAAW,kBAAmB,SAAQ,YAAY,CAAC,OAAO,GAAG,EAAE,KAAK,CAAC;IACzE,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAQD,eAAO,MAAM,aAAa,sFAyBxB,CAAC"}
@@ -0,0 +1,44 @@
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
+ /** @jsx jsx */
24
+ import { jsx } from '@emotion/core';
25
+ import { createComponent, useModelContext } from '@workday/canvas-kit-react/common';
26
+ import { space, type } from '@workday/canvas-kit-react/tokens';
27
+ import { Box, useThemeRTL } from '@workday/canvas-kit-labs-react/common';
28
+ import { TextInputModelContext } from './TextInput';
29
+ import { useTextInputHint } from './hooks/useTextInputHint';
30
+ var baseStyles = __assign(__assign({}, type.levels.subtext.medium), { margin: space.xxs + " 0 0", width: '100%' });
31
+ export var TextInputHint = createComponent('p')({
32
+ displayName: 'TextInput.Hint',
33
+ Component: function (_a, ref, Element) {
34
+ var model = _a.model, children = _a.children, elemProps = __rest(_a, ["model", "children"]);
35
+ var localModel = useModelContext(TextInputModelContext, model);
36
+ var props = useTextInputHint(localModel, elemProps, ref);
37
+ var _b = useThemeRTL(), themeRTL = _b.themeRTL, theme = _b.theme;
38
+ if (!children) {
39
+ // If there is no hint text just skip rendering
40
+ return null;
41
+ }
42
+ return (jsx(Box, __assign({ as: Element, css: themeRTL(baseStyles, localModel.state.hasError ? { color: theme.canvas.palette.error.main } : {}) }, props), children));
43
+ },
44
+ });
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { ExtractProps } from '@workday/canvas-kit-react/common';
3
+ import { Box } from '@workday/canvas-kit-labs-react/common';
4
+ import { TextInputModel } from './hooks/useTextInputModel';
5
+ export interface TextInputLabelProps extends ExtractProps<typeof Box, never> {
6
+ model?: TextInputModel;
7
+ /**
8
+ * If true, apply the `accessibleHide` styles to the Label.
9
+ */
10
+ isVisuallyHidden?: boolean;
11
+ /**
12
+ * The text of the label.
13
+ */
14
+ children: React.ReactNode;
15
+ }
16
+ export declare const TextInputLabel: import("@workday/canvas-kit-react/common").ElementComponent<"label", TextInputLabelProps>;
17
+ //# sourceMappingURL=TextInputLabel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextInputLabel.d.ts","sourceRoot":"","sources":["../../../../text-input/lib/TextInputLabel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAGL,YAAY,EAEb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,GAAG,EAA+B,MAAM,uCAAuC,CAAC;AAKxF,OAAO,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAGzD,MAAM,WAAW,mBAAoB,SAAQ,YAAY,CAAC,OAAO,GAAG,EAAE,KAAK,CAAC;IAC1E,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAkBD,eAAO,MAAM,cAAc,2FA2BzB,CAAC"}
@@ -0,0 +1,52 @@
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
+ /** @jsx jsx */
24
+ import { jsx } from '@emotion/core';
25
+ import { accessibleHide, createComponent, useModelContext, } from '@workday/canvas-kit-react/common';
26
+ import { Box, useThemeRTL } from '@workday/canvas-kit-labs-react/common';
27
+ import { type } from '@workday/canvas-kit-react/tokens';
28
+ import { HStack } from '@workday/canvas-kit-labs-react/layout';
29
+ import { TextInputModelContext } from './TextInput';
30
+ import { useTextInputLabel } from './hooks/useTextInputLabel';
31
+ var styles = {
32
+ label: __assign(__assign({}, type.levels.subtext.large), { fontWeight: type.properties.fontWeights.medium, minWidth: '180px' }),
33
+ label_visuallyHidden: __assign({}, accessibleHide),
34
+ asterisk: {
35
+ fontSize: type.properties.fontSizes[16],
36
+ fontWeight: type.properties.fontWeights.regular,
37
+ textDecoration: 'unset',
38
+ },
39
+ };
40
+ export var TextInputLabel = createComponent('label')({
41
+ displayName: 'TextInput.Label',
42
+ Component: function (_a, ref) {
43
+ var isVisuallyHidden = _a.isVisuallyHidden, model = _a.model, children = _a.children, elemProps = __rest(_a, ["isVisuallyHidden", "model", "children"]);
44
+ var localModel = useModelContext(TextInputModelContext, model);
45
+ var props = useTextInputLabel(localModel, elemProps, ref);
46
+ var _b = useThemeRTL(), themeRTL = _b.themeRTL, theme = _b.theme;
47
+ return (jsx(Box, __assign({ as: "label", css: themeRTL(styles.label, isVisuallyHidden ? styles.label_visuallyHidden : {}) }, props),
48
+ jsx(HStack, { spacing: "xxxs" },
49
+ jsx("span", null, children),
50
+ localModel.state.isRequired && (jsx("span", { css: themeRTL(styles.asterisk, { color: theme.canvas.palette.error.main }), "aria-hidden": "true" }, "*")))));
51
+ },
52
+ });
@@ -0,0 +1,19 @@
1
+ /// <reference types="@emotion/core" />
2
+ /**
3
+ * Adds the necessary props to a `Field` component. Used by the TextInput.Field subcomponent.
4
+ */
5
+ export declare const useTextInputField: <P extends {}, R>(model: import("@workday/canvas-kit-react/common").Model<{
6
+ hasError?: boolean | undefined;
7
+ inputId?: string | undefined;
8
+ hintId?: string | undefined;
9
+ isRequired?: boolean | undefined;
10
+ }, {}>, elemProps?: P | undefined, ref?: ((instance: R | null) => void) | import("react").RefObject<R> | null | undefined) => {
11
+ type: string;
12
+ required: boolean | undefined;
13
+ 'aria-invalid': boolean | undefined;
14
+ 'aria-describedby': string | undefined;
15
+ id: string | undefined;
16
+ } & P & (R extends HTMLOrSVGElement ? {
17
+ ref: import("react").Ref<R>;
18
+ } : {});
19
+ //# sourceMappingURL=useTextInputField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTextInputField.d.ts","sourceRoot":"","sources":["../../../../../text-input/lib/hooks/useTextInputField.tsx"],"names":[],"mappings":";AAGA;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;OAQ5B,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { createHook } from '@workday/canvas-kit-react/common';
2
+ /**
3
+ * Adds the necessary props to a `Field` component. Used by the TextInput.Field subcomponent.
4
+ */
5
+ export var useTextInputField = createHook(function (_a) {
6
+ var state = _a.state;
7
+ return {
8
+ type: 'text',
9
+ required: state.isRequired ? true : undefined,
10
+ 'aria-invalid': state.hasError ? true : undefined,
11
+ 'aria-describedby': state.hintId,
12
+ id: state.inputId,
13
+ };
14
+ });
@@ -0,0 +1,15 @@
1
+ /// <reference types="@emotion/core" />
2
+ /**
3
+ * Adds the necessary props to a `Hint` component. Used by the TextInput.Hint subcomponent.
4
+ */
5
+ export declare const useTextInputHint: <P extends {}, R>(model: import("@workday/canvas-kit-react/common").Model<{
6
+ hasError?: boolean | undefined;
7
+ inputId?: string | undefined;
8
+ hintId?: string | undefined;
9
+ isRequired?: boolean | undefined;
10
+ }, {}>, elemProps?: P | undefined, ref?: ((instance: R | null) => void) | import("react").RefObject<R> | null | undefined) => {
11
+ id: string | undefined;
12
+ } & P & (R extends HTMLOrSVGElement ? {
13
+ ref: import("react").Ref<R>;
14
+ } : {});
15
+ //# sourceMappingURL=useTextInputHint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTextInputHint.d.ts","sourceRoot":"","sources":["../../../../../text-input/lib/hooks/useTextInputHint.tsx"],"names":[],"mappings":";AAGA;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;OAI3B,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { createHook } from '@workday/canvas-kit-react/common';
2
+ /**
3
+ * Adds the necessary props to a `Hint` component. Used by the TextInput.Hint subcomponent.
4
+ */
5
+ export var useTextInputHint = createHook(function (_a) {
6
+ var state = _a.state;
7
+ return {
8
+ id: state.hintId,
9
+ };
10
+ });
@@ -0,0 +1,15 @@
1
+ /// <reference types="@emotion/core" />
2
+ /**
3
+ * Adds the necessary props to a `Label` component. Used by the TextInput.Label subcomponent.
4
+ */
5
+ export declare const useTextInputLabel: <P extends {}, R>(model: import("@workday/canvas-kit-react/common").Model<{
6
+ hasError?: boolean | undefined;
7
+ inputId?: string | undefined;
8
+ hintId?: string | undefined;
9
+ isRequired?: boolean | undefined;
10
+ }, {}>, elemProps?: P | undefined, ref?: ((instance: R | null) => void) | import("react").RefObject<R> | null | undefined) => {
11
+ htmlFor: string | undefined;
12
+ } & P & (R extends HTMLOrSVGElement ? {
13
+ ref: import("react").Ref<R>;
14
+ } : {});
15
+ //# sourceMappingURL=useTextInputLabel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTextInputLabel.d.ts","sourceRoot":"","sources":["../../../../../text-input/lib/hooks/useTextInputLabel.tsx"],"names":[],"mappings":";AAGA;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;OAI5B,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { createHook } from '@workday/canvas-kit-react/common';
2
+ /**
3
+ * Adds the necessary props to a `Label` component. Used by the TextInput.Label subcomponent.
4
+ */
5
+ export var useTextInputLabel = createHook(function (_a) {
6
+ var state = _a.state;
7
+ return {
8
+ htmlFor: state.inputId,
9
+ };
10
+ });
@@ -0,0 +1,17 @@
1
+ import { Model, ToModelConfig } from '@workday/canvas-kit-react/common';
2
+ declare type TextInputState = {
3
+ hasError?: boolean;
4
+ inputId?: string;
5
+ hintId?: string;
6
+ isRequired?: boolean;
7
+ };
8
+ declare type TextInputEvents = {};
9
+ export declare type TextInputModel = Model<TextInputState, TextInputEvents>;
10
+ declare const textInputEventMap: {
11
+ guards: {};
12
+ callbacks: {};
13
+ };
14
+ export declare type TextInputModelConfig = TextInputState & Partial<ToModelConfig<TextInputState, TextInputEvents, typeof textInputEventMap>>;
15
+ export declare const useTextInputModel: (config?: TextInputModelConfig) => Model<TextInputState, TextInputEvents>;
16
+ export {};
17
+ //# sourceMappingURL=useTextInputModel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTextInputModel.d.ts","sourceRoot":"","sources":["../../../../../text-input/lib/hooks/useTextInputModel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,EACL,aAAa,EAGd,MAAM,kCAAkC,CAAC;AAE1C,aAAK,cAAc,GAAG;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,aAAK,eAAe,GAAG,EAAE,CAAC;AAE1B,oBAAY,cAAc,GAAG,KAAK,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC;AAEpE,QAAA,MAAM,iBAAiB;;;CAGrB,CAAC;AAEH,oBAAY,oBAAoB,GAAG,cAAc,GAC/C,OAAO,CAAC,aAAa,CAAC,cAAc,EAAE,eAAe,EAAE,OAAO,iBAAiB,CAAC,CAAC,CAAC;AAEpF,eAAO,MAAM,iBAAiB,2EAiB7B,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { createEventMap, useEventMap, useUniqueId, } from '@workday/canvas-kit-react/common';
2
+ var textInputEventMap = createEventMap()({
3
+ guards: {},
4
+ callbacks: {},
5
+ });
6
+ export var useTextInputModel = function (config) {
7
+ if (config === void 0) { config = {}; }
8
+ var inputId = useUniqueId(config.inputId);
9
+ var hintId = useUniqueId(config.hintId);
10
+ var state = {
11
+ hasError: config.hasError,
12
+ isRequired: config.isRequired,
13
+ inputId: inputId,
14
+ hintId: hintId,
15
+ };
16
+ var events = useEventMap(textInputEventMap, state, config, {});
17
+ return {
18
+ state: state,
19
+ events: events,
20
+ };
21
+ };