@warp-ds/elements 2.3.0-next.1 → 2.3.0-next.3

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 (196) hide show
  1. package/dist/custom-elements.json +3295 -403
  2. package/dist/index.d.ts +484 -0
  3. package/dist/packages/combobox/combobox.react.stories.d.ts +28 -0
  4. package/dist/packages/combobox/combobox.react.stories.js +90 -0
  5. package/dist/packages/combobox/combobox.stories.d.ts +18 -0
  6. package/dist/packages/combobox/combobox.stories.js +117 -0
  7. package/dist/packages/combobox/index.d.ts +85 -0
  8. package/dist/packages/combobox/index.js +2492 -0
  9. package/dist/packages/combobox/index.js.map +7 -0
  10. package/dist/packages/combobox/locales/da/messages.d.mts +1 -0
  11. package/dist/packages/combobox/locales/da/messages.mjs +1 -0
  12. package/dist/packages/combobox/locales/en/messages.d.mts +1 -0
  13. package/dist/packages/combobox/locales/en/messages.mjs +1 -0
  14. package/dist/packages/combobox/locales/fi/messages.d.mts +1 -0
  15. package/dist/packages/combobox/locales/fi/messages.mjs +1 -0
  16. package/dist/packages/combobox/locales/nb/messages.d.mts +1 -0
  17. package/dist/packages/combobox/locales/nb/messages.mjs +1 -0
  18. package/dist/packages/combobox/locales/sv/messages.d.mts +1 -0
  19. package/dist/packages/combobox/locales/sv/messages.mjs +1 -0
  20. package/dist/packages/combobox/react.d.ts +7 -0
  21. package/dist/packages/combobox/react.js +17 -0
  22. package/dist/packages/combobox/styles.d.ts +1 -0
  23. package/dist/packages/combobox/styles.js +2 -0
  24. package/dist/packages/datepicker/DatePicker.test.d.ts +2 -0
  25. package/dist/packages/datepicker/DatePicker.test.js +69 -0
  26. package/dist/packages/datepicker/datepicker.d.ts +102 -0
  27. package/dist/packages/datepicker/datepicker.js +2785 -0
  28. package/dist/packages/datepicker/datepicker.js.map +7 -0
  29. package/dist/packages/datepicker/datepicker.react.stories.d.ts +18 -0
  30. package/dist/packages/datepicker/datepicker.react.stories.js +26 -0
  31. package/dist/packages/datepicker/datepicker.stories.d.ts +12 -0
  32. package/dist/packages/datepicker/datepicker.stories.js +51 -0
  33. package/dist/packages/datepicker/datepicker.test.d.ts +2 -0
  34. package/dist/packages/datepicker/datepicker.test.js +62 -0
  35. package/dist/packages/datepicker/index.d.ts +1 -0
  36. package/dist/packages/datepicker/index.js +1 -0
  37. package/dist/packages/datepicker/locales/da/messages.d.mts +1 -0
  38. package/dist/packages/datepicker/locales/da/messages.mjs +1 -0
  39. package/dist/packages/datepicker/locales/en/messages.d.mts +1 -0
  40. package/dist/packages/datepicker/locales/en/messages.mjs +1 -0
  41. package/dist/packages/datepicker/locales/fi/messages.d.mts +1 -0
  42. package/dist/packages/datepicker/locales/fi/messages.mjs +1 -0
  43. package/dist/packages/datepicker/locales/nb/messages.d.mts +1 -0
  44. package/dist/packages/datepicker/locales/nb/messages.mjs +1 -0
  45. package/dist/packages/datepicker/locales/sv/messages.d.mts +1 -0
  46. package/dist/packages/datepicker/locales/sv/messages.mjs +1 -0
  47. package/dist/packages/datepicker/react.d.ts +5 -0
  48. package/dist/packages/datepicker/react.js +15 -0
  49. package/dist/packages/datepicker/styles/w-datepicker-calendar.styles.d.ts +1 -0
  50. package/dist/packages/datepicker/styles/w-datepicker-calendar.styles.js +15 -0
  51. package/dist/packages/datepicker/styles/w-datepicker-day.styles.d.ts +1 -0
  52. package/dist/packages/datepicker/styles/w-datepicker-day.styles.js +64 -0
  53. package/dist/packages/datepicker/styles/w-datepicker-month.styles.d.ts +1 -0
  54. package/dist/packages/datepicker/styles/w-datepicker-month.styles.js +72 -0
  55. package/dist/packages/datepicker/styles/w-datepicker.styles.d.ts +1 -0
  56. package/dist/packages/datepicker/styles/w-datepicker.styles.js +101 -0
  57. package/dist/packages/datepicker/utils.d.ts +13 -0
  58. package/dist/packages/datepicker/utils.js +28 -0
  59. package/dist/packages/dead-toggle/dead-toggle.react.stories.d.ts +15 -0
  60. package/dist/packages/dead-toggle/dead-toggle.react.stories.js +34 -0
  61. package/dist/packages/dead-toggle/dead-toggle.stories.d.ts +14 -0
  62. package/dist/packages/dead-toggle/dead-toggle.stories.js +45 -0
  63. package/dist/packages/dead-toggle/dead-toggle.test.d.ts +1 -0
  64. package/dist/packages/dead-toggle/dead-toggle.test.js +9 -0
  65. package/dist/packages/dead-toggle/index.d.ts +17 -0
  66. package/dist/packages/dead-toggle/index.js +2548 -0
  67. package/dist/packages/dead-toggle/index.js.map +7 -0
  68. package/dist/packages/dead-toggle/react.d.ts +2 -0
  69. package/dist/packages/dead-toggle/react.js +11 -0
  70. package/dist/packages/link/index.js +2640 -93
  71. package/dist/packages/link/index.js.map +7 -0
  72. package/dist/packages/link/link.react.stories.d.ts +21 -0
  73. package/dist/packages/link/link.react.stories.js +96 -0
  74. package/dist/packages/link/link.stories.d.ts +20 -0
  75. package/dist/packages/link/link.stories.js +110 -0
  76. package/dist/packages/link/link.test.d.ts +1 -0
  77. package/dist/packages/link/link.test.js +9 -0
  78. package/dist/packages/link/react.d.ts +2 -0
  79. package/dist/packages/link/react.js +11 -0
  80. package/dist/packages/pageindicator/index.d.ts +10 -0
  81. package/dist/packages/pageindicator/index.js +32 -0
  82. package/dist/packages/pageindicator/index.js.map +7 -0
  83. package/dist/packages/pageindicator/pageindicator.react.stories.d.ts +19 -0
  84. package/dist/packages/pageindicator/pageindicator.react.stories.js +20 -0
  85. package/dist/packages/pageindicator/pageindicator.stories.d.ts +32 -0
  86. package/dist/packages/pageindicator/pageindicator.stories.js +71 -0
  87. package/dist/packages/pageindicator/react.d.ts +2 -0
  88. package/dist/packages/pageindicator/react.js +11 -0
  89. package/dist/packages/pageindicator/style.d.ts +1 -0
  90. package/dist/packages/pageindicator/style.js +26 -0
  91. package/dist/packages/rip-and-tear-checkbox/checkbox.d.ts +66 -0
  92. package/dist/packages/rip-and-tear-checkbox/checkbox.js +2592 -0
  93. package/dist/packages/rip-and-tear-checkbox/checkbox.js.map +7 -0
  94. package/dist/packages/rip-and-tear-checkbox/checkbox.stories.d.ts +8 -0
  95. package/dist/packages/rip-and-tear-checkbox/checkbox.stories.js +11 -0
  96. package/dist/packages/rip-and-tear-checkbox/index.d.ts +1 -0
  97. package/dist/packages/rip-and-tear-checkbox/index.js +4 -0
  98. package/dist/packages/rip-and-tear-checkbox/react.d.ts +5 -0
  99. package/dist/packages/rip-and-tear-checkbox/react.js +15 -0
  100. package/dist/packages/rip-and-tear-checkbox/rip-and-tear-checkbox.react.stories.d.ts +12 -0
  101. package/dist/packages/rip-and-tear-checkbox/rip-and-tear-checkbox.react.stories.js +10 -0
  102. package/dist/packages/rip-and-tear-checkbox/styles.d.ts +0 -0
  103. package/dist/packages/rip-and-tear-checkbox/styles.js +0 -0
  104. package/dist/packages/rip-and-tear-radio/base-element.d.ts +46 -0
  105. package/dist/packages/rip-and-tear-radio/base-element.js +100 -0
  106. package/dist/packages/rip-and-tear-radio/custom-error-validator.d.ts +6 -0
  107. package/dist/packages/rip-and-tear-radio/custom-error-validator.js +22 -0
  108. package/dist/packages/rip-and-tear-radio/form-associated-element.d.ts +103 -0
  109. package/dist/packages/rip-and-tear-radio/form-associated-element.js +282 -0
  110. package/dist/packages/rip-and-tear-radio/host-styles.d.ts +1 -0
  111. package/dist/packages/rip-and-tear-radio/host-styles.js +12 -0
  112. package/dist/packages/rip-and-tear-radio/index.d.ts +1 -0
  113. package/dist/packages/rip-and-tear-radio/index.js +6 -0
  114. package/dist/packages/rip-and-tear-radio/invalid.d.ts +8 -0
  115. package/dist/packages/rip-and-tear-radio/invalid.js +5 -0
  116. package/dist/packages/rip-and-tear-radio/math.d.ts +1 -0
  117. package/dist/packages/rip-and-tear-radio/math.js +4 -0
  118. package/dist/packages/rip-and-tear-radio/radio-group-styles.d.ts +1 -0
  119. package/dist/packages/rip-and-tear-radio/radio-group-styles.js +59 -0
  120. package/dist/packages/rip-and-tear-radio/radio-group-styles.js.map +7 -0
  121. package/dist/packages/rip-and-tear-radio/radio-group.d.ts +72 -0
  122. package/dist/packages/rip-and-tear-radio/radio-group.js +2649 -0
  123. package/dist/packages/rip-and-tear-radio/radio-group.js.map +7 -0
  124. package/dist/packages/rip-and-tear-radio/radio-styles.d.ts +0 -0
  125. package/dist/packages/rip-and-tear-radio/radio-styles.js +1 -0
  126. package/dist/packages/rip-and-tear-radio/radio-styles.js.map +7 -0
  127. package/dist/packages/rip-and-tear-radio/radio.d.ts +38 -0
  128. package/dist/packages/rip-and-tear-radio/radio.js +2563 -0
  129. package/dist/packages/rip-and-tear-radio/radio.js.map +7 -0
  130. package/dist/packages/rip-and-tear-radio/radio.stories.d.ts +8 -0
  131. package/dist/packages/rip-and-tear-radio/radio.stories.js +2654 -0
  132. package/dist/packages/rip-and-tear-radio/radio.stories.js.map +7 -0
  133. package/dist/packages/rip-and-tear-radio/react.d.ts +9 -0
  134. package/dist/packages/rip-and-tear-radio/react.js +22 -0
  135. package/dist/packages/rip-and-tear-radio/required-validator.d.ts +11 -0
  136. package/dist/packages/rip-and-tear-radio/required-validator.js +34 -0
  137. package/dist/packages/rip-and-tear-radio/rip-and-tear-radio.react.stories.d.ts +9 -0
  138. package/dist/packages/rip-and-tear-radio/rip-and-tear-radio.react.stories.js +10 -0
  139. package/dist/packages/rip-and-tear-radio/slot.d.ts +20 -0
  140. package/dist/packages/rip-and-tear-radio/slot.js +71 -0
  141. package/dist/packages/rip-and-tear-radio/watch.d.ts +26 -0
  142. package/dist/packages/rip-and-tear-radio/watch.js +39 -0
  143. package/dist/packages/steps/index.d.ts +36 -0
  144. package/dist/packages/steps/index.js +2465 -0
  145. package/dist/packages/steps/index.js.map +7 -0
  146. package/dist/packages/steps/locales/da/messages.d.mts +1 -0
  147. package/dist/packages/steps/locales/da/messages.mjs +1 -0
  148. package/dist/packages/steps/locales/en/messages.d.mts +1 -0
  149. package/dist/packages/steps/locales/en/messages.mjs +1 -0
  150. package/dist/packages/steps/locales/fi/messages.d.mts +1 -0
  151. package/dist/packages/steps/locales/fi/messages.mjs +1 -0
  152. package/dist/packages/steps/locales/nb/messages.d.mts +1 -0
  153. package/dist/packages/steps/locales/nb/messages.mjs +1 -0
  154. package/dist/packages/steps/locales/sv/messages.d.mts +1 -0
  155. package/dist/packages/steps/locales/sv/messages.mjs +1 -0
  156. package/dist/packages/steps/react.d.ts +3 -0
  157. package/dist/packages/steps/react.js +16 -0
  158. package/dist/packages/steps/steps.react.stories.d.ts +15 -0
  159. package/dist/packages/steps/steps.react.stories.js +112 -0
  160. package/dist/packages/steps/steps.stories.d.ts +12 -0
  161. package/dist/packages/steps/steps.stories.js +172 -0
  162. package/dist/packages/steps/styles.d.ts +1 -0
  163. package/dist/packages/steps/styles.js +2 -0
  164. package/dist/packages/switch/index.d.ts +15 -0
  165. package/dist/packages/switch/index.js +2455 -0
  166. package/dist/packages/switch/index.js.map +7 -0
  167. package/dist/packages/switch/react.d.ts +5 -0
  168. package/dist/packages/switch/react.js +15 -0
  169. package/dist/packages/switch/styles.d.ts +1 -0
  170. package/dist/packages/switch/styles.js +2 -0
  171. package/dist/packages/switch/switch.react.stories.d.ts +15 -0
  172. package/dist/packages/switch/switch.react.stories.js +29 -0
  173. package/dist/packages/switch/switch.stories.d.ts +9 -0
  174. package/dist/packages/switch/switch.stories.js +34 -0
  175. package/dist/packages/tabs/index.d.ts +4 -0
  176. package/dist/packages/tabs/index.js +3 -0
  177. package/dist/packages/tabs/react.d.ts +12 -0
  178. package/dist/packages/tabs/react.js +31 -0
  179. package/dist/packages/tabs/styles.d.ts +1 -0
  180. package/dist/packages/tabs/styles.js +2 -0
  181. package/dist/packages/tabs/tab-panel.d.ts +20 -0
  182. package/dist/packages/tabs/tab-panel.js +51 -0
  183. package/dist/packages/tabs/tab.d.ts +18 -0
  184. package/dist/packages/tabs/tab.js +2463 -0
  185. package/dist/packages/tabs/tab.js.map +7 -0
  186. package/dist/packages/tabs/tabs.d.ts +40 -0
  187. package/dist/packages/tabs/tabs.js +2448 -0
  188. package/dist/packages/tabs/tabs.js.map +7 -0
  189. package/dist/packages/tabs/tabs.react.stories.d.ts +15 -0
  190. package/dist/packages/tabs/tabs.react.stories.js +51 -0
  191. package/dist/packages/tabs/tabs.stories.d.ts +8 -0
  192. package/dist/packages/tabs/tabs.stories.js +84 -0
  193. package/dist/packages/toggle-styles.d.ts +1 -0
  194. package/dist/packages/toggle-styles.js +109 -0
  195. package/dist/web-types.json +496 -1
  196. package/package.json +184 -3
