@warp-ds/elements 2.2.0-next.29 → 2.2.0-next.30

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 (263) hide show
  1. package/dist/custom-elements.json +973 -5050
  2. package/dist/index.d.ts +87 -995
  3. package/dist/packages/link/index.js +93 -2640
  4. package/dist/packages/modal/index.js +5 -2717
  5. package/dist/packages/select/select.react.stories.d.ts +1 -1
  6. package/dist/packages/textfield/textfield.react.stories.d.ts +1 -1
  7. package/dist/packages/toast/index.js +3 -2483
  8. package/dist/packages/utils/index.js +37 -2
  9. package/dist/vscode.html-custom-data.json +13 -456
  10. package/dist/web-types.json +166 -1203
  11. package/package.json +1 -1
  12. package/dist/packages/combobox/combobox.react.stories.d.ts +0 -28
  13. package/dist/packages/combobox/combobox.react.stories.js +0 -90
  14. package/dist/packages/combobox/combobox.stories.d.ts +0 -18
  15. package/dist/packages/combobox/combobox.stories.js +0 -117
  16. package/dist/packages/combobox/index.d.ts +0 -95
  17. package/dist/packages/combobox/index.js +0 -2492
  18. package/dist/packages/combobox/index.js.map +0 -7
  19. package/dist/packages/combobox/locales/da/messages.d.mts +0 -1
  20. package/dist/packages/combobox/locales/da/messages.mjs +0 -1
  21. package/dist/packages/combobox/locales/en/messages.d.mts +0 -1
  22. package/dist/packages/combobox/locales/en/messages.mjs +0 -1
  23. package/dist/packages/combobox/locales/fi/messages.d.mts +0 -1
  24. package/dist/packages/combobox/locales/fi/messages.mjs +0 -1
  25. package/dist/packages/combobox/locales/nb/messages.d.mts +0 -1
  26. package/dist/packages/combobox/locales/nb/messages.mjs +0 -1
  27. package/dist/packages/combobox/locales/sv/messages.d.mts +0 -1
  28. package/dist/packages/combobox/locales/sv/messages.mjs +0 -1
  29. package/dist/packages/combobox/react.d.ts +0 -7
  30. package/dist/packages/combobox/react.js +0 -17
  31. package/dist/packages/combobox/styles.d.ts +0 -1
  32. package/dist/packages/combobox/styles.js +0 -2
  33. package/dist/packages/datepicker/DatePicker.test.d.ts +0 -2
  34. package/dist/packages/datepicker/DatePicker.test.js +0 -69
  35. package/dist/packages/datepicker/datepicker.d.ts +0 -102
  36. package/dist/packages/datepicker/datepicker.js +0 -2785
  37. package/dist/packages/datepicker/datepicker.js.map +0 -7
  38. package/dist/packages/datepicker/datepicker.react.stories.d.ts +0 -18
  39. package/dist/packages/datepicker/datepicker.react.stories.js +0 -26
  40. package/dist/packages/datepicker/datepicker.stories.d.ts +0 -12
  41. package/dist/packages/datepicker/datepicker.stories.js +0 -51
  42. package/dist/packages/datepicker/datepicker.test.d.ts +0 -2
  43. package/dist/packages/datepicker/datepicker.test.js +0 -62
  44. package/dist/packages/datepicker/index.d.ts +0 -1
  45. package/dist/packages/datepicker/index.js +0 -2785
  46. package/dist/packages/datepicker/index.js.map +0 -7
  47. package/dist/packages/datepicker/locales/da/messages.d.mts +0 -1
  48. package/dist/packages/datepicker/locales/da/messages.mjs +0 -1
  49. package/dist/packages/datepicker/locales/en/messages.d.mts +0 -1
  50. package/dist/packages/datepicker/locales/en/messages.mjs +0 -1
  51. package/dist/packages/datepicker/locales/fi/messages.d.mts +0 -1
  52. package/dist/packages/datepicker/locales/fi/messages.mjs +0 -1
  53. package/dist/packages/datepicker/locales/nb/messages.d.mts +0 -1
  54. package/dist/packages/datepicker/locales/nb/messages.mjs +0 -1
  55. package/dist/packages/datepicker/locales/sv/messages.d.mts +0 -1
  56. package/dist/packages/datepicker/locales/sv/messages.mjs +0 -1
  57. package/dist/packages/datepicker/react.d.ts +0 -5
  58. package/dist/packages/datepicker/react.js +0 -15
  59. package/dist/packages/datepicker/styles/w-datepicker-calendar.styles.d.ts +0 -1
  60. package/dist/packages/datepicker/styles/w-datepicker-calendar.styles.js +0 -15
  61. package/dist/packages/datepicker/styles/w-datepicker-day.styles.d.ts +0 -1
  62. package/dist/packages/datepicker/styles/w-datepicker-day.styles.js +0 -64
  63. package/dist/packages/datepicker/styles/w-datepicker-month.styles.d.ts +0 -1
  64. package/dist/packages/datepicker/styles/w-datepicker-month.styles.js +0 -72
  65. package/dist/packages/datepicker/styles/w-datepicker.styles.d.ts +0 -1
  66. package/dist/packages/datepicker/styles/w-datepicker.styles.js +0 -101
  67. package/dist/packages/datepicker/utils.d.ts +0 -13
  68. package/dist/packages/datepicker/utils.js +0 -28
  69. package/dist/packages/dead-toggle/dead-toggle.react.stories.d.ts +0 -15
  70. package/dist/packages/dead-toggle/dead-toggle.react.stories.js +0 -34
  71. package/dist/packages/dead-toggle/dead-toggle.stories.d.ts +0 -14
  72. package/dist/packages/dead-toggle/dead-toggle.stories.js +0 -45
  73. package/dist/packages/dead-toggle/dead-toggle.test.d.ts +0 -1
  74. package/dist/packages/dead-toggle/dead-toggle.test.js +0 -9
  75. package/dist/packages/dead-toggle/index.d.ts +0 -17
  76. package/dist/packages/dead-toggle/index.js +0 -2548
  77. package/dist/packages/dead-toggle/index.js.map +0 -7
  78. package/dist/packages/dead-toggle/react.d.ts +0 -2
  79. package/dist/packages/dead-toggle/react.js +0 -11
  80. package/dist/packages/link/index.js.map +0 -7
  81. package/dist/packages/link/link.react.stories.d.ts +0 -21
  82. package/dist/packages/link/link.react.stories.js +0 -96
  83. package/dist/packages/link/link.stories.d.ts +0 -20
  84. package/dist/packages/link/link.stories.js +0 -110
  85. package/dist/packages/link/link.test.d.ts +0 -1
  86. package/dist/packages/link/link.test.js +0 -9
  87. package/dist/packages/link/react.d.ts +0 -2
  88. package/dist/packages/link/react.js +0 -11
  89. package/dist/packages/modal/index.js.map +0 -7
  90. package/dist/packages/pageindicator/index.d.ts +0 -10
  91. package/dist/packages/pageindicator/index.js +0 -32
  92. package/dist/packages/pageindicator/index.js.map +0 -7
  93. package/dist/packages/pageindicator/pageindicator.react.stories.d.ts +0 -19
  94. package/dist/packages/pageindicator/pageindicator.react.stories.js +0 -20
  95. package/dist/packages/pageindicator/pageindicator.stories.d.ts +0 -32
  96. package/dist/packages/pageindicator/pageindicator.stories.js +0 -71
  97. package/dist/packages/pageindicator/react.d.ts +0 -2
  98. package/dist/packages/pageindicator/react.js +0 -11
  99. package/dist/packages/pageindicator/style.d.ts +0 -1
  100. package/dist/packages/pageindicator/style.js +0 -26
  101. package/dist/packages/pagination/index.d.ts +0 -32
  102. package/dist/packages/pagination/index.js +0 -2500
  103. package/dist/packages/pagination/index.js.map +0 -7
  104. package/dist/packages/pagination/locales/da/messages.d.mts +0 -1
  105. package/dist/packages/pagination/locales/da/messages.mjs +0 -1
  106. package/dist/packages/pagination/locales/en/messages.d.mts +0 -1
  107. package/dist/packages/pagination/locales/en/messages.mjs +0 -1
  108. package/dist/packages/pagination/locales/fi/messages.d.mts +0 -1
  109. package/dist/packages/pagination/locales/fi/messages.mjs +0 -1
  110. package/dist/packages/pagination/locales/nb/messages.d.mts +0 -1
  111. package/dist/packages/pagination/locales/nb/messages.mjs +0 -1
  112. package/dist/packages/pagination/locales/sv/messages.d.mts +0 -1
  113. package/dist/packages/pagination/locales/sv/messages.mjs +0 -1
  114. package/dist/packages/pagination/pagination.react.stories.d.ts +0 -21
  115. package/dist/packages/pagination/pagination.react.stories.js +0 -45
  116. package/dist/packages/pagination/pagination.stories.d.ts +0 -14
  117. package/dist/packages/pagination/pagination.stories.js +0 -56
  118. package/dist/packages/pagination/pagination.test.d.ts +0 -1
  119. package/dist/packages/pagination/pagination.test.js +0 -76
  120. package/dist/packages/pagination/react.d.ts +0 -5
  121. package/dist/packages/pagination/react.js +0 -15
  122. package/dist/packages/pagination/styles.d.ts +0 -1
  123. package/dist/packages/pagination/styles.js +0 -2
  124. package/dist/packages/rip-and-tear-checkbox/checkbox.d.ts +0 -66
  125. package/dist/packages/rip-and-tear-checkbox/checkbox.js +0 -2592
  126. package/dist/packages/rip-and-tear-checkbox/checkbox.js.map +0 -7
  127. package/dist/packages/rip-and-tear-checkbox/checkbox.stories.d.ts +0 -8
  128. package/dist/packages/rip-and-tear-checkbox/checkbox.stories.js +0 -11
  129. package/dist/packages/rip-and-tear-checkbox/index.d.ts +0 -1
  130. package/dist/packages/rip-and-tear-checkbox/index.js +0 -2592
  131. package/dist/packages/rip-and-tear-checkbox/index.js.map +0 -7
  132. package/dist/packages/rip-and-tear-checkbox/react.d.ts +0 -5
  133. package/dist/packages/rip-and-tear-checkbox/react.js +0 -15
  134. package/dist/packages/rip-and-tear-checkbox/rip-and-tear-checkbox.react.stories.d.ts +0 -12
  135. package/dist/packages/rip-and-tear-checkbox/rip-and-tear-checkbox.react.stories.js +0 -10
  136. package/dist/packages/rip-and-tear-checkbox/styles.d.ts +0 -0
  137. package/dist/packages/rip-and-tear-checkbox/styles.js +0 -0
  138. package/dist/packages/rip-and-tear-radio/base-element.d.ts +0 -46
  139. package/dist/packages/rip-and-tear-radio/base-element.js +0 -100
  140. package/dist/packages/rip-and-tear-radio/custom-error-validator.d.ts +0 -6
  141. package/dist/packages/rip-and-tear-radio/custom-error-validator.js +0 -22
  142. package/dist/packages/rip-and-tear-radio/form-associated-element.d.ts +0 -103
  143. package/dist/packages/rip-and-tear-radio/form-associated-element.js +0 -282
  144. package/dist/packages/rip-and-tear-radio/host-styles.d.ts +0 -1
  145. package/dist/packages/rip-and-tear-radio/host-styles.js +0 -12
  146. package/dist/packages/rip-and-tear-radio/index.d.ts +0 -1
  147. package/dist/packages/rip-and-tear-radio/index.js +0 -2649
  148. package/dist/packages/rip-and-tear-radio/index.js.map +0 -7
  149. package/dist/packages/rip-and-tear-radio/invalid.d.ts +0 -8
  150. package/dist/packages/rip-and-tear-radio/invalid.js +0 -5
  151. package/dist/packages/rip-and-tear-radio/math.d.ts +0 -1
  152. package/dist/packages/rip-and-tear-radio/math.js +0 -4
  153. package/dist/packages/rip-and-tear-radio/radio-group-styles.d.ts +0 -1
  154. package/dist/packages/rip-and-tear-radio/radio-group-styles.js +0 -59
  155. package/dist/packages/rip-and-tear-radio/radio-group-styles.js.map +0 -7
  156. package/dist/packages/rip-and-tear-radio/radio-group.d.ts +0 -72
  157. package/dist/packages/rip-and-tear-radio/radio-group.js +0 -2649
  158. package/dist/packages/rip-and-tear-radio/radio-group.js.map +0 -7
  159. package/dist/packages/rip-and-tear-radio/radio-styles.d.ts +0 -0
  160. package/dist/packages/rip-and-tear-radio/radio-styles.js +0 -1
  161. package/dist/packages/rip-and-tear-radio/radio-styles.js.map +0 -7
  162. package/dist/packages/rip-and-tear-radio/radio.d.ts +0 -38
  163. package/dist/packages/rip-and-tear-radio/radio.js +0 -2563
  164. package/dist/packages/rip-and-tear-radio/radio.js.map +0 -7
  165. package/dist/packages/rip-and-tear-radio/radio.stories.d.ts +0 -8
  166. package/dist/packages/rip-and-tear-radio/radio.stories.js +0 -2654
  167. package/dist/packages/rip-and-tear-radio/radio.stories.js.map +0 -7
  168. package/dist/packages/rip-and-tear-radio/react.d.ts +0 -9
  169. package/dist/packages/rip-and-tear-radio/react.js +0 -22
  170. package/dist/packages/rip-and-tear-radio/required-validator.d.ts +0 -11
  171. package/dist/packages/rip-and-tear-radio/required-validator.js +0 -34
  172. package/dist/packages/rip-and-tear-radio/rip-and-tear-radio.react.stories.d.ts +0 -9
  173. package/dist/packages/rip-and-tear-radio/rip-and-tear-radio.react.stories.js +0 -10
  174. package/dist/packages/rip-and-tear-radio/slot.d.ts +0 -20
  175. package/dist/packages/rip-and-tear-radio/slot.js +0 -71
  176. package/dist/packages/rip-and-tear-radio/watch.d.ts +0 -26
  177. package/dist/packages/rip-and-tear-radio/watch.js +0 -39
  178. package/dist/packages/slider/Slider.d.ts +0 -2
  179. package/dist/packages/slider/Slider.js +0 -8
  180. package/dist/packages/slider/SliderThumb.d.ts +0 -2
  181. package/dist/packages/slider/SliderThumb.js +0 -8
  182. package/dist/packages/slider/index.d.ts +0 -2
  183. package/dist/packages/slider/index.js +0 -2851
  184. package/dist/packages/slider/index.js.map +0 -7
  185. package/dist/packages/slider/oddbird-css-anchor-positioning.d.ts +0 -2
  186. package/dist/packages/slider/oddbird-css-anchor-positioning.js +0 -3
  187. package/dist/packages/slider/react.d.ts +0 -8
  188. package/dist/packages/slider/react.js +0 -20
  189. package/dist/packages/slider/slider-thumb.d.ts +0 -57
  190. package/dist/packages/slider/slider-thumb.js +0 -2705
  191. package/dist/packages/slider/slider-thumb.js.map +0 -7
  192. package/dist/packages/slider/slider.d.ts +0 -46
  193. package/dist/packages/slider/slider.js +0 -2587
  194. package/dist/packages/slider/slider.js.map +0 -7
  195. package/dist/packages/slider/slider.react.stories.d.ts +0 -18
  196. package/dist/packages/slider/slider.react.stories.js +0 -118
  197. package/dist/packages/slider/slider.stories.d.ts +0 -18
  198. package/dist/packages/slider/slider.stories.js +0 -197
  199. package/dist/packages/slider/slider.test.d.ts +0 -4
  200. package/dist/packages/slider/slider.test.js +0 -83
  201. package/dist/packages/slider/styles/w-slider-thumb.styles.d.ts +0 -1
  202. package/dist/packages/slider/styles/w-slider-thumb.styles.js +0 -167
  203. package/dist/packages/slider/styles/w-slider.styles.d.ts +0 -1
  204. package/dist/packages/slider/styles/w-slider.styles.js +0 -134
  205. package/dist/packages/slider/styles.d.ts +0 -1
  206. package/dist/packages/slider/styles.js +0 -2
  207. package/dist/packages/steps/index.d.ts +0 -36
  208. package/dist/packages/steps/index.js +0 -2465
  209. package/dist/packages/steps/index.js.map +0 -7
  210. package/dist/packages/steps/locales/da/messages.d.mts +0 -1
  211. package/dist/packages/steps/locales/da/messages.mjs +0 -1
  212. package/dist/packages/steps/locales/en/messages.d.mts +0 -1
  213. package/dist/packages/steps/locales/en/messages.mjs +0 -1
  214. package/dist/packages/steps/locales/fi/messages.d.mts +0 -1
  215. package/dist/packages/steps/locales/fi/messages.mjs +0 -1
  216. package/dist/packages/steps/locales/nb/messages.d.mts +0 -1
  217. package/dist/packages/steps/locales/nb/messages.mjs +0 -1
  218. package/dist/packages/steps/locales/sv/messages.d.mts +0 -1
  219. package/dist/packages/steps/locales/sv/messages.mjs +0 -1
  220. package/dist/packages/steps/react.d.ts +0 -3
  221. package/dist/packages/steps/react.js +0 -16
  222. package/dist/packages/steps/steps.react.stories.d.ts +0 -15
  223. package/dist/packages/steps/steps.react.stories.js +0 -112
  224. package/dist/packages/steps/steps.stories.d.ts +0 -12
  225. package/dist/packages/steps/steps.stories.js +0 -172
  226. package/dist/packages/steps/styles.d.ts +0 -1
  227. package/dist/packages/steps/styles.js +0 -2
  228. package/dist/packages/switch/index.d.ts +0 -15
  229. package/dist/packages/switch/index.js +0 -2455
  230. package/dist/packages/switch/index.js.map +0 -7
  231. package/dist/packages/switch/react.d.ts +0 -5
  232. package/dist/packages/switch/react.js +0 -15
  233. package/dist/packages/switch/styles.d.ts +0 -1
  234. package/dist/packages/switch/styles.js +0 -2
  235. package/dist/packages/switch/switch.react.stories.d.ts +0 -15
  236. package/dist/packages/switch/switch.react.stories.js +0 -29
  237. package/dist/packages/switch/switch.stories.d.ts +0 -9
  238. package/dist/packages/switch/switch.stories.js +0 -34
  239. package/dist/packages/tabs/index.d.ts +0 -4
  240. package/dist/packages/tabs/index.js +0 -2470
  241. package/dist/packages/tabs/index.js.map +0 -7
  242. package/dist/packages/tabs/react.d.ts +0 -12
  243. package/dist/packages/tabs/react.js +0 -31
  244. package/dist/packages/tabs/styles.d.ts +0 -1
  245. package/dist/packages/tabs/styles.js +0 -2
  246. package/dist/packages/tabs/tab-panel.d.ts +0 -20
  247. package/dist/packages/tabs/tab-panel.js +0 -2441
  248. package/dist/packages/tabs/tab-panel.js.map +0 -7
  249. package/dist/packages/tabs/tab.d.ts +0 -18
  250. package/dist/packages/tabs/tab.js +0 -2463
  251. package/dist/packages/tabs/tab.js.map +0 -7
  252. package/dist/packages/tabs/tabs.d.ts +0 -40
  253. package/dist/packages/tabs/tabs.js +0 -2448
  254. package/dist/packages/tabs/tabs.js.map +0 -7
  255. package/dist/packages/tabs/tabs.react.stories.d.ts +0 -15
  256. package/dist/packages/tabs/tabs.react.stories.js +0 -51
  257. package/dist/packages/tabs/tabs.stories.d.ts +0 -8
  258. package/dist/packages/tabs/tabs.stories.js +0 -2545
  259. package/dist/packages/tabs/tabs.stories.js.map +0 -7
  260. package/dist/packages/toast/index.js.map +0 -7
  261. package/dist/packages/toggle-styles.d.ts +0 -1
  262. package/dist/packages/toggle-styles.js +0 -109
  263. package/dist/packages/utils/index.js.map +0 -7
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@warp-ds/elements",
3
3
  "type": "module",
