@okshaun/components 2.0.2 → 4.0.0

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 (78) hide show
  1. package/dist/icon-metadata.json +385 -41
  2. package/dist/index.js +13414 -5259
  3. package/dist/index.js.map +1 -1
  4. package/dist/panda.buildinfo.json +1245 -263
  5. package/dist/{preset-DAmO4B54.js → preset-BOFHjPdQ.js} +2265 -1727
  6. package/dist/preset-BOFHjPdQ.js.map +1 -0
  7. package/dist/preset.js +1 -1
  8. package/dist/specs/conditions.json +75 -51
  9. package/dist/specs/keyframes.json +33 -0
  10. package/dist/specs/recipes.json +359 -103
  11. package/dist/specs/semantic-tokens.json +152 -44
  12. package/dist/specs/tokens.json +21 -36
  13. package/dist/sprite.svg +1 -1
  14. package/dist/sprite.symbol.html +499 -43
  15. package/dist/styles.css +18229 -7568
  16. package/dist/svgs/barcode-off.svg +1 -0
  17. package/dist/svgs/cheese.svg +1 -0
  18. package/dist/svgs/collapse-vertical.svg +1 -0
  19. package/dist/svgs/expand-vertical.svg +1 -0
  20. package/dist/svgs/magnet.svg +1 -0
  21. package/dist/svgs/spinner.svg +1 -0
  22. package/dist/svgs/to-date-backward.svg +1 -0
  23. package/dist/svgs/to-date-forward.svg +1 -0
  24. package/dist/types/index.d.ts +2804 -296
  25. package/package.json +4 -2
  26. package/src/recipes/autocomplete.ts +266 -0
  27. package/src/recipes/avatar.ts +1 -1
  28. package/src/recipes/badge.ts +31 -43
  29. package/src/recipes/breakpointIndicator.ts +11 -0
  30. package/src/recipes/button.ts +172 -223
  31. package/src/recipes/calendar.ts +91 -0
  32. package/src/recipes/card.ts +4 -70
  33. package/src/recipes/chip.ts +213 -142
  34. package/src/recipes/dateMenus.ts +40 -0
  35. package/src/recipes/dateTimeMenus.ts +43 -0
  36. package/src/recipes/icon.ts +25 -6
  37. package/src/recipes/kbd.ts +56 -0
  38. package/src/recipes/list.ts +17 -1
  39. package/src/recipes/listDensity.ts +66 -0
  40. package/src/recipes/listItem.ts +29 -161
  41. package/src/recipes/listItemGroup.ts +17 -39
  42. package/src/recipes/menu.ts +17 -3
  43. package/src/recipes/modal.ts +70 -39
  44. package/src/recipes/radio.ts +6 -6
  45. package/src/recipes/recipes-regular.ts +2 -0
  46. package/src/recipes/recipes-slot.ts +8 -2
  47. package/src/recipes/segmentedFields.ts +192 -0
  48. package/src/recipes/segmentedInputs.ts +109 -0
  49. package/src/recipes/select.ts +8 -1
  50. package/src/recipes/skeleton.ts +72 -0
  51. package/src/recipes/spinner.ts +27 -24
  52. package/src/recipes/tag.ts +218 -210
  53. package/src/recipes/text.ts +37 -19
  54. package/src/recipes/textInput.ts +106 -117
  55. package/src/recipes/themeSwitcher.ts +3 -3
  56. package/src/recipes/timeMenus.ts +110 -0
  57. package/src/recipes/toggle.ts +3 -1
  58. package/src/styles/primitives/animations.ts +3 -0
  59. package/src/styles/primitives/shadows.ts +26 -60
  60. package/src/styles/primitives/zIndex.ts +1 -0
  61. package/src/styles/semantics/colors.ts +43 -0
  62. package/src/styles/semantics/shadows.ts +4 -30
  63. package/src/styles/semantics/zIndex.ts +2 -0
  64. package/src/styles/utilities/conditions.ts +61 -51
  65. package/src/styles/utilities/dropShadows.ts +51 -0
  66. package/src/styles/utilities/filters.ts +22 -7
  67. package/src/styles/utilities/globalStyle.ts +5 -2
  68. package/src/styles/utilities/index.ts +3 -0
  69. package/src/styles/utilities/keyframes.ts +31 -4
  70. package/src/styles/utilities/recipeGlobalStyles.ts +22 -0
  71. package/src/styles/utilities/shadowDefinitions.ts +112 -0
  72. package/src/utils/dsChain.ts +113 -0
  73. package/src/utils/dsComponent.ts +44 -0
  74. package/src/utils/dsPart.ts +41 -0
  75. package/src/utils/mergeAriaDescribedBy.ts +7 -0
  76. package/dist/preset-DAmO4B54.js.map +0 -1
  77. package/src/recipes/datePicker.ts +0 -212
  78. package/src/recipes/timePicker.ts +0 -199
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Attribute name that names an interactive part inside a design-system
3
+ * component. Always lowercase and hyphenated; HTML lowercases attribute names,
4
+ * so a camelCase spelling would silently produce a different attribute.
5
+ */
6
+ export const DS_PART_ATTRIBUTE = 'data-ds-part';
7
+
8
+ /** Attribute record applied to a named part of a design-system component. */
9
+ export type DsPartAttribute = {
10
+ 'data-ds-part': string;
11
+ };
12
+
13
+ /**
14
+ * Returns the `data-ds-part` attribute for a named part of a component.
15
+ *
16
+ * Internal instrumentation with the same status as `data-ds-component`: emitted
17
+ * automatically, not a supported public API, and not part of any prop type.
18
+ * **It is not a test handle** — tests query by role, or by the `data-testid` a
19
+ * consumer supplied. Do not document it, type it, or reference it from a test
20
+ * outside this repository.
21
+ *
22
+ * It exists for the collector, which needs to tell apart the interactive parts
23
+ * of one component: a click on a `Select`'s trigger is a different event from a
24
+ * click on a chip's remove control inside it, and both report the same
25
+ * `data-ds-component` and the same chain. The part name is what separates them,
26
+ * and it is the DS's to assign because only the DS knows its own anatomy.
27
+ *
28
+ * Spread the result before the component's rest props so a consumer-supplied
29
+ * value in rest props still wins, matching `dsComponent`.
30
+ *
31
+ * The chain mechanism reads `data-testid` only (see `Box` and
32
+ * `~/utils/dsChain`), so this attribute never contributes a chain node.
33
+ *
34
+ * @example
35
+ * ```tsx
36
+ * <Box role="combobox" {...dsPart('trigger')} {...triggerProps} />
37
+ * ```
38
+ */
39
+ export const dsPart = (part: string): DsPartAttribute => ({
40
+ [DS_PART_ATTRIBUTE]: part,
41
+ });
@@ -0,0 +1,7 @@
1
+ export const mergeAriaDescribedBy = (...values: Array<string | undefined>) => {
2
+ const merged = values
3
+ .flatMap((value) => value?.split(/\s+/) ?? [])
4
+ .filter(Boolean);
5
+
6
+ return merged.length > 0 ? Array.from(new Set(merged)).join(' ') : undefined;
7
+ };