@tribepad/themis 1.0.7 → 1.0.9

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 (102) hide show
  1. package/dist/elements/AlertDialog/index.js +1 -1
  2. package/dist/elements/AlertDialog/index.js.map +1 -1
  3. package/dist/elements/AlertDialog/index.mjs +1 -1
  4. package/dist/elements/AlertDialog/index.mjs.map +1 -1
  5. package/dist/elements/Breadcrumbs/index.js +1 -1
  6. package/dist/elements/Breadcrumbs/index.js.map +1 -1
  7. package/dist/elements/Breadcrumbs/index.mjs +1 -1
  8. package/dist/elements/Breadcrumbs/index.mjs.map +1 -1
  9. package/dist/elements/Chart/ChartContext.d.ts.map +1 -1
  10. package/dist/elements/Chart/ChartLineSeries.d.ts.map +1 -1
  11. package/dist/elements/Chart/index.js +1 -1
  12. package/dist/elements/Chart/index.js.map +1 -1
  13. package/dist/elements/Chart/index.mjs +1 -1
  14. package/dist/elements/Chart/index.mjs.map +1 -1
  15. package/dist/elements/DatePicker/index.js +1 -1
  16. package/dist/elements/DatePicker/index.js.map +1 -1
  17. package/dist/elements/DatePicker/index.mjs +1 -1
  18. package/dist/elements/DatePicker/index.mjs.map +1 -1
  19. package/dist/elements/FileField/index.js +1 -1
  20. package/dist/elements/FileField/index.js.map +1 -1
  21. package/dist/elements/FileField/index.mjs +1 -1
  22. package/dist/elements/FileField/index.mjs.map +1 -1
  23. package/dist/elements/Modal/Modal.styles.d.ts +2 -0
  24. package/dist/elements/Modal/Modal.styles.d.ts.map +1 -1
  25. package/dist/elements/Modal/index.js +1 -1
  26. package/dist/elements/Modal/index.js.map +1 -1
  27. package/dist/elements/Modal/index.mjs +1 -1
  28. package/dist/elements/Modal/index.mjs.map +1 -1
  29. package/dist/elements/NumberField/NumberField.d.ts.map +1 -1
  30. package/dist/elements/NumberField/NumberField.types.d.ts +12 -0
  31. package/dist/elements/NumberField/NumberField.types.d.ts.map +1 -1
  32. package/dist/elements/NumberField/index.js +1 -1
  33. package/dist/elements/NumberField/index.js.map +1 -1
  34. package/dist/elements/NumberField/index.mjs +1 -1
  35. package/dist/elements/NumberField/index.mjs.map +1 -1
  36. package/dist/elements/OTPInput/OTPInput.d.ts +1 -1
  37. package/dist/elements/Resizable/index.js +1 -1
  38. package/dist/elements/Resizable/index.js.map +1 -1
  39. package/dist/elements/Resizable/index.mjs +1 -1
  40. package/dist/elements/Resizable/index.mjs.map +1 -1
  41. package/dist/elements/Switch/Switch.d.ts +11 -4
  42. package/dist/elements/Switch/Switch.d.ts.map +1 -1
  43. package/dist/elements/Switch/Switch.types.d.ts +5 -0
  44. package/dist/elements/Switch/Switch.types.d.ts.map +1 -1
  45. package/dist/elements/Switch/index.js +1 -1
  46. package/dist/elements/Switch/index.js.map +1 -1
  47. package/dist/elements/Switch/index.mjs +1 -1
  48. package/dist/elements/Switch/index.mjs.map +1 -1
  49. package/dist/elements/Tabs/Tabs.d.ts +1 -1
  50. package/dist/elements/Tabs/Tabs.d.ts.map +1 -1
  51. package/dist/elements/Tabs/Tabs.types.d.ts +1 -0
  52. package/dist/elements/Tabs/Tabs.types.d.ts.map +1 -1
  53. package/dist/elements/Tabs/index.js +1 -1
  54. package/dist/elements/Tabs/index.js.map +1 -1
  55. package/dist/elements/Tabs/index.mjs +1 -1
  56. package/dist/elements/Tabs/index.mjs.map +1 -1
  57. package/dist/elements/index.js +1 -1
  58. package/dist/elements/index.js.map +1 -1
  59. package/dist/elements/index.mjs +1 -1
  60. package/dist/elements/index.mjs.map +1 -1
  61. package/dist/hooks/index.d.ts +2 -0
  62. package/dist/hooks/index.d.ts.map +1 -0
  63. package/dist/hooks/index.js +2 -0
  64. package/dist/hooks/index.js.map +1 -0
  65. package/dist/hooks/index.mjs +2 -0
  66. package/dist/hooks/index.mjs.map +1 -0
  67. package/dist/hooks/useReducedMotion.d.ts +9 -0
  68. package/dist/hooks/useReducedMotion.d.ts.map +1 -0
  69. package/dist/index.d.ts +2 -0
  70. package/dist/index.d.ts.map +1 -1
  71. package/dist/index.js +2 -2
  72. package/dist/index.js.map +1 -1
  73. package/dist/index.mjs +2 -2
  74. package/dist/index.mjs.map +1 -1
  75. package/dist/styles/animations.css +172 -0
  76. package/dist/styles/index.js +1 -1
  77. package/dist/styles/index.js.map +1 -1
  78. package/dist/styles/index.mjs +1 -1
  79. package/dist/styles/index.mjs.map +1 -1
  80. package/dist/styles/shared-variants.d.ts +23 -0
  81. package/dist/styles/shared-variants.d.ts.map +1 -1
  82. package/dist/tailwind-source.css +1 -0
  83. package/dist/types/animation.d.ts +24 -0
  84. package/dist/types/animation.d.ts.map +1 -0
  85. package/dist/types/index.d.ts +2 -0
  86. package/dist/types/index.d.ts.map +1 -0
  87. package/dist/types/index.js +2 -0
  88. package/dist/types/index.js.map +1 -0
  89. package/dist/types/index.mjs +2 -0
  90. package/dist/types/index.mjs.map +1 -0
  91. package/dist/utils/index.d.ts +1 -0
  92. package/dist/utils/index.d.ts.map +1 -1
  93. package/dist/utils/index.js +1 -1
  94. package/dist/utils/index.js.map +1 -1
  95. package/dist/utils/index.mjs +1 -1
  96. package/dist/utils/index.mjs.map +1 -1
  97. package/dist/utils/shouldAnimate.d.ts +12 -0
  98. package/dist/utils/shouldAnimate.d.ts.map +1 -0
  99. package/package.json +34 -2
  100. package/src/elements/NumberField/NumberField.stories.tsx +100 -0
  101. package/src/elements/Switch/Switch.stories.tsx +60 -0
  102. package/src/elements/Tabs/Tabs.stories.tsx +101 -0