4
- "version": "2.2.0-next.29",
4
+ "version": "2.2.0-next.30",
5
5
  "packageManager": "pnpm@10.19.0",
6
6
  "description": "Custom elements for Warp",
7
7
  "exports": {
@@ -1,28 +0,0 @@
1
- import React from 'react';
2
- import { StoryObj } from '@storybook/react';
3
- import { Combobox } from './react';
4
- declare const _default: {
5
- title: string;
6
- component: import("@lit/react").ReactWebComponent<import(".").WarpCombobox, {
7
- onSelect: string;
8
- onselect: string;
9
- onChange: string;
10
- onchange: string;
11
- }>;
12
- render(args: Omit<React.HTMLAttributes<import(".").WarpCombobox>, "label" | "onchange" | "onselect" | "onChange" | "onSelect" | "render" | "renderOptions" | "connectedCallback" | "disconnectedCallback" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "disabled" | "name" | "value" | "invalid" | "options" | "placeholder" | "openOnFocus" | "selectOnBlur" | "matchTextSegments" | "disableStaticFiltering" | "helpText" | "required" | "optional" | "containerClassName" | "listClassName"> & {
13
- onSelect?: (e: Event) => void;
14
- onselect?: (e: Event) => void;
15
- onChange?: (e: Event) => void;
16
- onchange?: (e: Event) => void;
17
- } & Partial<Omit<import(".").WarpCombobox, keyof HTMLElement>> & React.RefAttributes<import(".").WarpCombobox>): React.JSX.Element;
18
- };
19
- export default _default;
20
- export type Story = StoryObj<typeof Combobox>;
21
- export declare const Default: Story;
22
- export declare const WithValue: Story;
23
- export declare const OpenOnFocus: Story;
24
- export declare const WithTextMatching: Story;
25
- export declare const Invalid: Story;
26
- export declare const Disabled: Story;
27
- export declare const Optional: Story;
28
- export declare const DisableStaticFiltering: Story;
@@ -1,90 +0,0 @@
1
- import React from 'react';
2
- import { Combobox } from './react';
3
- export default {
4
- title: 'Forms/Combobox',
5
- component: Combobox,
6
- render(args) {
7
- return React.createElement(Combobox, { ...args, options: sampleOptions });
8
- },
9
- };
10
- const sampleOptions = [
11
- { value: 'Apple', label: 'Apple' },
12
- { value: 'Banana', label: 'Banana' },
13
- { value: 'Orange', label: 'Orange' },
14
- { value: 'Grape', label: 'Grape' },
15
- { value: 'Strawberry', label: 'Strawberry' },
16
- { value: 'Pineapple', label: 'Pineapple' },
17
- { value: 'Mango', label: 'Mango' },
18
- ];
19
- export const Default = {
20
- args: {
21
- options: sampleOptions,
22
- label: 'Select a fruit',
23
- placeholder: 'Type to search...',
24
- },
25
- };
26
- export const WithValue = {
27
- args: {
28
- options: sampleOptions,
29
- label: 'Select a fruit',
30
- placeholder: 'Type to search...',
31
- value: 'Apple',
32
- },
33
- };
34
- export const OpenOnFocus = {
35
- args: {
36
- options: sampleOptions,
37
- label: 'Select a fruit',
38
- placeholder: 'Type to search...',
39
- openOnFocus: true,
40
- },
41
- };
42
- export const WithTextMatching = {
43
- args: {
44
- options: sampleOptions,
45
- label: 'Select a fruit',
46
- placeholder: 'Type to search...',
47
- matchTextSegments: true,
48
- },
49
- };
50
- export const Invalid = {
51
- args: {
52
- options: sampleOptions,
53
- label: 'Select a fruit',
54
- placeholder: 'Type to search...',
55
- value: 'Invalid fruit',
56
- helpText: 'Please select a valid fruit from the list',
57
- invalid: true,
58
- },
59
- };
60
- export const Disabled = {
61
- args: {
62
- options: sampleOptions,
63
- label: 'Select a fruit',
64
- placeholder: 'Type to search...',
65
- value: 'Apple',
66
- disabled: true,
67
- },
68
- };
69
- export const Optional = {
70
- args: {
71
- options: sampleOptions,
72
- label: 'Select a fruit',
73
- placeholder: 'Type to search...',
74
- optional: true,
75
- },
76
- };
77
- export const DisableStaticFiltering = {
78
- render: () => {
79
- const [options, setOptions] = React.useState(sampleOptions);
80
- const [val, setVal] = React.useState('');
81
- return (React.createElement(Combobox, { id: "combobox-dynamic", label: "Select a fruit (dynamic)", placeholder: "Type to search...", disableStaticFiltering: true, value: val, options: options, onChange: (e) => {
82
- setVal(e.detail.value);
83
- // Simulate dynamic filtering
84
- const filteredOptions = sampleOptions.filter((option) => option.value.toLowerCase().includes(e.detail.value.toLowerCase()));
85
- setOptions(filteredOptions);
86
- }, onSelect: (e) => {
87
- setVal(e.detail.value);
88
- } }));
89
- },
90
- };
@@ -1,18 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/web-components';
2
- import './index.js';
3
- import '../textfield/index.js';
4
- import type { WarpCombobox } from './index.js';
5
- declare const args: Partial<WarpCombobox> & {
6
- [key: string]: any;
7
- };
8
- declare const meta: Meta<typeof args>;
9
- export default meta;
10
- type Story = StoryObj<WarpCombobox>;
11
- export declare const Default: Story;
12
- export declare const WithValue: Story;
13
- export declare const OpenOnFocus: Story;
14
- export declare const WithTextMatching: Story;
15
- export declare const Invalid: Story;
16
- export declare const Disabled: Story;
17
- export declare const Optional: Story;
18
- export declare const DisableStaticFiltering: Story;
@@ -1,117 +0,0 @@
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
- };
@@ -1,95 +0,0 @@
1
- import { LitElement, PropertyValues } from 'lit';
2
- export declare const ccCombobox: {
3
- wrapper: string;
4
- base: string;
5
- listbox: string;
6
- option: string;
7
- optionUnselected: string;
8
- optionSelected: string;
9
- textMatch: string;
10
- a11y: string;
11
- };
12
- export interface ComboboxOption {
13
- value: string;
14
- label?: string;
15
- key?: string;
16
- }
17
- /**
18
- * A combobox element for text input with selectable options.
19
- *
20
- * [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/forms-combobox--docs)
21
- */
22
- export declare class WarpCombobox extends LitElement {
23
- /** The available options to select from */
24
- options: ComboboxOption[];
25
- /** Label above input */
26
- label?: string;
27
- /** Input placeholder */
28
- placeholder?: string;
29
- /** The input value */
30
- value: string;
31
- /** Whether the popover opens when focus is on the text field */
32
- openOnFocus: boolean;
33
- /** Select active option on blur */
34
- selectOnBlur: boolean;
35
- /** Whether the matching text segments in the options should be highlighted */
36
- matchTextSegments: boolean;
37
- /** Disable client-side static filtering */
38
- disableStaticFiltering: boolean;
39
- /** Renders the input field in an invalid state */
40
- invalid: boolean;
41
- /** The content to display as the help text */
42
- helpText?: string;
43
- /** Whether the element is disabled */
44
- disabled: boolean;
45
- /** Whether the element is required */
46
- required: boolean;
47
- /** Whether to show optional text */
48
- optional: boolean;
49
- /** Additional container styling */
50
- containerClassName?: string;
51
- /** Additional list styling */
52
- listClassName?: string;
53
- /** Name attribute for form submission */
54
- name?: string;
55
- /** @internal Options list open boolean */
56
- private _isOpen;
57
- /** @internal The option the user has navigated to with their keyboard */
58
- private _navigationOption;
59
- /** @internal Available options based on user's input value */
60
- private _currentOptions;
61
- /** @internal Unique identifier counter for options */
62
- private _optionIdCounter;
63
- static styles: import("lit").CSSResult[];
64
- constructor();
65
- private get _listboxId();
66
- private get _id();
67
- private get _helpId();
68
- private get _navigationValueOrInputValue();
69
- /** Generate options with unique IDs and match information */
70
- private _createOptionsWithIdAndMatch;
71
- /** Get ARIA text for screen readers */
72
- private _getAriaText;
73
- /** Get option classes */
74
- private _getOptionClasses;
75
- /** Handle keyboard navigation */
76
- private _handleKeyDown;
77
- /** Find and set active option based on keyboard navigation */
78
- private _findAndSetActiveOption;
79
- /** Handle option selection */
80
- private _handleSelect;
81
- /** Handle input change */
82
- private _handleChange;
83
- /** Handle input focus */
84
- private _handleFocus;
85
- /** Handle input blur */
86
- private _handleBlur;
87
- /** Handle option click */
88
- private _handleOptionClick;
89
- /** Handle container blur */
90
- private _handleContainerBlur;
91
- /** Render highlighted text match */
92
- private _renderTextMatch;
93
- protected willUpdate(changedProperties: PropertyValues<this>): void;
94
- render(): import("lit").TemplateResult<1>;
95
- }