@@ -0,0 +1,117 @@
1
+ import { spread } from '@open-wc/lit-helpers';
2
+ import { getStorybookHelpers } from '@wc-toolkit/storybook-helpers';
3
+ import { html } from 'lit';
4
+ import { prespread } from '../../.storybook/utilities.js';
5
+ import './index.js';
6
+ import '../textfield/index.js';
7
+ const { events, args, argTypes } = getStorybookHelpers('w-combobox');
8
+ const meta = {
9
+ title: 'Forms/Combobox',
10
+ component: 'w-combobox',
11
+ render(args) {
12
+ return html ` <w-combobox ${spread(prespread(args))} .options="${sampleOptions}"></w-combobox> `;
13
+ },
14
+ parameters: {
15
+ docs: {
16
+ description: {
17
+ component: 'A combobox element for text input with selectable options.',
18
+ },
19
+ },
20
+ actions: {
21
+ handles: events,
22
+ },
23
+ },
24
+ args,
25
+ argTypes,
26
+ };
27
+ export default meta;
28
+ const sampleOptions = [
29
+ { value: 'Apple', label: 'Apple' },
30
+ { value: 'Banana', label: 'Banana' },
31
+ { value: 'Orange', label: 'Orange' },
32
+ { value: 'Grape', label: 'Grape' },
33
+ { value: 'Strawberry', label: 'Strawberry' },
34
+ { value: 'Pineapple', label: 'Pineapple' },
35
+ { value: 'Mango', label: 'Mango' },
36
+ ];
37
+ export const Default = {
38
+ args: {},
39
+ render: () => html ` <w-combobox label="Select a fruit" placeholder="Type to search..." .options="${sampleOptions}"></w-combobox> `,
40
+ };
41
+ export const WithValue = {
42
+ args: {
43
+ options: sampleOptions,
44
+ label: 'Select a fruit',
45
+ placeholder: 'Type to search...',
46
+ value: 'Apple',
47
+ },
48
+ };
49
+ export const OpenOnFocus = {
50
+ args: {
51
+ options: sampleOptions,
52
+ label: 'Select a fruit',
53
+ placeholder: 'Type to search...',
54
+ openOnFocus: true,
55
+ },
56
+ };
57
+ export const WithTextMatching = {
58
+ args: {
59
+ options: sampleOptions,
60
+ label: 'Select a fruit',
61
+ placeholder: 'Type to search...',
62
+ matchTextSegments: true,
63
+ },
64
+ };
65
+ export const Invalid = {
66
+ args: {
67
+ options: sampleOptions,
68
+ label: 'Select a fruit',
69
+ placeholder: 'Type to search...',
70
+ value: 'Invalid fruit',
71
+ helpText: 'Please select a valid fruit from the list',
72
+ invalid: true,
73
+ },
74
+ };
75
+ export const Disabled = {
76
+ args: {
77
+ options: sampleOptions,
78
+ label: 'Select a fruit',
79
+ placeholder: 'Type to search...',
80
+ value: 'Apple',
81
+ disabled: true,
82
+ },
83
+ };
84
+ export const Optional = {
85
+ args: {
86
+ options: sampleOptions,
87
+ label: 'Select a fruit',
88
+ placeholder: 'Type to search...',
89
+ optional: true,
90
+ },
91
+ };
92
+ export const DisableStaticFiltering = {
93
+ render: () => html `
94
+ <w-combobox
95
+ id="combobox-dynamic"
96
+ label="Select a fruit (dynamic)"
97
+ placeholder="Type to search..."
98
+ disable-static-filtering></w-combobox>
99
+ <script type="module">
100
+ const combobox = document.querySelector('#combobox-dynamic');
101
+ const sampleOptions = ${JSON.stringify(sampleOptions)};
102
+ combobox.options = sampleOptions;
103
+ combobox.value = '';
104
+
105
+ combobox.addEventListener('change', (e) => {
106
+ combobox.value = e.detail.value;
107
+ // Simulate dynamic filtering
108
+ const filteredOptions = sampleOptions.filter((option) => option.value.toLowerCase().includes(e.detail.value.toLowerCase()));
109
+ combobox.options = filteredOptions;
110
+ });
111
+
112
+ combobox.addEventListener('select', (e) => {
113
+ combobox.value = e.detail.value;
114
+ });
115
+ </script>
116
+ `,
117
+ };
@@ -0,0 +1,85 @@
1
+ import { LitElement, PropertyValues } from 'lit';
2
+ export interface ComboboxOption {
3
+ value: string;
4
+ label?: string;
5
+ key?: string;
6
+ }
7
+ /**
8
+ * A combobox element for text input with selectable options.
9
+ *
10
+ * [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/forms-combobox--docs)
11
+ */
12
+ export declare class WarpCombobox extends LitElement {
13
+ /** The available options to select from */
14
+ options: ComboboxOption[];
15
+ /** Label above input */
16
+ label?: string;
17
+ /** Input placeholder */
18
+ placeholder?: string;
19
+ /** The input value */
20
+ value: string;
21
+ /** Whether the popover opens when focus is on the text field */
22
+ openOnFocus: boolean;
23
+ /** Select active option on blur */
24
+ selectOnBlur: boolean;
25
+ /** Whether the matching text segments in the options should be highlighted */
26
+ matchTextSegments: boolean;
27
+ /** Disable client-side static filtering */
28
+ disableStaticFiltering: boolean;
29
+ /** Renders the input field in an invalid state */
30
+ invalid: boolean;
31
+ /** The content to display as the help text */
32
+ helpText?: string;
33
+ /** Whether the element is disabled */
34
+ disabled: boolean;
35
+ /** Whether the element is required */
36
+ required: boolean;
37
+ /** Whether to show optional text */
38
+ optional: boolean;
39
+ /** Additional container styling */
40
+ containerClassName?: string;
41
+ /** Additional list styling */
42
+ listClassName?: string;
43
+ /** Name attribute for form submission */
44
+ name?: string;
45
+ /** @internal Options list open boolean */
46
+ private _isOpen;
47
+ /** @internal The option the user has navigated to with their keyboard */
48
+ private _navigationOption;
49
+ /** @internal Available options based on user's input value */
50
+ private _currentOptions;
51
+ /** @internal Unique identifier counter for options */
52
+ private _optionIdCounter;
53
+ static styles: import("lit").CSSResult[];
54
+ constructor();
55
+ private get _listboxId();
56
+ private get _id();
57
+ private get _helpId();
58
+ private get _navigationValueOrInputValue();
59
+ /** Generate options with unique IDs and match information */
60
+ private _createOptionsWithIdAndMatch;
61
+ /** Get ARIA text for screen readers */
62
+ private _getAriaText;
63
+ /** Get option classes */
64
+ private _getOptionClasses;
65
+ /** Handle keyboard navigation */
66
+ private _handleKeyDown;
67
+ /** Find and set active option based on keyboard navigation */
68
+ private _findAndSetActiveOption;
69
+ /** Handle option selection */
70
+ private _handleSelect;
71
+ /** Handle input change */
72
+ private _handleChange;
73
+ /** Handle input focus */
74
+ private _handleFocus;
75
+ /** Handle input blur */
76
+ private _handleBlur;
77
+ /** Handle option click */
78
+ private _handleOptionClick;
79
+ /** Handle container blur */
80
+ private _handleContainerBlur;
81
+ /** Render highlighted text match */
82
+ private _renderTextMatch;
83
+ protected willUpdate(changedProperties: PropertyValues<this>): void;
84
+ render(): import("lit").TemplateResult<1>;
85
+ }