@@ -0,0 +1,172 @@
1
+ /**
2
+ * Themis Animation Utilities
3
+ *
4
+ * CSS animation utilities for enter/exit transitions, compatible with Tailwind v4.
5
+ * Used by Modal, Select, Combobox, Dropdown, Toast, Tooltip, Carousel, Button ripple,
6
+ * and ResizablePopover components.
7
+ *
8
+ * These provide the same utilities as tailwindcss-animate but using Tailwind v4
9
+ * @utility directives so they work with all Tailwind variant prefixes
10
+ * (e.g., data-[entering]:animate-in, motion-safe:zoom-in-95).
11
+ *
12
+ * Usage:
13
+ * @import '@tribepad/themis/styles/animations.css';
14
+ */
15
+
16
+ /* =============================================================================
17
+ * Keyframes
18
+ * ============================================================================= */
19
+
20
+ @keyframes enter {
21
+ from {
22
+ opacity: var(--tw-enter-opacity, 1);
23
+ transform: translate3d(
24
+ var(--tw-enter-translate-x, 0),
25
+ var(--tw-enter-translate-y, 0),
26
+ 0
27
+ )
28
+ scale3d(
29
+ var(--tw-enter-scale, 1),
30
+ var(--tw-enter-scale, 1),
31
+ var(--tw-enter-scale, 1)
32
+ )
33
+ rotate(var(--tw-enter-rotate, 0));
34
+ }
35
+ }
36
+
37
+ @keyframes exit {
38
+ to {
39
+ opacity: var(--tw-exit-opacity, 1);
40
+ transform: translate3d(
41
+ var(--tw-exit-translate-x, 0),
42
+ var(--tw-exit-translate-y, 0),
43
+ 0
44
+ )
45
+ scale3d(
46
+ var(--tw-exit-scale, 1),
47
+ var(--tw-exit-scale, 1),
48
+ var(--tw-exit-scale, 1)
49
+ )
50
+ rotate(var(--tw-exit-rotate, 0));
51
+ }
52
+ }
53
+
54
+ /* =============================================================================
55
+ * Base Animation Utilities
56
+ * ============================================================================= */
57
+
58
+ @utility animate-in {
59
+ animation-name: enter;
60
+ animation-duration: 200ms;
61
+ animation-timing-function: ease-out;
62
+ animation-fill-mode: forwards;
63
+ --tw-enter-opacity: initial;
64
+ --tw-enter-scale: initial;
65
+ --tw-enter-rotate: initial;
66
+ --tw-enter-translate-x: initial;
67
+ --tw-enter-translate-y: initial;
68
+ }
69
+
70
+ @utility animate-out {
71
+ animation-name: exit;
72
+ animation-duration: 150ms;
73
+ animation-timing-function: ease-in;
74
+ animation-fill-mode: forwards;
75
+ --tw-exit-opacity: initial;
76
+ --tw-exit-scale: initial;
77
+ --tw-exit-rotate: initial;
78
+ --tw-exit-translate-x: initial;
79
+ --tw-exit-translate-y: initial;
80
+ }
81
+
82
+ /* =============================================================================
83
+ * Fade Modifiers
84
+ * ============================================================================= */
85
+
86
+ @utility fade-in-0 {
87
+ --tw-enter-opacity: 0;
88
+ }
89
+
90
+ @utility fade-out-0 {
91
+ --tw-exit-opacity: 0;
92
+ }
93
+
94
+ @utility fade-out-80 {
95
+ --tw-exit-opacity: 0.8;
96
+ }
97
+
98
+ /* =============================================================================
99
+ * Zoom/Scale Modifiers
100
+ * ============================================================================= */
101
+
102
+ @utility zoom-in-95 {
103
+ --tw-enter-scale: 0.95;
104
+ }
105
+
106
+ @utility zoom-out-95 {
107
+ --tw-exit-scale: 0.95;
108
+ }
109
+
110
+ /* =============================================================================
111
+ * Slide Modifiers — Bottom
112
+ * ============================================================================= */
113
+
114
+ @utility slide-in-from-bottom-2 {
115
+ --tw-enter-translate-y: 0.5rem;
116
+ }
117
+
118
+ @utility slide-out-to-bottom-2 {
119
+ --tw-exit-translate-y: 0.5rem;
120
+ }
121
+
122
+ @utility slide-in-from-bottom-4 {
123
+ --tw-enter-translate-y: 1rem;
124
+ }
125
+
126
+ @utility slide-out-to-bottom-4 {
127
+ --tw-exit-translate-y: 1rem;
128
+ }
129
+
130
+ /* =============================================================================
131
+ * Slide Modifiers — Top
132
+ * ============================================================================= */
133
+
134
+ @utility slide-in-from-top-2 {
135
+ --tw-enter-translate-y: -0.5rem;
136
+ }
137
+
138
+ @utility slide-out-to-top-2 {
139
+ --tw-exit-translate-y: -0.5rem;
140
+ }
141
+
142
+ /* =============================================================================
143
+ * Slide Modifiers — Left
144
+ * ============================================================================= */
145
+
146
+ @utility slide-in-from-left {
147
+ --tw-enter-translate-x: -100%;
148
+ }
149
+
150
+ @utility slide-in-from-left-2 {
151
+ --tw-enter-translate-x: -0.5rem;
152
+ }
153
+
154
+ @utility slide-out-to-left-2 {
155
+ --tw-exit-translate-x: -0.5rem;
156
+ }
157
+
158
+ /* =============================================================================
159
+ * Slide Modifiers — Right
160
+ * ============================================================================= */
161
+
162
+ @utility slide-in-from-right-2 {
163
+ --tw-enter-translate-x: 0.5rem;
164
+ }
165
+
166
+ @utility slide-out-to-right-2 {
167
+ --tw-exit-translate-x: 0.5rem;
168
+ }
169
+
170
+ @utility slide-out-to-right-full {
171
+ --tw-exit-translate-x: 100%;
172
+ }
@@ -1,2 +1,2 @@
1
- 'use strict';var e="data-[focus-visible]:ring-2 data-[focus-visible]:ring-[var(--themis-ring)] data-[focus-visible]:ring-offset-2",a="data-[pressed]:scale-[0.97]",E="data-[pressed]:transition-transform data-[pressed]:duration-100",r="data-[hovered]:shadow-md",c="data-[hovered]:transition-shadow data-[hovered]:duration-200",t="hc:data-[focus-visible]:outline hc:data-[focus-visible]:outline-4 hc:data-[focus-visible]:outline-offset-2 hc:data-[focus-visible]:outline-foreground",n="hc:data-[hovered]:outline hc:data-[hovered]:outline-2 hc:data-[hovered]:outline-foreground",s="hc:data-[pressed]:outline hc:data-[pressed]:outline-2 hc:data-[pressed]:outline-offset-1 hc:data-[pressed]:outline-foreground",i=`${t} ${n} ${s}`,_="disabled:pointer-events-none disabled:opacity-50",T=`${e} ${a} ${r} ${t} ${n} ${s}`,I=`${e} ${t}`,d="cursor-default select-none";var A=["focus-within:outline-none","focus-within:ring-2","focus-within:ring-[var(--ring)]","focus-within:ring-offset-2"],O=["focus-visible:outline-none","focus-visible:ring-2","focus-visible:ring-[var(--ring)]","focus-visible:ring-offset-2"],R=["focus:outline-none","focus:ring-2","focus:ring-[var(--ring)]"],u=["focus:outline-none","focus:bg-[var(--accent)]","focus:text-[var(--accent-foreground)]"],N=["disabled:pointer-events-none","disabled:opacity-50"],x=["data-[disabled]:pointer-events-none","data-[disabled]:opacity-50","data-[disabled]:cursor-not-allowed"],l={sm:"text-xs",default:"text-sm",lg:"text-base"},p={sm:"text-sm",default:"text-base",lg:"text-lg"},f=["min-h-[44px]","min-w-[44px]"],C={sm:"h-9 w-9",default:"h-11 w-11",lg:"h-14 w-14"},g={sm:"h-9",default:"h-11",lg:"h-14"},L=["flex","items-center","gap-1.5","text-[var(--destructive-background)]"],D=["flex","items-center","gap-1.5","text-[var(--success-background)]"],H=["text-[var(--menu-muted)]"],v=["font-medium","text-[var(--content-foreground)]"],h="after:content-['*'] after:ml-0.5 after:text-[var(--destructive-background)]",m=["data-[entering]:animate-in","data-[entering]:fade-in-0","data-[entering]:zoom-in-95"],U=["data-[exiting]:animate-out","data-[exiting]:fade-out-0","data-[exiting]:zoom-out-95"],b=["motion-reduce:transition-none","motion-reduce:animate-none"],G=["transition-colors","duration-200"],B=["transition-colors","duration-150"],M=["hover:bg-[var(--accent)]","hover:text-[var(--accent-foreground)]"];function F(...S){return S.flatMap(o=>Array.isArray(o)?[...o]:[o])}exports.DEFAULT_INTERACTIONS=T;exports.DESCRIPTION_BASE=H;exports.DISABLED_DATA_ATTR=x;exports.DISABLED_STANDARD=N;exports.DISABLED_STYLES=_;exports.ERROR_MESSAGE_BASE=L;exports.FIELD_HEIGHTS=g;exports.FOCUS_HIGHLIGHT=u;exports.FOCUS_RING=R;exports.FOCUS_STYLES=e;exports.FOCUS_VISIBLE_RING=O;exports.FOCUS_WITHIN_RING=A;exports.HIGH_CONTRAST_FOCUS=t;exports.HIGH_CONTRAST_HOVER=n;exports.HIGH_CONTRAST_INTERACTIONS=i;exports.HIGH_CONTRAST_PRESSED=s;exports.HOVER_ACCENT=M;exports.HOVER_STYLES=r;exports.HOVER_STYLES_BASE=c;exports.INTERACTIVE_SIZES=C;exports.LABEL_BASE=v;exports.NON_INTERACTIVE=d;exports.POPOVER_ANIMATION_IN=m;exports.POPOVER_ANIMATION_OUT=U;exports.PRESSED_STYLES=a;exports.PRESSED_STYLES_BASE=E;exports.REDUCED_MOTION=b;exports.REQUIRED_INDICATOR=h;exports.SUBTLE_INTERACTIONS=I;exports.SUCCESS_MESSAGE_BASE=D;exports.TEXT_SIZE_MEDIUM_SCALE=p;exports.TEXT_SIZE_SMALL_SCALE=l;exports.TOUCH_TARGET_MIN=f;exports.TRANSITION_COLORS=G;exports.TRANSITION_FAST=B;exports.combineStyles=F;//# sourceMappingURL=index.js.map
1
+ 'use strict';var o="data-[focus-visible]:ring-2 data-[focus-visible]:ring-[var(--themis-ring)] data-[focus-visible]:ring-offset-2",s="data-[pressed]:scale-[0.97]",c="data-[pressed]:transition-transform data-[pressed]:duration-100",i="data-[hovered]:shadow-md",S="data-[hovered]:transition-shadow data-[hovered]:duration-200",t="hc:data-[focus-visible]:outline hc:data-[focus-visible]:outline-4 hc:data-[focus-visible]:outline-offset-2 hc:data-[focus-visible]:outline-foreground",n="hc:data-[hovered]:outline hc:data-[hovered]:outline-2 hc:data-[hovered]:outline-foreground",a="hc:data-[pressed]:outline hc:data-[pressed]:outline-2 hc:data-[pressed]:outline-offset-1 hc:data-[pressed]:outline-foreground",d=`${t} ${n} ${a}`,E="disabled:pointer-events-none disabled:opacity-50",_=`${o} ${s} ${i} ${t} ${n} ${a}`,T=`${o} ${t}`,I="cursor-default select-none";var A=["focus-within:outline-none","focus-within:ring-2","focus-within:ring-[var(--ring)]","focus-within:ring-offset-2"],u=["focus-visible:outline-none","focus-visible:ring-2","focus-visible:ring-[var(--ring)]","focus-visible:ring-offset-2"],O=["focus:outline-none","focus:ring-2","focus:ring-[var(--ring)]"],x=["focus:outline-none","focus:bg-[var(--accent)]","focus:text-[var(--accent-foreground)]"],N=["disabled:pointer-events-none","disabled:opacity-50"],R=["data-[disabled]:pointer-events-none","data-[disabled]:opacity-50","data-[disabled]:cursor-not-allowed"],g={sm:"text-xs",default:"text-sm",lg:"text-base"},f={sm:"text-sm",default:"text-base",lg:"text-lg"},p=["min-h-[44px]","min-w-[44px]"],l={sm:"h-9 w-9",default:"h-11 w-11",lg:"h-14 w-14"},C={sm:"h-9",default:"h-11",lg:"h-14"},L=["flex","items-center","gap-1.5","text-[var(--destructive-background)]"],D=["flex","items-center","gap-1.5","text-[var(--success-background)]"],m=["text-[var(--menu-muted)]"],H=["font-medium","text-[var(--content-foreground)]"],v="after:content-['*'] after:ml-0.5 after:text-[var(--destructive-background)]",h=["data-[entering]:animate-in","data-[entering]:fade-in-0","data-[entering]:zoom-in-95"],U=["data-[exiting]:animate-out","data-[exiting]:fade-out-0","data-[exiting]:zoom-out-95"];var b=["motion-reduce:transition-none","motion-reduce:animate-none"],M=["transition-colors","duration-200"],G=["transition-colors","duration-150"],B=["hover:bg-[var(--accent)]","hover:text-[var(--accent-foreground)]"];function V(...r){return r.flatMap(e=>Array.isArray(e)?[...e]:[e])}exports.DEFAULT_INTERACTIONS=_;exports.DESCRIPTION_BASE=m;exports.DISABLED_DATA_ATTR=R;exports.DISABLED_STANDARD=N;exports.DISABLED_STYLES=E;exports.ERROR_MESSAGE_BASE=L;exports.FIELD_HEIGHTS=C;exports.FOCUS_HIGHLIGHT=x;exports.FOCUS_RING=O;exports.FOCUS_STYLES=o;exports.FOCUS_VISIBLE_RING=u;exports.FOCUS_WITHIN_RING=A;exports.HIGH_CONTRAST_FOCUS=t;exports.HIGH_CONTRAST_HOVER=n;exports.HIGH_CONTRAST_INTERACTIONS=d;exports.HIGH_CONTRAST_PRESSED=a;exports.HOVER_ACCENT=B;exports.HOVER_STYLES=i;exports.HOVER_STYLES_BASE=S;exports.INTERACTIVE_SIZES=l;exports.LABEL_BASE=H;exports.NON_INTERACTIVE=I;exports.POPOVER_ANIMATION_IN=h;exports.POPOVER_ANIMATION_OUT=U;exports.PRESSED_STYLES=s;exports.PRESSED_STYLES_BASE=c;exports.REDUCED_MOTION=b;exports.REQUIRED_INDICATOR=v;exports.SUBTLE_INTERACTIONS=T;exports.SUCCESS_MESSAGE_BASE=D;exports.TEXT_SIZE_MEDIUM_SCALE=f;exports.TEXT_SIZE_SMALL_SCALE=g;exports.TOUCH_TARGET_MIN=p;exports.TRANSITION_COLORS=M;exports.TRANSITION_FAST=G;exports.combineStyles=V;//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/styles/interaction-states.ts","../../src/styles/shared-variants.ts"],"names":["FOCUS_STYLES","PRESSED_STYLES","PRESSED_STYLES_BASE","HOVER_STYLES","HOVER_STYLES_BASE","HIGH_CONTRAST_FOCUS","HIGH_CONTRAST_HOVER","HIGH_CONTRAST_PRESSED","HIGH_CONTRAST_INTERACTIONS","DISABLED_STYLES","DEFAULT_INTERACTIONS","SUBTLE_INTERACTIONS","NON_INTERACTIVE","FOCUS_WITHIN_RING","FOCUS_VISIBLE_RING","FOCUS_RING","FOCUS_HIGHLIGHT","DISABLED_STANDARD","DISABLED_DATA_ATTR","TEXT_SIZE_SMALL_SCALE","TEXT_SIZE_MEDIUM_SCALE","TOUCH_TARGET_MIN","INTERACTIVE_SIZES","FIELD_HEIGHTS","ERROR_MESSAGE_BASE","SUCCESS_MESSAGE_BASE","DESCRIPTION_BASE","LABEL_BASE","REQUIRED_INDICATOR","POPOVER_ANIMATION_IN","POPOVER_ANIMATION_OUT","REDUCED_MOTION","TRANSITION_COLORS","TRANSITION_FAST","HOVER_ACCENT","combineStyles","styles","s"],"mappings":"aAoBO,IAAMA,CAAAA,CAAe,gHAUfC,CAAAA,CAAiB,6BAAA,CAKjBC,EAAsB,iEAAA,CAUtBC,CAAAA,CAAe,2BAKfC,CAAAA,CAAoB,8DAAA,CAQpBC,EAAsB,uJAAA,CAMtBC,CAAAA,CAAsB,6FAMtBC,CAAAA,CAAwB,+HAAA,CAMxBC,EAA6B,CAAA,EAAGH,CAAmB,CAAA,CAAA,EAAIC,CAAmB,CAAA,CAAA,EAAIC,CAAqB,GAMnGE,CAAAA,CAAkB,kDAAA,CAWlBC,EAAuB,CAAA,EAAGV,CAAY,IAAIC,CAAc,CAAA,CAAA,EAAIE,CAAY,CAAA,CAAA,EAAIE,CAAmB,CAAA,CAAA,EAAIC,CAAmB,CAAA,CAAA,EAAIC,CAAqB,GAQ/II,CAAAA,CAAsB,CAAA,EAAGX,CAAY,CAAA,CAAA,EAAIK,CAAmB,CAAA,CAAA,CAM5DO,CAAAA,CAAkB,6BC1FxB,IAAMC,EAAoB,CAC/B,2BAAA,CACA,sBACA,iCAAA,CACA,4BACF,EAMaC,CAAAA,CAAqB,CAChC,4BAAA,CACA,sBAAA,CAC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,CAAO,OAAA,CAAQC,CAAAA,EAAK,MAAM,OAAA,CAAQA,CAAC,EAAI,CAAC,GAAGA,CAAC,CAAA,CAAI,CAACA,CAAC,CAAC,CAC5D","file":"index.js","sourcesContent":["/**\n * Global Interaction State Styles\n *\n * Consistent interaction patterns across all Themis components.\n * These styles ensure WCAG 2.2 AAA compliance and predictable UX.\n *\n * @see spec.md FR-010 (Visible focus ring for keyboard navigation)\n * @see spec.md FR-031 (Pressed state feedback)\n * @see spec.md FR-012 (High contrast mode support)\n * @see constitution.md Principle IV (Accessibility First)\n */\n\n/**\n * Focus state styles (FR-010)\n * Visible focus ring for keyboard navigation - WCAG 2.2 Level AAA\n *\n * Components can override by extending these styles:\n * @example\n * cn(FOCUS_STYLES, \"ring-4\") // Increases ring width to 4px\n */\nexport const FOCUS_STYLES = \"data-[focus-visible]:ring-2 data-[focus-visible]:ring-[var(--themis-ring)] data-[focus-visible]:ring-offset-2\";\n\n/**\n * Pressed/Active state styles (FR-031)\n * Visual feedback for press interactions\n *\n * Components can override the scale amount:\n * @example\n * cn(PRESSED_STYLES_BASE, \"data-[pressed]:scale-[0.95]\") // More pronounced scale\n */\nexport const PRESSED_STYLES = \"data-[pressed]:scale-[0.97]\";\n\n/**\n * Base pressed styles without scale (for components that need different feedback)\n */\nexport const PRESSED_STYLES_BASE = \"data-[pressed]:transition-transform data-[pressed]:duration-100\";\n\n/**\n * Hover state styles\n * Elevation change on hover for better affordance\n *\n * Components can override shadow depth:\n * @example\n * cn(HOVER_STYLES_BASE, \"data-[hovered]:shadow-lg\") // Larger shadow\n */\nexport const HOVER_STYLES = \"data-[hovered]:shadow-md\";\n\n/**\n * Base hover styles without shadow (for components that use different hover effects)\n */\nexport const HOVER_STYLES_BASE = \"data-[hovered]:transition-shadow data-[hovered]:duration-200\";\n\n/**\n * High contrast mode focus (FR-012)\n * Enhanced outlines for users requiring high contrast\n *\n * Uses 'hc:' prefix for prefers-contrast: more media query\n */\nexport const HIGH_CONTRAST_FOCUS = \"hc:data-[focus-visible]:outline hc:data-[focus-visible]:outline-4 hc:data-[focus-visible]:outline-offset-2 hc:data-[focus-visible]:outline-foreground\";\n\n/**\n * High contrast mode hover (FR-012)\n * Enhanced outlines for hover in high contrast mode\n */\nexport const HIGH_CONTRAST_HOVER = \"hc:data-[hovered]:outline hc:data-[hovered]:outline-2 hc:data-[hovered]:outline-foreground\";\n\n/**\n * High contrast mode pressed state\n * Enhanced outlines for pressed state in high contrast mode\n */\nexport const HIGH_CONTRAST_PRESSED = \"hc:data-[pressed]:outline hc:data-[pressed]:outline-2 hc:data-[pressed]:outline-offset-1 hc:data-[pressed]:outline-foreground\";\n\n/**\n * Combined high contrast styles\n * Use this for components that need all high contrast interaction states\n */\nexport const HIGH_CONTRAST_INTERACTIONS = `${HIGH_CONTRAST_FOCUS} ${HIGH_CONTRAST_HOVER} ${HIGH_CONTRAST_PRESSED}`;\n\n/**\n * Disabled state styles\n * Consistent disabled appearance across all components\n */\nexport const DISABLED_STYLES = \"disabled:pointer-events-none disabled:opacity-50\";\n\n/**\n * Default interaction bundle\n * Most common combination for interactive components\n *\n * Includes: focus ring, pressed scale, hover shadow, high contrast enhancements\n *\n * @example\n * <button className={cn(DEFAULT_INTERACTIONS, \"bg-primary\")}>Click</button>\n */\nexport const DEFAULT_INTERACTIONS = `${FOCUS_STYLES} ${PRESSED_STYLES} ${HOVER_STYLES} ${HIGH_CONTRAST_FOCUS} ${HIGH_CONTRAST_HOVER} ${HIGH_CONTRAST_PRESSED}`;\n\n/**\n * Subtle interaction bundle\n * For components that need less pronounced feedback\n *\n * Includes: focus ring and high contrast, but no hover shadow or pressed scale\n */\nexport const SUBTLE_INTERACTIONS = `${FOCUS_STYLES} ${HIGH_CONTRAST_FOCUS}`;\n\n/**\n * Non-interactive element styles\n * For elements that should indicate they are not interactive\n */\nexport const NON_INTERACTIVE = \"cursor-default select-none\";\n","/**\n * Shared CVA Variant Utilities\n *\n * Common patterns extracted from component variants for consistency and reduced bundle size.\n * Use these constants in CVA definitions to ensure consistent styling across Themis.\n *\n * @see interaction-states.ts for interaction-specific styles (focus, hover, pressed)\n */\n\n// =============================================================================\n// Focus Ring Patterns\n// =============================================================================\n\n/**\n * Focus-within ring (for container elements with focusable children)\n * Use when the container should show focus when any child is focused\n */\nexport const FOCUS_WITHIN_RING = [\n 'focus-within:outline-none',\n 'focus-within:ring-2',\n 'focus-within:ring-[var(--ring)]',\n 'focus-within:ring-offset-2',\n] as const;\n\n/**\n * Focus-visible ring (for directly focusable elements)\n * Use for buttons, inputs, and other interactive elements\n */\nexport const FOCUS_VISIBLE_RING = [\n 'focus-visible:outline-none',\n 'focus-visible:ring-2',\n 'focus-visible:ring-[var(--ring)]',\n 'focus-visible:ring-offset-2',\n] as const;\n\n/**\n * Standard focus ring (for elements using :focus pseudo-class)\n * Prefer focus-visible when possible for better UX\n */\nexport const FOCUS_RING = [\n 'focus:outline-none',\n 'focus:ring-2',\n 'focus:ring-[var(--ring)]',\n] as const;\n\n/**\n * Focus with background change (for segments, cells, menu items)\n */\nexport const FOCUS_HIGHLIGHT = [\n 'focus:outline-none',\n 'focus:bg-[var(--accent)]',\n 'focus:text-[var(--accent-foreground)]',\n] as const;\n\n// =============================================================================\n// Disabled State Patterns\n// =============================================================================\n\n/**\n * Standard disabled state using disabled attribute\n */\nexport const DISABLED_STANDARD = [\n 'disabled:pointer-events-none',\n 'disabled:opacity-50',\n] as const;\n\n/**\n * Disabled state using data attribute (React Aria pattern)\n */\nexport const DISABLED_DATA_ATTR = [\n 'data-[disabled]:pointer-events-none',\n 'data-[disabled]:opacity-50',\n 'data-[disabled]:cursor-not-allowed',\n] as const;\n\n// =============================================================================\n// Size-Based Text Variants\n// =============================================================================\n\n/**\n * Small text size scale (xs -> sm -> base)\n */\nexport const TEXT_SIZE_SMALL_SCALE = {\n sm: 'text-xs',\n default: 'text-sm',\n lg: 'text-base',\n} as const;\n\n/**\n * Medium text size scale (sm -> base -> lg)\n */\nexport const TEXT_SIZE_MEDIUM_SCALE = {\n sm: 'text-sm',\n default: 'text-base',\n lg: 'text-lg',\n} as const;\n\n// =============================================================================\n// Touch Target Utilities\n// =============================================================================\n\n/**\n * WCAG 2.2 AAA minimum touch target (44x44px)\n */\nexport const TOUCH_TARGET_MIN = [\n 'min-h-[44px]',\n 'min-w-[44px]',\n] as const;\n\n/**\n * Common button/cell sizes with touch target compliance\n */\nexport const INTERACTIVE_SIZES = {\n sm: 'h-9 w-9', // 36px - desktop only, NOT AAA compliant\n default: 'h-11 w-11', // 44px - AAA compliant\n lg: 'h-14 w-14', // 56px - AAA compliant, enhanced\n} as const;\n\n/**\n * Height-only sizes for fields and inputs\n */\nexport const FIELD_HEIGHTS = {\n sm: 'h-9', // 36px\n default: 'h-11', // 44px\n lg: 'h-14', // 56px\n} as const;\n\n// =============================================================================\n// Message/Feedback Patterns\n// =============================================================================\n\n/**\n * Error message styling\n */\nexport const ERROR_MESSAGE_BASE = [\n 'flex',\n 'items-center',\n 'gap-1.5',\n 'text-[var(--destructive-background)]',\n] as const;\n\n/**\n * Success message styling\n */\nexport const SUCCESS_MESSAGE_BASE = [\n 'flex',\n 'items-center',\n 'gap-1.5',\n 'text-[var(--success-background)]',\n] as const;\n\n/**\n * Description/helper text styling\n */\nexport const DESCRIPTION_BASE = [\n 'text-[var(--menu-muted)]',\n] as const;\n\n/**\n * Label base styling\n */\nexport const LABEL_BASE = [\n 'font-medium',\n 'text-[var(--content-foreground)]',\n] as const;\n\n/**\n * Required indicator pattern\n */\nexport const REQUIRED_INDICATOR = \"after:content-['*'] after:ml-0.5 after:text-[var(--destructive-background)]\";\n\n// =============================================================================\n// Animation Patterns\n// =============================================================================\n\n/**\n * Popover/dropdown entry animation\n */\nexport const POPOVER_ANIMATION_IN = [\n 'data-[entering]:animate-in',\n 'data-[entering]:fade-in-0',\n 'data-[entering]:zoom-in-95',\n] as const;\n\n/**\n * Popover/dropdown exit animation\n */\nexport const POPOVER_ANIMATION_OUT = [\n 'data-[exiting]:animate-out',\n 'data-[exiting]:fade-out-0',\n 'data-[exiting]:zoom-out-95',\n] as const;\n\n/**\n * Reduced motion support (WCAG 2.2)\n */\nexport const REDUCED_MOTION = [\n 'motion-reduce:transition-none',\n 'motion-reduce:animate-none',\n] as const;\n\n/**\n * Standard transition for colors\n */\nexport const TRANSITION_COLORS = [\n 'transition-colors',\n 'duration-200',\n] as const;\n\n/**\n * Fast transition for interactions\n */\nexport const TRANSITION_FAST = [\n 'transition-colors',\n 'duration-150',\n] as const;\n\n// =============================================================================\n// Hover State Patterns\n// =============================================================================\n\n/**\n * Accent background on hover (for interactive items)\n */\nexport const HOVER_ACCENT = [\n 'hover:bg-[var(--accent)]',\n 'hover:text-[var(--accent-foreground)]',\n] as const;\n\n// =============================================================================\n// Helper Functions\n// =============================================================================\n\n/**\n * Combines multiple style arrays into a flat array for CVA base styles\n */\nexport function combineStyles(...styles: (readonly string[] | string)[]): string[] {\n return styles.flatMap(s => Array.isArray(s) ? [...s] : [s]);\n}\n"]}
1
+ {"version":3,"sources":["../../src/styles/interaction-states.ts","../../src/styles/shared-variants.ts"],"names":["FOCUS_STYLES","PRESSED_STYLES","PRESSED_STYLES_BASE","HOVER_STYLES","HOVER_STYLES_BASE","HIGH_CONTRAST_FOCUS","HIGH_CONTRAST_HOVER","HIGH_CONTRAST_PRESSED","HIGH_CONTRAST_INTERACTIONS","DISABLED_STYLES","DEFAULT_INTERACTIONS","SUBTLE_INTERACTIONS","NON_INTERACTIVE","FOCUS_WITHIN_RING","FOCUS_VISIBLE_RING","FOCUS_RING","FOCUS_HIGHLIGHT","DISABLED_STANDARD","DISABLED_DATA_ATTR","TEXT_SIZE_SMALL_SCALE","TEXT_SIZE_MEDIUM_SCALE","TOUCH_TARGET_MIN","INTERACTIVE_SIZES","FIELD_HEIGHTS","ERROR_MESSAGE_BASE","SUCCESS_MESSAGE_BASE","DESCRIPTION_BASE","LABEL_BASE","REQUIRED_INDICATOR","POPOVER_ANIMATION_IN","POPOVER_ANIMATION_OUT","REDU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A,cACF,EAKaC,CAAAA,CAAoB,CAC/B,EAAA,CAAI,SAAA,CACJ,OAAA,CAAS,WAAA,CACT,GAAI,WACN,CAAA,CAKaC,EAAgB,CAC3B,EAAA,CAAI,MACJ,OAAA,CAAS,MAAA,CACT,EAAA,CAAI,MACN,CAAA,CASaC,CAAAA,CAAqB,CAChC,MAAA,CACA,cAAA,CACA,UACA,sCACF,CAAA,CAKaC,EAAuB,CAClC,MAAA,CACA,cAAA,CACA,SAAA,CACA,kCACF,CAAA,CAKaC,EAAmB,CAC9B,0BACF,EAKaC,CAAAA,CAAa,CACxB,cACA,kCACF,CAAA,CAKaC,CAAAA,CAAqB,6EAAA,CASrBC,CAAAA,CAAuB,CAClC,6BACA,2BAAA,CACA,4BACF,EAKaC,CAAAA,CAAwB,CACnC,6BACA,2BAAA,CACA,4BACF,EAkEO,IAAMC,CAAAA,CAAiB,CAC5B,gCACA,4BACF,CAAA,CAKaC,EAAoB,CAC/B,mBAAA,CACA,cACF,CAAA,CAKaC,CAAAA,CAAkB,CAC7B,mBAAA,CACA,cACF,CAAA,CASaC,EAAe,CAC1B,0BAAA,CACA,uCACF,EASO,SAASC,KAAiBC,CAAAA,CAAkD,CACjF,OAAOA,CAAAA,CAAO,OAAA,CAAQC,CAAAA,EAAK,MAAM,OAAA,CAAQA,CAAC,EAAI,CAAC,GAAGA,CAAC,CAAA,CAAI,CAACA,CAAC,CAAC,CAC5D","file":"index.js","sourcesContent":["/**\n * Global Interaction State Styles\n *\n * Consistent interaction patterns across all Themis components.\n * These styles ensure WCAG 2.2 AAA compliance and predictable UX.\n *\n * @see spec.md FR-010 (Visible focus ring for keyboard navigation)\n * @see spec.md FR-031 (Pressed state feedback)\n * @see spec.md FR-012 (High contrast mode support)\n * @see constitution.md Principle IV (Accessibility First)\n */\n\n/**\n * Focus state styles (FR-010)\n * Visible focus ring for keyboard navigation - WCAG 2.2 Level AAA\n *\n * Components can override by extending these styles:\n * @example\n * cn(FOCUS_STYLES, \"ring-4\") // Increases ring width to 4px\n */\nexport const FOCUS_STYLES = \"data-[focus-visible]:ring-2 data-[focus-visible]:ring-[var(--themis-ring)] data-[focus-visible]:ring-offset-2\";\n\n/**\n * Pressed/Active state styles (FR-031)\n * Visual feedback for press interactions\n *\n * Components can override the scale amount:\n * @example\n * cn(PRESSED_STYLES_BASE, \"data-[pressed]:scale-[0.95]\") // More pronounced scale\n */\nexport const PRESSED_STYLES = \"data-[pressed]:scale-[0.97]\";\n\n/**\n * Base pressed styles without scale (for components that need different feedback)\n */\nexport const PRESSED_STYLES_BASE = \"data-[pressed]:transition-transform data-[pressed]:duration-100\";\n\n/**\n * Hover state styles\n * Elevation change on hover for better affordance\n *\n * Components can override shadow depth:\n * @example\n * cn(HOVER_STYLES_BASE, \"data-[hovered]:shadow-lg\") // Larger shadow\n */\nexport const HOVER_STYLES = \"data-[hovered]:shadow-md\";\n\n/**\n * Base hover styles without shadow (for components that use different hover effects)\n */\nexport const HOVER_STYLES_BASE = \"data-[hovered]:transition-shadow data-[hovered]:duration-200\";\n\n/**\n * High contrast mode focus (FR-012)\n * Enhanced outlines for users requiring high contrast\n *\n * Uses 'hc:' prefix for prefers-contrast: more media query\n */\nexport const HIGH_CONTRAST_FOCUS = \"hc:data-[focus-visible]:outline hc:data-[focus-visible]:outline-4 hc:data-[focus-visible]:outline-offset-2 hc:data-[focus-visible]:outline-foreground\";\n\n/**\n * High contrast mode hover (FR-012)\n * Enhanced outlines for hover in high contrast mode\n */\nexport const HIGH_CONTRAST_HOVER = \"hc:data-[hovered]:outline hc:data-[hovered]:outline-2 hc:data-[hovered]:outline-foreground\";\n\n/**\n * High contrast mode pressed state\n * Enhanced outlines for pressed state in high contrast mode\n */\nexport const HIGH_CONTRAST_PRESSED = \"hc:data-[pressed]:outline hc:data-[pressed]:outline-2 hc:data-[pressed]:outline-offset-1 hc:data-[pressed]:outline-foreground\";\n\n/**\n * Combined high contrast styles\n * Use this for components that need all high contrast interaction states\n */\nexport const HIGH_CONTRAST_INTERACTIONS = `${HIGH_CONTRAST_FOCUS} ${HIGH_CONTRAST_HOVER} ${HIGH_CONTRAST_PRESSED}`;\n\n/**\n * Disabled state styles\n * Consistent disabled appearance across all components\n */\nexport const DISABLED_STYLES = \"disabled:pointer-events-none disabled:opacity-50\";\n\n/**\n * Default interaction bundle\n * Most common combination for interactive components\n *\n * Includes: focus ring, pressed scale, hover shadow, high contrast enhancements\n *\n * @example\n * <button className={cn(DEFAULT_INTERACTIONS, \"bg-primary\")}>Click</button>\n */\nexport const DEFAULT_INTERACTIONS = `${FOCUS_STYLES} ${PRESSED_STYLES} ${HOVER_STYLES} ${HIGH_CONTRAST_FOCUS} ${HIGH_CONTRAST_HOVER} ${HIGH_CONTRAST_PRESSED}`;\n\n/**\n * Subtle interaction bundle\n * For components that need less pronounced feedback\n *\n * Includes: focus ring and high contrast, but no hover shadow or pressed scale\n */\nexport const SUBTLE_INTERACTIONS = `${FOCUS_STYLES} ${HIGH_CONTRAST_FOCUS}`;\n\n/**\n * Non-interactive element styles\n * For elements that should indicate they are not interactive\n */\nexport const NON_INTERACTIVE = \"cursor-default select-none\";\n","/**\n * Shared CVA Variant Utilities\n *\n * Common patterns extracted from component variants for consistency and reduced bundle size.\n * Use these constants in CVA definitions to ensure consistent styling across Themis.\n *\n * @see interaction-states.ts for interaction-specific styles (focus, hover, pressed)\n */\n\n// =============================================================================\n// Focus Ring Patterns\n// =============================================================================\n\n/**\n * Focus-within ring (for container elements with focusable children)\n * Use when the container should show focus when any child is focused\n */\nexport const FOCUS_WITHIN_RING = [\n 'focus-within:outline-none',\n 'focus-within:ring-2',\n 'focus-within:ring-[var(--ring)]',\n 'focus-within:ring-offset-2',\n] as const;\n\n/**\n * Focus-visible ring (for directly focusable elements)\n * Use for buttons, inputs, and other interactive elements\n */\nexport const FOCUS_VISIBLE_RING = [\n 'focus-visible:outline-none',\n 'focus-visible:ring-2',\n 'focus-visible:ring-[var(--ring)]',\n 'focus-visible:ring-offset-2',\n] as const;\n\n/**\n * Standard focus ring (for elements using :focus pseudo-class)\n * Prefer focus-visible when possible for better UX\n */\nexport const FOCUS_RING = [\n 'focus:outline-none',\n 'focus:ring-2',\n 'focus:ring-[var(--ring)]',\n] as const;\n\n/**\n * Focus with background change (for segments, cells, menu items)\n */\nexport const FOCUS_HIGHLIGHT = [\n 'focus:outline-none',\n 'focus:bg-[var(--accent)]',\n 'focus:text-[var(--accent-foreground)]',\n] as const;\n\n// =============================================================================\n// Disabled State Patterns\n// =============================================================================\n\n/**\n * Standard disabled state using disabled attribute\n */\nexport const DISABLED_STANDARD = [\n 'disabled:pointer-events-none',\n 'disabled:opacity-50',\n] as const;\n\n/**\n * Disabled state using data attribute (React Aria pattern)\n */\nexport const DISABLED_DATA_ATTR = [\n 'data-[disabled]:pointer-events-none',\n 'data-[disabled]:opacity-50',\n 'data-[disabled]:cursor-not-allowed',\n] as const;\n\n// =============================================================================\n// Size-Based Text Variants\n// =============================================================================\n\n/**\n * Small text size scale (xs -> sm -> base)\n */\nexport const TEXT_SIZE_SMALL_SCALE = {\n sm: 'text-xs',\n default: 'text-sm',\n lg: 'text-base',\n} as const;\n\n/**\n * Medium text size scale (sm -> base -> lg)\n */\nexport const TEXT_SIZE_MEDIUM_SCALE = {\n sm: 'text-sm',\n default: 'text-base',\n lg: 'text-lg',\n} as const;\n\n// =============================================================================\n// Touch Target Utilities\n// =============================================================================\n\n/**\n * WCAG 2.2 AAA minimum touch target (44x44px)\n */\nexport const TOUCH_TARGET_MIN = [\n 'min-h-[44px]',\n 'min-w-[44px]',\n] as const;\n\n/**\n * Common button/cell sizes with touch target compliance\n */\nexport const INTERACTIVE_SIZES = {\n sm: 'h-9 w-9', // 36px - desktop only, NOT AAA compliant\n default: 'h-11 w-11', // 44px - AAA compliant\n lg: 'h-14 w-14', // 56px - AAA compliant, enhanced\n} as const;\n\n/**\n * Height-only sizes for fields and inputs\n */\nexport const FIELD_HEIGHTS = {\n sm: 'h-9', // 36px\n default: 'h-11', // 44px\n lg: 'h-14', // 56px\n} as const;\n\n// =============================================================================\n// Message/Feedback Patterns\n// =============================================================================\n\n/**\n * Error message styling\n */\nexport const ERROR_MESSAGE_BASE = [\n 'flex',\n 'items-center',\n 'gap-1.5',\n 'text-[var(--destructive-background)]',\n] as const;\n\n/**\n * Success message styling\n */\nexport const SUCCESS_MESSAGE_BASE = [\n 'flex',\n 'items-center',\n 'gap-1.5',\n 'text-[var(--success-background)]',\n] as const;\n\n/**\n * Description/helper text styling\n */\nexport const DESCRIPTION_BASE = [\n 'text-[var(--menu-muted)]',\n] as const;\n\n/**\n * Label base styling\n */\nexport const LABEL_BASE = [\n 'font-medium',\n 'text-[var(--content-foreground)]',\n] as const;\n\n/**\n * Required indicator pattern\n */\nexport const REQUIRED_INDICATOR = \"after:content-['*'] after:ml-0.5 after:text-[var(--destructive-background)]\";\n\n// =============================================================================\n// Animation Patterns\n// =============================================================================\n\n/**\n * Popover/dropdown entry animation\n */\nexport const POPOVER_ANIMATION_IN = [\n 'data-[entering]:animate-in',\n 'data-[entering]:fade-in-0',\n 'data-[entering]:zoom-in-95',\n] as const;\n\n/**\n * Popover/dropdown exit animation\n */\nexport const POPOVER_ANIMATION_OUT = [\n 'data-[exiting]:animate-out',\n 'data-[exiting]:fade-out-0',\n 'data-[exiting]:zoom-out-95',\n] as const;\n\n/**\n * Modal content enter animation (fade + zoom)\n * Uses React Aria data-[entering]/data-[exiting] attributes\n */\nexport const MODAL_ANIMATION_IN = [\n 'data-[entering]:animate-in',\n 'data-[entering]:fade-in-0',\n 'data-[entering]:zoom-in-95',\n 'data-[entering]:duration-200',\n 'data-[entering]:ease-out',\n] as const;\n\n/**\n * Modal content exit animation (fade + zoom)\n * Uses React Aria data-[entering]/data-[exiting] attributes\n */\nexport const MODAL_ANIMATION_OUT = [\n 'data-[exiting]:animate-out',\n 'data-[exiting]:fade-out-0',\n 'data-[exiting]:zoom-out-95',\n 'data-[exiting]:duration-150',\n 'data-[exiting]:ease-in',\n] as const;\n\n/**\n * Modal slide enter animation (fade + slide up)\n */\nexport const MODAL_SLIDE_IN = [\n 'data-[entering]:animate-in',\n 'data-[entering]:fade-in-0',\n 'data-[entering]:slide-in-from-bottom-4',\n 'data-[entering]:duration-200',\n 'data-[entering]:ease-out',\n] as const;\n\n/**\n * Modal slide exit animation (fade + slide down)\n */\nexport const MODAL_SLIDE_OUT = [\n 'data-[exiting]:animate-out',\n 'data-[exiting]:fade-out-0',\n 'data-[exiting]:slide-out-to-bottom-4',\n 'data-[exiting]:duration-150',\n 'data-[exiting]:ease-in',\n] as const;\n\n/**\n * Modal overlay enter/exit animation (fade only)\n */\nexport const MODAL_OVERLAY_IN = [\n 'data-[entering]:animate-in',\n 'data-[entering]:fade-in-0',\n 'data-[entering]:duration-200',\n] as const;\n\nexport const MODAL_OVERLAY_OUT = [\n 'data-[exiting]:animate-out',\n 'data-[exiting]:fade-out-0',\n 'data-[exiting]:duration-150',\n] as const;\n\n/**\n * Reduced motion support (WCAG 2.2)\n */\nexport const REDUCED_MOTION = [\n 'motion-reduce:transition-none',\n 'motion-reduce:animate-none',\n] as const;\n\n/**\n * Standard transition for colors\n */\nexport const TRANSITION_COLORS = [\n 'transition-colors',\n 'duration-200',\n] as const;\n\n/**\n * Fast transition for interactions\n */\nexport const TRANSITION_FAST = [\n 'transition-colors',\n 'duration-150',\n] as const;\n\n// =============================================================================\n// Hover State Patterns\n// =============================================================================\n\n/**\n * Accent background on hover (for interactive items)\n */\nexport const HOVER_ACCENT = [\n 'hover:bg-[var(--accent)]',\n 'hover:text-[var(--accent-foreground)]',\n] as const;\n\n// =============================================================================\n// Helper Functions\n// =============================================================================\n\n/**\n * Combines multiple style arrays into a flat array for CVA base styles\n */\nexport function combineStyles(...styles: (readonly string[] | string)[]): string[] {\n return styles.flatMap(s => Array.isArray(s) ? [...s] : [s]);\n}\n"]}
@@ -1,2 +1,2 @@
1
- var e="data-[focus-visible]:ring-2 data-[focus-visible]:ring-[var(--themis-ring)] data-[focus-visible]:ring-offset-2",a="data-[pressed]:scale-[0.97]",E="data-[pressed]:transition-transform data-[pressed]:duration-100",r="data-[hovered]:shadow-md",c="data-[hovered]:transition-shadow data-[hovered]:duration-200",t="hc:data-[focus-visible]:outline hc:data-[focus-visible]:outline-4 hc:data-[focus-visible]:outline-offset-2 hc:data-[focus-visible]:outline-foreground",n="hc:data-[hovered]:outline hc:data-[hovered]:outline-2 hc:data-[hovered]:outline-foreground",s="hc:data-[pressed]:outline hc:data-[pressed]:outline-2 hc:data-[pressed]:outline-offset-1 hc:data-[pressed]:outline-foreground",i=`${t} ${n} ${s}`,_="disabled:pointer-events-none disabled:opacity-50",T=`${e} ${a} ${r} ${t} ${n} ${s}`,I=`${e} ${t}`,d="cursor-default select-none";var A=["focus-within:outline-none","focus-within:ring-2","focus-within:ring-[var(--ring)]","focus-within:ring-offset-2"],O=["focus-visible:outline-none","focus-visible:ring-2","focus-visible:ring-[var(--ring)]","focus-visible:ring-offset-2"],R=["focus:outline-none","focus:ring-2","focus:ring-[var(--ring)]"],u=["focus:outline-none","focus:bg-[var(--accent)]","focus:text-[var(--accent-foreground)]"],N=["disabled:pointer-events-none","disabled:opacity-50"],x=["data-[disabled]:pointer-events-none","data-[disabled]:opacity-50","data-[disabled]:cursor-not-allowed"],l={sm:"text-xs",default:"text-sm",lg:"text-base"},p={sm:"text-sm",default:"text-base",lg:"text-lg"},f=["min-h-[44px]","min-w-[44px]"],C={sm:"h-9 w-9",default:"h-11 w-11",lg:"h-14 w-14"},g={sm:"h-9",default:"h-11",lg:"h-14"},L=["flex","items-center","gap-1.5","text-[var(--destructive-background)]"],D=["flex","items-center","gap-1.5","text-[var(--success-background)]"],H=["text-[var(--menu-muted)]"],v=["font-medium","text-[var(--content-foreground)]"],h="after:content-['*'] after:ml-0.5 after:text-[var(--destructive-background)]",m=["data-[entering]:animate-in","data-[entering]:fade-in-0","data-[entering]:zoom-in-95"],U=["data-[exiting]:animate-out","data-[exiting]:fade-out-0","data-[exiting]:zoom-out-95"],b=["motion-reduce:transition-none","motion-reduce:animate-none"],G=["transition-colors","duration-200"],B=["transition-colors","duration-150"],M=["hover:bg-[var(--accent)]","hover:text-[var(--accent-foreground)]"];function F(...S){return S.flatMap(o=>Array.isArray(o)?[...o]:[o])}export{T as DEFAULT_INTERACTIONS,H as DESCRIPTION_BASE,x as DISABLED_DATA_ATTR,N as DISABLED_STANDARD,_ as DISABLED_STYLES,L as ERROR_MESSAGE_BASE,g as FIELD_HEIGHTS,u as FOCUS_HIGHLIGHT,R as FOCUS_RING,e as FOCUS_STYLES,O as FOCUS_VISIBLE_RING,A as FOCUS_WITHIN_RING,t as HIGH_CONTRAST_FOCUS,n as HIGH_CONTRAST_HOVER,i as HIGH_CONTRAST_INTERACTIONS,s as HIGH_CONTRAST_PRESSED,M as HOVER_ACCENT,r as HOVER_STYLES,c as HOVER_STYLES_BASE,C as INTERACTIVE_SIZES,v as LABEL_BASE,d as NON_INTERACTIVE,m as POPOVER_ANIMATION_IN,U as POPOVER_ANIMATION_OUT,a as PRESSED_STYLES,E as PRESSED_STYLES_BASE,b as REDUCED_MOTION,h as REQUIRED_INDICATOR,I as SUBTLE_INTERACTIONS,D as SUCCESS_MESSAGE_BASE,p as TEXT_SIZE_MEDIUM_SCALE,l as TEXT_SIZE_SMALL_SCALE,f as TOUCH_TARGET_MIN,G as TRANSITION_COLORS,B as TRANSITION_FAST,F as combineStyles};//# sourceMappingURL=index.mjs.map
1
+ var o="data-[focus-visible]:ring-2 data-[focus-visible]:ring-[var(--themis-ring)] data-[focus-visible]:ring-offset-2",s="data-[pressed]:scale-[0.97]",c="data-[pressed]:transition-transform data-[pressed]:duration-100",i="data-[hovered]:shadow-md",S="data-[hovered]:transition-shadow data-[hovered]:duration-200",t="hc:data-[focus-visible]:outline hc:data-[focus-visible]:outline-4 hc:data-[focus-visible]:outline-offset-2 hc:data-[focus-visible]:outline-foreground",n="hc:data-[hovered]:outline hc:data-[hovered]:outline-2 hc:data-[hovered]:outline-foreground",a="hc:data-[pressed]:outline hc:data-[pressed]:outline-2 hc:data-[pressed]:outline-offset-1 hc:data-[pressed]:outline-foreground",d=`${t} ${n} ${a}`,E="disabled:pointer-events-none disabled:opacity-50",_=`${o} ${s} ${i} ${t} ${n} ${a}`,T=`${o} ${t}`,I="cursor-default select-none";var A=["focus-within:outline-none","focus-within:ring-2","focus-within:ring-[var(--ring)]","focus-within:ring-offset-2"],u=["focus-visible:outline-none","focus-visible:ring-2","focus-visible:ring-[var(--ring)]","focus-visible:ring-offset-2"],O=["focus:outline-none","focus:ring-2","focus:ring-[var(--ring)]"],x=["focus:outline-none","focus:bg-[var(--accent)]","focus:text-[var(--accent-foreground)]"],N=["disabled:pointer-events-none","disabled:opacity-50"],R=["data-[disabled]:pointer-events-none","data-[disabled]:opacity-50","data-[disabled]:cursor-not-allowed"],g={sm:"text-xs",default:"text-sm",lg:"text-base"},f={sm:"text-sm",default:"text-base",lg:"text-lg"},p=["min-h-[44px]","min-w-[44px]"],l={sm:"h-9 w-9",default:"h-11 w-11",lg:"h-14 w-14"},C={sm:"h-9",default:"h-11",lg:"h-14"},L=["flex","items-center","gap-1.5","text-[var(--destructive-background)]"],D=["flex","items-center","gap-1.5","text-[var(--success-background)]"],m=["text-[var(--menu-muted)]"],H=["font-medium","text-[var(--content-foreground)]"],v="after:content-['*'] after:ml-0.5 after:text-[var(--destructive-background)]",h=["data-[entering]:animate-in","data-[entering]:fade-in-0","data-[entering]:zoom-in-95"],U=["data-[exiting]:animate-out","data-[exiting]:fade-out-0","data-[exiting]:zoom-out-95"];var b=["motion-reduce:transition-none","motion-reduce:animate-none"],M=["transition-colors","duration-200"],G=["transition-colors","duration-150"],B=["hover:bg-[var(--accent)]","hover:text-[var(--accent-foreground)]"];function V(...r){return r.flatMap(e=>Array.isArray(e)?[...e]:[e])}export{_ as DEFAULT_INTERACTIONS,m as DESCRIPTION_BASE,R as DISABLED_DATA_ATTR,N as DISABLED_STANDARD,E as DISABLED_STYLES,L as ERROR_MESSAGE_BASE,C as FIELD_HEIGHTS,x as FOCUS_HIGHLIGHT,O as FOCUS_RING,o as FOCUS_STYLES,u as FOCUS_VISIBLE_RING,A as FOCUS_WITHIN_RING,t as HIGH_CONTRAST_FOCUS,n as HIGH_CONTRAST_HOVER,d as HIGH_CONTRAST_INTERACTIONS,a as HIGH_CONTRAST_PRESSED,B as HOVER_ACCENT,i as HOVER_STYLES,S as HOVER_STYLES_BASE,l as INTERACTIVE_SIZES,H as LABEL_BASE,I as NON_INTERACTIVE,h as POPOVER_ANIMATION_IN,U as POPOVER_ANIMATION_OUT,s as PRESSED_STYLES,c as PRESSED_STYLES_BASE,b as REDUCED_MOTION,v as REQUIRED_INDICATOR,T as SUBTLE_INTERACTIONS,D as SUCCESS_MESSAGE_BASE,f as TEXT_SIZE_MEDIUM_SCALE,g as TEXT_SIZE_SMALL_SCALE,p as TOUCH_TARGET_MIN,M as TRANSITION_COLORS,G as TRANSITION_FAST,V as combineStyles};//# sourceMappingURL=index.mjs.map
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/styles/interaction-states.ts","../../src/styles/shared-variants.ts"],"names":["FOCUS_STYLES","PRESSED_STYLES","PRESSED_STYLES_BASE","HOVER_STYLES","HOVER_STYLES_BASE","HIGH_CONTRAST_FOCUS","HIGH_CONTRAST_HOVER","HIGH_CONTRAST_PRESSED","HIGH_CONTRAST_INTERACTIONS","DISABLED_STYLES","DEFAULT_INTERACTIONS","SUBTLE_INTERACTIONS","NON_INTERACTIVE","FOCUS_WITHIN_RING","FOCUS_VISIBLE_RING","FOCUS_RING","FOCUS_HIGHLIGHT","DISABLED_STANDARD","DISABLED_DATA_ATTR","TEXT_SIZE_SMALL_SCALE","TEXT_SIZE_MEDIUM_SCALE","TOUCH_TARGET_MIN","INTERACTIVE_SIZES","FIELD_HEIGHTS","ERROR_MESSAGE_BASE","SUCCESS_MESSAGE_BASE","DESCRIPTION_BASE","LABEL_BASE","REQUIRED_INDICATOR","POPOVER_ANIM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AC9B,cAAA,CACA,cACF,CAAA,CAKaC,CAAAA,CAAoB,CAC/B,EAAA,CAAI,SAAA,CACJ,OAAA,CAAS,YACT,EAAA,CAAI,WACN,EAKaC,CAAAA,CAAgB,CAC3B,GAAI,KAAA,CACJ,OAAA,CAAS,MAAA,CACT,EAAA,CAAI,MACN,CAAA,CASaC,EAAqB,CAChC,MAAA,CACA,eACA,SAAA,CACA,sCACF,EAKaC,CAAAA,CAAuB,CAClC,MAAA,CACA,cAAA,CACA,SAAA,CACA,kCACF,EAKaC,CAAAA,CAAmB,CAC9B,0BACF,CAAA,CAKaC,CAAAA,CAAa,CACxB,aAAA,CACA,kCACF,CAAA,CAKaC,CAAAA,CAAqB,6EAAA,CASrBC,CAAAA,CAAuB,CAClC,4BAAA,CACA,2BAAA,CACA,4BACF,CAAA,CAKaC,CAAAA,CAAwB,CACnC,4BAAA,CACA,2BAAA,CACA,4BACF,CAAA,CAKaC,CAAAA,CAAiB,CAC5B,gCACA,4BACF,CAAA,CAKaC,EAAoB,CAC/B,mBAAA,CACA,cACF,CAAA,CAKaC,CAAAA,CAAkB,CAC7B,mBAAA,CACA,cACF,CAAA,CASaC,EAAe,CAC1B,0BAAA,CACA,uCACF,EASO,SAASC,KAAiBC,CAAAA,CAAkD,CACjF,OAAOA,CAAAA,CAAO,OAAA,CAAQC,CAAAA,EAAK,MAAM,OAAA,CAAQA,CAAC,EAAI,CAAC,GAAGA,CAAC,CAAA,CAAI,CAACA,CAAC,CAAC,CAC5D","file":"index.mjs","sourcesContent":["/**\n * Global Interaction State Styles\n *\n * Consistent interaction patterns across all Themis components.\n * These styles ensure WCAG 2.2 AAA compliance and predictable UX.\n *\n * @see spec.md FR-010 (Visible focus ring for keyboard navigation)\n * @see spec.md FR-031 (Pressed state feedback)\n * @see spec.md FR-012 (High contrast mode support)\n * @see constitution.md Principle IV (Accessibility First)\n */\n\n/**\n * Focus state styles (FR-010)\n * Visible focus ring for keyboard navigation - WCAG 2.2 Level AAA\n *\n * Components can override by extending these styles:\n * @example\n * cn(FOCUS_STYLES, \"ring-4\") // Increases ring width to 4px\n */\nexport const FOCUS_STYLES = \"data-[focus-visible]:ring-2 data-[focus-visible]:ring-[var(--themis-ring)] data-[focus-visible]:ring-offset-2\";\n\n/**\n * Pressed/Active state styles (FR-031)\n * Visual feedback for press interactions\n *\n * Components can override the scale amount:\n * @example\n * cn(PRESSED_STYLES_BASE, \"data-[pressed]:scale-[0.95]\") // More pronounced scale\n */\nexport const PRESSED_STYLES = \"data-[pressed]:scale-[0.97]\";\n\n/**\n * Base pressed styles without scale (for components that need different feedback)\n */\nexport const PRESSED_STYLES_BASE = \"data-[pressed]:transition-transform data-[pressed]:duration-100\";\n\n/**\n * Hover state styles\n * Elevation change on hover for better affordance\n *\n * Components can override shadow depth:\n * @example\n * cn(HOVER_STYLES_BASE, \"data-[hovered]:shadow-lg\") // Larger shadow\n */\nexport const HOVER_STYLES = \"data-[hovered]:shadow-md\";\n\n/**\n * Base hover styles without shadow (for components that use different hover effects)\n */\nexport const HOVER_STYLES_BASE = \"data-[hovered]:transition-shadow data-[hovered]:duration-200\";\n\n/**\n * High contrast mode focus (FR-012)\n * Enhanced outlines for users requiring high contrast\n *\n * Uses 'hc:' prefix for prefers-contrast: more media query\n */\nexport const HIGH_CONTRAST_FOCUS = \"hc:data-[focus-visible]:outline hc:data-[focus-visible]:outline-4 hc:data-[focus-visible]:outline-offset-2 hc:data-[focus-visible]:outline-foreground\";\n\n/**\n * High contrast mode hover (FR-012)\n * Enhanced outlines for hover in high contrast mode\n */\nexport const HIGH_CONTRAST_HOVER = \"hc:data-[hovered]:outline hc:data-[hovered]:outline-2 hc:data-[hovered]:outline-foreground\";\n\n/**\n * High contrast mode pressed state\n * Enhanced outlines for pressed state in high contrast mode\n */\nexport const HIGH_CONTRAST_PRESSED = \"hc:data-[pressed]:outline hc:data-[pressed]:outline-2 hc:data-[pressed]:outline-offset-1 hc:data-[pressed]:outline-foreground\";\n\n/**\n * Combined high contrast styles\n * Use this for components that need all high contrast interaction states\n */\nexport const HIGH_CONTRAST_INTERACTIONS = `${HIGH_CONTRAST_FOCUS} ${HIGH_CONTRAST_HOVER} ${HIGH_CONTRAST_PRESSED}`;\n\n/**\n * Disabled state styles\n * Consistent disabled appearance across all components\n */\nexport const DISABLED_STYLES = \"disabled:pointer-events-none disabled:opacity-50\";\n\n/**\n * Default interaction bundle\n * Most common combination for interactive components\n *\n * Includes: focus ring, pressed scale, hover shadow, high contrast enhancements\n *\n * @example\n * <button className={cn(DEFAULT_INTERACTIONS, \"bg-primary\")}>Click</button>\n */\nexport const DEFAULT_INTERACTIONS = `${FOCUS_STYLES} ${PRESSED_STYLES} ${HOVER_STYLES} ${HIGH_CONTRAST_FOCUS} ${HIGH_CONTRAST_HOVER} ${HIGH_CONTRAST_PRESSED}`;\n\n/**\n * Subtle interaction bundle\n * For components that need less pronounced feedback\n *\n * Includes: focus ring and high contrast, but no hover shadow or pressed scale\n */\nexport const SUBTLE_INTERACTIONS = `${FOCUS_STYLES} ${HIGH_CONTRAST_FOCUS}`;\n\n/**\n * Non-interactive element styles\n * For elements that should indicate they are not interactive\n */\nexport const NON_INTERACTIVE = \"cursor-default select-none\";\n","/**\n * Shared CVA Variant Utilities\n *\n * Common patterns extracted from component variants for consistency and reduced bundle size.\n * Use these constants in CVA definitions to ensure consistent styling across Themis.\n *\n * @see interaction-states.ts for interaction-specific styles (focus, hover, pressed)\n */\n\n// =============================================================================\n// Focus Ring Patterns\n// =============================================================================\n\n/**\n * Focus-within ring (for container elements with focusable children)\n * Use when the container should show focus when any child is focused\n */\nexport const FOCUS_WITHIN_RING = [\n 'focus-within:outline-none',\n 'focus-within:ring-2',\n 'focus-within:ring-[var(--ring)]',\n 'focus-within:ring-offset-2',\n] as const;\n\n/**\n * Focus-visible ring (for directly focusable elements)\n * Use for buttons, inputs, and other interactive elements\n */\nexport const FOCUS_VISIBLE_RING = [\n 'focus-visible:outline-none',\n 'focus-visible:ring-2',\n 'focus-visible:ring-[var(--ring)]',\n 'focus-visible:ring-offset-2',\n] as const;\n\n/**\n * Standard focus ring (for elements using :focus pseudo-class)\n * Prefer focus-visible when possible for better UX\n */\nexport const FOCUS_RING = [\n 'focus:outline-none',\n 'focus:ring-2',\n 'focus:ring-[var(--ring)]',\n] as const;\n\n/**\n * Focus with background change (for segments, cells, menu items)\n */\nexport const FOCUS_HIGHLIGHT = [\n 'focus:outline-none',\n 'focus:bg-[var(--accent)]',\n 'focus:text-[var(--accent-foreground)]',\n] as const;\n\n// =============================================================================\n// Disabled State Patterns\n// =============================================================================\n\n/**\n * Standard disabled state using disabled attribute\n */\nexport const DISABLED_STANDARD = [\n 'disabled:pointer-events-none',\n 'disabled:opacity-50',\n] as const;\n\n/**\n * Disabled state using data attribute (React Aria pattern)\n */\nexport const DISABLED_DATA_ATTR = [\n 'data-[disabled]:pointer-events-none',\n 'data-[disabled]:opacity-50',\n 'data-[disabled]:cursor-not-allowed',\n] as const;\n\n// =============================================================================\n// Size-Based Text Variants\n// =============================================================================\n\n/**\n * Small text size scale (xs -> sm -> base)\n */\nexport const TEXT_SIZE_SMALL_SCALE = {\n sm: 'text-xs',\n default: 'text-sm',\n lg: 'text-base',\n} as const;\n\n/**\n * Medium text size scale (sm -> base -> lg)\n */\nexport const TEXT_SIZE_MEDIUM_SCALE = {\n sm: 'text-sm',\n default: 'text-base',\n lg: 'text-lg',\n} as const;\n\n// =============================================================================\n// Touch Target Utilities\n// =============================================================================\n\n/**\n * WCAG 2.2 AAA minimum touch target (44x44px)\n */\nexport const TOUCH_TARGET_MIN = [\n 'min-h-[44px]',\n 'min-w-[44px]',\n] as const;\n\n/**\n * Common button/cell sizes with touch target compliance\n */\nexport const INTERACTIVE_SIZES = {\n sm: 'h-9 w-9', // 36px - desktop only, NOT AAA compliant\n default: 'h-11 w-11', // 44px - AAA compliant\n lg: 'h-14 w-14', // 56px - AAA compliant, enhanced\n} as const;\n\n/**\n * Height-only sizes for fields and inputs\n */\nexport const FIELD_HEIGHTS = {\n sm: 'h-9', // 36px\n default: 'h-11', // 44px\n lg: 'h-14', // 56px\n} as const;\n\n// =============================================================================\n// Message/Feedback Patterns\n// =============================================================================\n\n/**\n * Error message styling\n */\nexport const ERROR_MESSAGE_BASE = [\n 'flex',\n 'items-center',\n 'gap-1.5',\n 'text-[var(--destructive-background)]',\n] as const;\n\n/**\n * Success message styling\n */\nexport const SUCCESS_MESSAGE_BASE = [\n 'flex',\n 'items-center',\n 'gap-1.5',\n 'text-[var(--success-background)]',\n] as const;\n\n/**\n * Description/helper text styling\n */\nexport const DESCRIPTION_BASE = [\n 'text-[var(--menu-muted)]',\n] as const;\n\n/**\n * Label base styling\n */\nexport const LABEL_BASE = [\n 'font-medium',\n 'text-[var(--content-foreground)]',\n] as const;\n\n/**\n * Required indicator pattern\n */\nexport const REQUIRED_INDICATOR = \"after:content-['*'] after:ml-0.5 after:text-[var(--destructive-background)]\";\n\n// =============================================================================\n// Animation Patterns\n// =============================================================================\n\n/**\n * Popover/dropdown entry animation\n */\nexport const POPOVER_ANIMATION_IN = [\n 'data-[entering]:animate-in',\n 'data-[entering]:fade-in-0',\n 'data-[entering]:zoom-in-95',\n] as const;\n\n/**\n * Popover/dropdown exit animation\n */\nexport const POPOVER_ANIMATION_OUT = [\n 'data-[exiting]:animate-out',\n 'data-[exiting]:fade-out-0',\n 'data-[exiting]:zoom-out-95',\n] as const;\n\n/**\n * Reduced motion support (WCAG 2.2)\n */\nexport const REDUCED_MOTION = [\n 'motion-reduce:transition-none',\n 'motion-reduce:animate-none',\n] as const;\n\n/**\n * Standard transition for colors\n */\nexport const TRANSITION_COLORS = [\n 'transition-colors',\n 'duration-200',\n] as const;\n\n/**\n * Fast transition for interactions\n */\nexport const TRANSITION_FAST = [\n 'transition-colors',\n 'duration-150',\n] as const;\n\n// =============================================================================\n// Hover State Patterns\n// =============================================================================\n\n/**\n * Accent background on hover (for interactive items)\n */\nexport const HOVER_ACCENT = [\n 'hover:bg-[var(--accent)]',\n 'hover:text-[var(--accent-foreground)]',\n] as const;\n\n// =============================================================================\n// Helper Functions\n// =============================================================================\n\n/**\n * Combines multiple style arrays into a flat array for CVA base styles\n */\nexport function combineStyles(...styles: (readonly string[] | string)[]): string[] {\n return styles.flatMap(s => Array.isArray(s) ? [...s] : [s]);\n}\n"]}
1
+ {"version":3,"sources":["../../src/styles/interaction-states.ts","../../src/styles/shared-variants.ts"],"names":["FOCUS_STYLES","PRESSED_STYLES","PRESSED_STYLES_BASE","HOVER_STYLES","HOVER_STYLES_BASE","HIGH_CONTRAST_FOCUS","HIGH_CONTRAST_HOVER","HIGH_CONTRAST_PRESSED","HIGH_CONTRAST_INTERACTIONS","DISABLED_STYLES","DEFAULT_INTERACTIONS","SUBTLE_INTERACTIONS","NON_INTERACTIVE","FOCUS_WITHIN_RING","FOCUS_VISIBLE_RING","FOCUS_RING","FOCUS_HIGHLIGHT","DISABLED_STANDARD","DISABLED_DATA_ATTR","TEXT_SIZE_SMALL_SCALE","TEXT_SIZE_MEDIUM_SCALE","TOUCH_TARGET_MIN","INTERACTIVE_SIZES","FIELD_HEIGHTS","ERROR_MESSAGE_BASE","SUCCESS_MESSAGE_BASE","DESCRIPTION_BASE","LABEL_BASE","REQUIRED_INDICATOR","POPOVER_ANIMATION_IN","POPOVER_ANIMATION_OUT","REDUCED_MOTION","TRANSITION_COLORS","TRANSITION_FAST","HOVER_ACCENT","combineStyles","styles","s"],"mappings":"AAoBO,IAAMA,CAAAA,CAAe,gHAUfC,CAAAA,CAAiB,6BAAA,CAKjBC,EAAsB,iEAAA,CAUtBC,CAAAA,CAAe,0BAAA,CAKfC,CAAAA,CAAoB,8DAAA,CAQpBC,CAAAA,CAAsB,wJAMtBC,CAAAA,CAAsB,4FAAA,CAMtBC,EAAwB,+HAAA,CAMxBC,CAAAA,CAA6B,GAAGH,CAAmB,CAAA,CAAA,EAAIC,CAAmB,CAAA,CAAA,EAAIC,CAAqB,CAAA,CAAA,CAMnGE,EAAkB,kDAAA,CAWlBC,CAA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AAA,CAAuB,CAClC,6BACA,2BAAA,CACA,4BACF,EAKaC,CAAAA,CAAwB,CACnC,6BACA,2BAAA,CACA,4BACF,EAkEO,IAAMC,CAAAA,CAAiB,CAC5B,gCACA,4BACF,CAAA,CAKaC,EAAoB,CAC/B,mBAAA,CACA,cACF,CAAA,CAKaC,CAAAA,CAAkB,CAC7B,mBAAA,CACA,cACF,CAAA,CASaC,EAAe,CAC1B,0BAAA,CACA,uCACF,EASO,SAASC,KAAiBC,CAAAA,CAAkD,CACjF,OAAOA,CAAAA,CAAO,OAAA,CAAQC,CAAAA,EAAK,MAAM,OAAA,CAAQA,CAAC,EAAI,CAAC,GAAGA,CAAC,CAAA,CAAI,CAACA,CAAC,CAAC,CAC5D","file":"index.mjs","sourcesContent":["/**\n * Global Interaction State Styles\n *\n * Consistent interaction patterns across all Themis components.\n * These styles ensure WCAG 2.2 AAA compliance and predictable UX.\n *\n * @see spec.md FR-010 (Visible focus ring for keyboard navigation)\n * @see spec.md FR-031 (Pressed state feedback)\n * @see spec.md FR-012 (High contrast mode support)\n * @see constitution.md Principle IV (Accessibility First)\n */\n\n/**\n * Focus state styles (FR-010)\n * Visible focus ring for keyboard navigation - WCAG 2.2 Level AAA\n *\n * Components can override by extending these styles:\n * @example\n * cn(FOCUS_STYLES, \"ring-4\") // Increases ring width to 4px\n */\nexport const FOCUS_STYLES = \"data-[focus-visible]:ring-2 data-[focus-visible]:ring-[var(--themis-ring)] data-[focus-visible]:ring-offset-2\";\n\n/**\n * Pressed/Active state styles (FR-031)\n * Visual feedback for press interactions\n *\n * Components can override the scale amount:\n * @example\n * cn(PRESSED_STYLES_BASE, \"data-[pressed]:scale-[0.95]\") // More pronounced scale\n */\nexport const PRESSED_STYLES = \"data-[pressed]:scale-[0.97]\";\n\n/**\n * Base pressed styles without scale (for components that need different feedback)\n */\nexport const PRESSED_STYLES_BASE = \"data-[pressed]:transition-transform data-[pressed]:duration-100\";\n\n/**\n * Hover state styles\n * Elevation change on hover for better affordance\n *\n * Components can override shadow depth:\n * @example\n * cn(HOVER_STYLES_BASE, \"data-[hovered]:shadow-lg\") // Larger shadow\n */\nexport const HOVER_STYLES = \"data-[hovered]:shadow-md\";\n\n/**\n * Base hover styles without shadow (for components that use different hover effects)\n */\nexport const HOVER_STYLES_BASE = \"data-[hovered]:transition-shadow data-[hovered]:duration-200\";\n\n/**\n * High contrast mode focus (FR-012)\n * Enhanced outlines for users requiring high contrast\n *\n * Uses 'hc:' prefix for prefers-contrast: more media query\n */\nexport const HIGH_CONTRAST_FOCUS = \"hc:data-[focus-visible]:outline hc:data-[focus-visible]:outline-4 hc:data-[focus-visible]:outline-offset-2 hc:data-[focus-visible]:outline-foreground\";\n\n/**\n * High contrast mode hover (FR-012)\n * Enhanced outlines for hover in high contrast mode\n */\nexport const HIGH_CONTRAST_HOVER = \"hc:data-[hovered]:outline hc:data-[hovered]:outline-2 hc:data-[hovered]:outline-foreground\";\n\n/**\n * High contrast mode pressed state\n * Enhanced outlines for pressed state in high contrast mode\n */\nexport const HIGH_CONTRAST_PRESSED = \"hc:data-[pressed]:outline hc:data-[pressed]:outline-2 hc:data-[pressed]:outline-offset-1 hc:data-[pressed]:outline-foreground\";\n\n/**\n * Combined high contrast styles\n * Use this for components that need all high contrast interaction states\n */\nexport const HIGH_CONTRAST_INTERACTIONS = `${HIGH_CONTRAST_FOCUS} ${HIGH_CONTRAST_HOVER} ${HIGH_CONTRAST_PRESSED}`;\n\n/**\n * Disabled state styles\n * Consistent disabled appearance across all components\n */\nexport const DISABLED_STYLES = \"disabled:pointer-events-none disabled:opacity-50\";\n\n/**\n * Default interaction bundle\n * Most common combination for interactive components\n *\n * Includes: focus ring, pressed scale, hover shadow, high contrast enhancements\n *\n * @example\n * <button className={cn(DEFAULT_INTERACTIONS, \"bg-primary\")}>Click</button>\n */\nexport const DEFAULT_INTERACTIONS = `${FOCUS_STYLES} ${PRESSED_STYLES} ${HOVER_STYLES} ${HIGH_CONTRAST_FOCUS} ${HIGH_CONTRAST_HOVER} ${HIGH_CONTRAST_PRESSED}`;\n\n/**\n * Subtle interaction bundle\n * For components that need less pronounced feedback\n *\n * Includes: focus ring and high contrast, but no hover shadow or pressed scale\n */\nexport const SUBTLE_INTERACTIONS = `${FOCUS_STYLES} ${HIGH_CONTRAST_FOCUS}`;\n\n/**\n * Non-interactive element styles\n * For elements that should indicate they are not interactive\n */\nexport const NON_INTERACTIVE = \"cursor-default select-none\";\n","/**\n * Shared CVA Variant Utilities\n *\n * Common patterns extracted from component variants for consistency and reduced bundle size.\n * Use these constants in CVA definitions to ensure consistent styling across Themis.\n *\n * @see interaction-states.ts for interaction-specific styles (focus, hover, pressed)\n */\n\n// =============================================================================\n// Focus Ring Patterns\n// =============================================================================\n\n/**\n * Focus-within ring (for container elements with focusable children)\n * Use when the container should show focus when any child is focused\n */\nexport const FOCUS_WITHIN_RING = [\n 'focus-within:outline-none',\n 'focus-within:ring-2',\n 'focus-within:ring-[var(--ring)]',\n 'focus-within:ring-offset-2',\n] as const;\n\n/**\n * Focus-visible ring (for directly focusable elements)\n * Use for buttons, inputs, and other interactive elements\n */\nexport const FOCUS_VISIBLE_RING = [\n 'focus-visible:outline-none',\n 'focus-visible:ring-2',\n 'focus-visible:ring-[var(--ring)]',\n 'focus-visible:ring-offset-2',\n] as const;\n\n/**\n * Standard focus ring (for elements using :focus pseudo-class)\n * Prefer focus-visible when possible for better UX\n */\nexport const FOCUS_RING = [\n 'focus:outline-none',\n 'focus:ring-2',\n 'focus:ring-[var(--ring)]',\n] as const;\n\n/**\n * Focus with background change (for segments, cells, menu items)\n */\nexport const FOCUS_HIGHLIGHT = [\n 'focus:outline-none',\n 'focus:bg-[var(--accent)]',\n 'focus:text-[var(--accent-foreground)]',\n] as const;\n\n// =============================================================================\n// Disabled State Patterns\n// =============================================================================\n\n/**\n * Standard disabled state using disabled attribute\n */\nexport const DISABLED_STANDARD = [\n 'disabled:pointer-events-none',\n 'disabled:opacity-50',\n] as const;\n\n/**\n * Disabled state using data attribute (React Aria pattern)\n */\nexport const DISABLED_DATA_ATTR = [\n 'data-[disabled]:pointer-events-none',\n 'data-[disabled]:opacity-50',\n 'data-[disabled]:cursor-not-allowed',\n] as const;\n\n// =============================================================================\n// Size-Based Text Variants\n// =============================================================================\n\n/**\n * Small text size scale (xs -> sm -> base)\n */\nexport const TEXT_SIZE_SMALL_SCALE = {\n sm: 'text-xs',\n default: 'text-sm',\n lg: 'text-base',\n} as const;\n\n/**\n * Medium text size scale (sm -> base -> lg)\n */\nexport const TEXT_SIZE_MEDIUM_SCALE = {\n sm: 'text-sm',\n default: 'text-base',\n lg: 'text-lg',\n} as const;\n\n// =============================================================================\n// Touch Target Utilities\n// =============================================================================\n\n/**\n * WCAG 2.2 AAA minimum touch target (44x44px)\n */\nexport const TOUCH_TARGET_MIN = [\n 'min-h-[44px]',\n 'min-w-[44px]',\n] as const;\n\n/**\n * Common button/cell sizes with touch target compliance\n */\nexport const INTERACTIVE_SIZES = {\n sm: 'h-9 w-9', // 36px - desktop only, NOT AAA compliant\n default: 'h-11 w-11', // 44px - AAA compliant\n lg: 'h-14 w-14', // 56px - AAA compliant, enhanced\n} as const;\n\n/**\n * Height-only sizes for fields and inputs\n */\nexport const FIELD_HEIGHTS = {\n sm: 'h-9', // 36px\n default: 'h-11', // 44px\n lg: 'h-14', // 56px\n} as const;\n\n// =============================================================================\n// Message/Feedback Patterns\n// =============================================================================\n\n/**\n * Error message styling\n */\nexport const ERROR_MESSAGE_BASE = [\n 'flex',\n 'items-center',\n 'gap-1.5',\n 'text-[var(--destructive-background)]',\n] as const;\n\n/**\n * Success message styling\n */\nexport const SUCCESS_MESSAGE_BASE = [\n 'flex',\n 'items-center',\n 'gap-1.5',\n 'text-[var(--success-background)]',\n] as const;\n\n/**\n * Description/helper text styling\n */\nexport const DESCRIPTION_BASE = [\n 'text-[var(--menu-muted)]',\n] as const;\n\n/**\n * Label base styling\n */\nexport const LABEL_BASE = [\n 'font-medium',\n 'text-[var(--content-foreground)]',\n] as const;\n\n/**\n * Required indicator pattern\n */\nexport const REQUIRED_INDICATOR = \"after:content-['*'] after:ml-0.5 after:text-[var(--destructive-background)]\";\n\n// =============================================================================\n// Animation Patterns\n// =============================================================================\n\n/**\n * Popover/dropdown entry animation\n */\nexport const POPOVER_ANIMATION_IN = [\n 'data-[entering]:animate-in',\n 'data-[entering]:fade-in-0',\n 'data-[entering]:zoom-in-95',\n] as const;\n\n/**\n * Popover/dropdown exit animation\n */\nexport const POPOVER_ANIMATION_OUT = [\n 'data-[exiting]:animate-out',\n 'data-[exiting]:fade-out-0',\n 'data-[exiting]:zoom-out-95',\n] as const;\n\n/**\n * Modal content enter animation (fade + zoom)\n * Uses React Aria data-[entering]/data-[exiting] attributes\n */\nexport const MODAL_ANIMATION_IN = [\n 'data-[entering]:animate-in',\n 'data-[entering]:fade-in-0',\n 'data-[entering]:zoom-in-95',\n 'data-[entering]:duration-200',\n 'data-[entering]:ease-out',\n] as const;\n\n/**\n * Modal content exit animation (fade + zoom)\n * Uses React Aria data-[entering]/data-[exiting] attributes\n */\nexport const MODAL_ANIMATION_OUT = [\n 'data-[exiting]:animate-out',\n 'data-[exiting]:fade-out-0',\n 'data-[exiting]:zoom-out-95',\n 'data-[exiting]:duration-150',\n 'data-[exiting]:ease-in',\n] as const;\n\n/**\n * Modal slide enter animation (fade + slide up)\n */\nexport const MODAL_SLIDE_IN = [\n 'data-[entering]:animate-in',\n 'data-[entering]:fade-in-0',\n 'data-[entering]:slide-in-from-bottom-4',\n 'data-[entering]:duration-200',\n 'data-[entering]:ease-out',\n] as const;\n\n/**\n * Modal slide exit animation (fade + slide down)\n */\nexport const MODAL_SLIDE_OUT = [\n 'data-[exiting]:animate-out',\n 'data-[exiting]:fade-out-0',\n 'data-[exiting]:slide-out-to-bottom-4',\n 'data-[exiting]:duration-150',\n 'data-[exiting]:ease-in',\n] as const;\n\n/**\n * Modal overlay enter/exit animation (fade only)\n */\nexport const MODAL_OVERLAY_IN = [\n 'data-[entering]:animate-in',\n 'data-[entering]:fade-in-0',\n 'data-[entering]:duration-200',\n] as const;\n\nexport const MODAL_OVERLAY_OUT = [\n 'data-[exiting]:animate-out',\n 'data-[exiting]:fade-out-0',\n 'data-[exiting]:duration-150',\n] as const;\n\n/**\n * Reduced motion support (WCAG 2.2)\n */\nexport const REDUCED_MOTION = [\n 'motion-reduce:transition-none',\n 'motion-reduce:animate-none',\n] as const;\n\n/**\n * Standard transition for colors\n */\nexport const TRANSITION_COLORS = [\n 'transition-colors',\n 'duration-200',\n] as const;\n\n/**\n * Fast transition for interactions\n */\nexport const TRANSITION_FAST = [\n 'transition-colors',\n 'duration-150',\n] as const;\n\n// =============================================================================\n// Hover State Patterns\n// =============================================================================\n\n/**\n * Accent background on hover (for interactive items)\n */\nexport const HOVER_ACCENT = [\n 'hover:bg-[var(--accent)]',\n 'hover:text-[var(--accent-foreground)]',\n] as const;\n\n// =============================================================================\n// Helper Functions\n// =============================================================================\n\n/**\n * Combines multiple style arrays into a flat array for CVA base styles\n */\nexport function combineStyles(...styles: (readonly string[] | string)[]): string[] {\n return styles.flatMap(s => Array.isArray(s) ? [...s] : [s]);\n}\n"]}
@@ -97,6 +97,29 @@ export declare const POPOVER_ANIMATION_IN: readonly ["data-[entering]:animate-in
97
97
  * Popover/dropdown exit animation
98
98
  */
99
99
  export declare const POPOVER_ANIMATION_OUT: readonly ["data-[exiting]:animate-out", "data-[exiting]:fade-out-0", "data-[exiting]:zoom-out-95"];
100
+ /**
101
+ * Modal content enter animation (fade + zoom)
102
+ * Uses React Aria data-[entering]/data-[exiting] attributes
103
+ */
104
+ export declare const MODAL_ANIMATION_IN: readonly ["data-[entering]:animate-in", "data-[entering]:fade-in-0", "data-[entering]:zoom-in-95", "data-[entering]:duration-200", "data-[entering]:ease-out"];
105
+ /**
106
+ * Modal content exit animation (fade + zoom)
107
+ * Uses React Aria data-[entering]/data-[exiting] attributes
108
+ */
109
+ export declare const MODAL_ANIMATION_OUT: readonly ["data-[exiting]:animate-out", "data-[exiting]:fade-out-0", "data-[exiting]:zoom-out-95", "data-[exiting]:duration-150", "data-[exiting]:ease-in"];
110
+ /**
111
+ * Modal slide enter animation (fade + slide up)
112
+ */
113
+ export declare const MODAL_SLIDE_IN: readonly ["data-[entering]:animate-in", "data-[entering]:fade-in-0", "data-[entering]:slide-in-from-bottom-4", "data-[entering]:duration-200", "data-[entering]:ease-out"];
114
+ /**
115
+ * Modal slide exit animation (fade + slide down)
116
+ */
117
+ export declare const MODAL_SLIDE_OUT: readonly ["data-[exiting]:animate-out", "data-[exiting]:fade-out-0", "data-[exiting]:slide-out-to-bottom-4", "data-[exiting]:duration-150", "data-[exiting]:ease-in"];
118
+ /**
119
+ * Modal overlay enter/exit animation (fade only)
120
+ */
121
+ export declare const MODAL_OVERLAY_IN: readonly ["data-[entering]:animate-in", "data-[entering]:fade-in-0", "data-[entering]:duration-200"];
122
+ export declare const MODAL_OVERLAY_OUT: readonly ["data-[exiting]:animate-out", "data-[exiting]:fade-out-0", "data-[exiting]:duration-150"];
100
123
  /**
101
124
  * Reduced motion support (WCAG 2.2)
102
125
  */
@@ -1 +1 @@
1
- {"version":3,"file":"shared-variants.d.ts","sourceRoot":"","sources":["../../src/styles/shared-variants.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,gIAKpB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,kBAAkB,oIAKrB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,UAAU,6EAIb,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,eAAe,sGAIlB,CAAC;AAMX;;GAEG;AACH,eAAO,MAAM,iBAAiB,kEAGpB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,kBAAkB,sHAIrB,CAAC;AAMX;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;CAIxB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;CAIzB,CAAC;AAMX;;GAEG;AACH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CAAC,SAAS,MAAM,EAAE,GAAG,MAAM,CAAC,EAAE,GAAG,MAAM,EAAE,CAEjF"}
@@ -5,4 +5,5 @@
5
5
  * Usage in consuming app's CSS:
6
6
  * @import "@tribepad/themis/tailwind-source.css";
7
7
  */
8
+ @import "./styles/animations.css";
8
9
  @source "./elements/**/*.{js,mjs}";
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Props for components with optional animation support.
3
+ *
4
+ * All Themis components that use motion.dev animations extend this interface.
5
+ * The `animated` prop allows consumers to disable animation per-component,
6
+ * regardless of the user's OS reduced-motion preference.
7
+ */
8
+ export interface AnimatedProps {
9
+ /**
10
+ * Enable/disable animation. Default: `true`.
11
+ *
12
+ * - `true` (default): Animation plays, respecting `prefers-reduced-motion`.
13
+ * - `false`: No animation, regardless of OS preference.
14
+ */
15
+ animated?: boolean;
16
+ }
17
+ /** Spring physics configuration for motion.dev animations. */
18
+ export interface SpringConfig {
19
+ /** Spring stiffness (higher = snappier). */
20
+ stiffness: number;
21
+ /** Spring damping (higher = less oscillation). */
22
+ damping: number;
23
+ }
24
+ //# sourceMappingURL=animation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../src/types/animation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,8DAA8D;AAC9D,MAAM,WAAW,YAAY;IAC3B,4CAA4C;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,OAAO,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,2 @@
1
+ export type { AnimatedProps, SpringConfig } from './animation';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,2 @@
1
+ 'use strict';//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,2 @@
1
+ //# sourceMappingURL=index.mjs.map
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs"}
@@ -1,2 +1,3 @@
1
1
  export { cn } from './cn';
2
+ export { shouldAnimate } from './shouldAnimate';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1,2 +1,2 @@
1
- 'use strict';var clsx=require('clsx'),tailwindMerge=require('tailwind-merge');function o(...r){return tailwindMerge.twMerge(clsx.clsx(r))}exports.cn=o;//# sourceMappingURL=index.js.map
1
+ 'use strict';var clsx=require('clsx'),tailwindMerge=require('tailwind-merge');function t(...e){return tailwindMerge.twMerge(clsx.clsx(e))}function l(e,r){return !(e===false||r)}exports.cn=t;exports.shouldAnimate=l;//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/cn.ts"],"names":["cn","inputs","twMerge","clsx"],"mappings":"8EAcO,SAASA,CAAAA,CAAAA,GAAMC,CAAAA,CAA8B,CAClD,OAAOC,qBAAAA,CAAQC,SAAAA,CAAKF,CAAM,CAAC,CAC7B","file":"index.js","sourcesContent":["/**\n * Class Name Utility\n * Merges Tailwind CSS classes with conflict resolution\n *\n * Combines clsx for conditional classes and tailwind-merge for deduplication\n *\n * @example\n * cn('px-2 py-1', 'px-4') // => 'py-1 px-4' (px-4 overrides px-2)\n * cn('text-red-500', condition && 'text-blue-500') // => conditional application\n */\n\nimport { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n"]}
1
+ {"version":3,"sources":["../../src/utils/cn.ts","../../src/utils/shouldAnimate.ts"],"names":["cn","inputs","twMerge","clsx","shouldAnimate","animated","prefersReducedMotion"],"mappings":"8EAcO,SAASA,CAAAA,CAAAA,GAAMC,CAAAA,CAA8B,CAClD,OAAOC,qBAAAA,CAAQC,SAAAA,CAAKF,CAAM,CAAC,CAC7B,CCNO,SAASG,CAAAA,CACdC,CAAAA,CACAC,CAAAA,CACS,CAET,OADI,EAAAD,CAAAA,GAAa,KAAA,EACbC,CAAAA,CAEN","file":"index.js","sourcesContent":["/**\n * Class Name Utility\n * Merges Tailwind CSS classes with conflict resolution\n *\n * Combines clsx for conditional classes and tailwind-merge for deduplication\n *\n * @example\n * cn('px-2 py-1', 'px-4') // => 'py-1 px-4' (px-4 overrides px-2)\n * cn('text-red-500', condition && 'text-blue-500') // => conditional application\n */\n\nimport { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","/**\n * Determines whether a component should animate.\n *\n * Returns `false` if:\n * - The `animated` prop is explicitly `false`\n * - The user prefers reduced motion\n *\n * @param animated - The component's `animated` prop value (default: `true`)\n * @param prefersReducedMotion - Whether the user prefers reduced motion\n */\nexport function shouldAnimate(\n animated: boolean | undefined,\n prefersReducedMotion: boolean,\n): boolean {\n if (animated === false) return false;\n if (prefersReducedMotion) return false;\n return true;\n}\n"]}
@@ -1,2 +1,2 @@
1
- import {clsx}from'clsx';import {twMerge}from'tailwind-merge';function o(...r){return twMerge(clsx(r))}export{o as cn};//# sourceMappingURL=index.mjs.map
1
+ import {clsx}from'clsx';import {twMerge}from'tailwind-merge';function t(...e){return twMerge(clsx(e))}function l(e,r){return !(e===false||r)}export{t as cn,l as shouldAnimate};//# sourceMappingURL=index.mjs.map
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/cn.ts"],"names":["cn","inputs","twMerge","clsx"],"mappings":"6DAcO,SAASA,CAAAA,CAAAA,GAAMC,CAAAA,CAA8B,CAClD,OAAOC,OAAAA,CAAQC,IAAAA,CAAKF,CAAM,CAAC,CAC7B","file":"index.mjs","sourcesContent":["/**\n * Class Name Utility\n * Merges Tailwind CSS classes with conflict resolution\n *\n * Combines clsx for conditional classes and tailwind-merge for deduplication\n *\n * @example\n * cn('px-2 py-1', 'px-4') // => 'py-1 px-4' (px-4 overrides px-2)\n * cn('text-red-500', condition && 'text-blue-500') // => conditional application\n */\n\nimport { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n"]}
1
+ {"version":3,"sources":["../../src/utils/cn.ts","../../src/utils/shouldAnimate.ts"],"names":["cn","inputs","twMerge","clsx","shouldAnimate","animated","prefersReducedMotion"],"mappings":"6DAcO,SAASA,CAAAA,CAAAA,GAAMC,CAAAA,CAA8B,CAClD,OAAOC,OAAAA,CAAQC,IAAAA,CAAKF,CAAM,CAAC,CAC7B,CCNO,SAASG,CAAAA,CACdC,CAAAA,CACAC,CAAAA,CACS,CAET,OADI,EAAAD,CAAAA,GAAa,KAAA,EACbC,CAAAA,CAEN","file":"index.mjs","sourcesContent":["/**\n * Class Name Utility\n * Merges Tailwind CSS classes with conflict resolution\n *\n * Combines clsx for conditional classes and tailwind-merge for deduplication\n *\n * @example\n * cn('px-2 py-1', 'px-4') // => 'py-1 px-4' (px-4 overrides px-2)\n * cn('text-red-500', condition && 'text-blue-500') // => conditional application\n */\n\nimport { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","/**\n * Determines whether a component should animate.\n *\n * Returns `false` if:\n * - The `animated` prop is explicitly `false`\n * - The user prefers reduced motion\n *\n * @param animated - The component's `animated` prop value (default: `true`)\n * @param prefersReducedMotion - Whether the user prefers reduced motion\n */\nexport function shouldAnimate(\n animated: boolean | undefined,\n prefersReducedMotion: boolean,\n): boolean {\n if (animated === false) return false;\n if (prefersReducedMotion) return false;\n return true;\n}\n"]}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Determines whether a component should animate.
3
+ *
4
+ * Returns `false` if:
5
+ * - The `animated` prop is explicitly `false`
6
+ * - The user prefers reduced motion
7
+ *
8
+ * @param animated - The component's `animated` prop value (default: `true`)
9
+ * @param prefersReducedMotion - Whether the user prefers reduced motion
10
+ */
11
+ export declare function shouldAnimate(animated: boolean | undefined, prefersReducedMotion: boolean): boolean;
12
+ //# sourceMappingURL=shouldAnimate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shouldAnimate.d.ts","sourceRoot":"","sources":["../../src/utils/shouldAnimate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,OAAO,GAAG,SAAS,EAC7B,oBAAoB,EAAE,OAAO,GAC5B,OAAO,CAIT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tribepad/themis",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "Accessible React component library built on React Aria primitives",
5
5
  "author": "Tribepad <mbasford@tribepad.com>",
6
6
  "license": "MIT",
@@ -50,10 +50,31 @@
50
50
  }
51
51
  },
52
52
  "./styles/defaults.css": "./dist/styles/defaults.css",
53
+ "./styles/animations.css": "./dist/styles/animations.css",
53
54
  "./tailwind-source.css": {
54
55
  "style": "./dist/tailwind-source.css",
55
56
  "default": "./dist/tailwind-source.css"
56
57
  },
58
+ "./hooks": {
59
+ "import": {
60
+ "types": "./dist/hooks/index.d.ts",
61
+ "default": "./dist/hooks/index.mjs"
62
+ },
63
+ "require": {
64
+ "types": "./dist/hooks/index.d.ts",
65
+ "default": "./dist/hooks/index.js"
66
+ }
67
+ },
68
+ "./types": {
69
+ "import": {
70
+ "types": "./dist/types/index.d.ts",
71
+ "default": "./dist/types/index.mjs"
72
+ },
73
+ "require": {
74
+ "types": "./dist/types/index.d.ts",
75
+ "default": "./dist/types/index.js"
76
+ }
77
+ },
57
78
  "./utils": {
58
79
  "import": {
59
80
  "types": "./dist/utils/index.d.ts",
@@ -110,7 +131,8 @@
110
131
  "react": "^18.0.0 || ^19.0.0",
111
132
  "react-dom": "^18.0.0 || ^19.0.0",
112
133
  "tailwindcss": "^3.4.0 || ^4.0.0",
113
- "zod": "^3.0.0 || ^4.0.0"
134
+ "zod": "^3.0.0 || ^4.0.0",
135
+ "motion": ">=11.0.0"
114
136
  },
115
137
  "peerDependenciesMeta": {
116
138
  "tailwindcss": {
@@ -121,6 +143,9 @@
121
143
  },
122
144
  "zod": {
123
145
  "optional": true
146
+ },
147
+ "motion": {
148
+ "optional": true
124
149
  }
125
150
  },
126
151
  "dependencies": {
@@ -162,6 +187,7 @@
162
187
  "tsup": "^8.0.0",
163
188
  "tsx": "^4.0.0",
164
189
  "typescript": "^5.9.3",
190
+ "motion": "^12.35.0",
165
191
  "vitest": "^4.0.18",
166
192
  "zod": "^4.3.6"
167
193
  },
@@ -187,6 +213,12 @@
187
213
  "styles": [
188
214
  "dist/styles/index.d.ts"
189
215
  ],
216
+ "hooks": [
217
+ "dist/hooks/index.d.ts"
218
+ ],
219
+ "types": [
220
+ "dist/types/index.d.ts"
221
+ ],
190
222
  "utils": [
191
223
  "dist/utils/index.d.ts"
192
224
  ],