@wow-two-beta/ui 0.0.25 → 0.0.27

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.
@@ -1,6 +1,43 @@
1
- import { type ButtonHTMLAttributes } from 'react';
1
+ import { type ButtonHTMLAttributes, type ReactNode } from 'react';
2
2
  import { type ButtonVariants } from './Button.variants';
3
- export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, ButtonVariants {
3
+ /**
4
+ * Button — see `Button.standard.md` (behavioral contract) + `Button.spec.md` (API).
5
+ *
6
+ * Two-axis style (`variant` × `tone`), 5 sizes, density-scaled spacing,
7
+ * polymorphism via `asChild` (Slot), `data-state` for observable state,
8
+ * inlined spinner for `loading`, dimension-preserving `skeleton`,
9
+ * forced-colors + reduced-motion handled in variants.
10
+ *
11
+ * Press detection / long-press / debounce are spec'd as planned (post-v1).
12
+ */
13
+ export type PaddingToken = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
14
+ export type RadiusToken = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
15
+ export type SizeValue = string | number;
16
+ export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type'>, ButtonVariants {
17
+ /** Slot before children (logical start). */
18
+ leading?: ReactNode;
19
+ /** Slot after children (logical end). */
20
+ trailing?: ReactNode;
21
+ /** Action-loading: replaces leading w/ spinner, sets aria-busy, blocks clicks. */
22
+ loading?: boolean;
23
+ /** Replaces children when loading. No default — consumer supplies (i18n). */
24
+ loadingText?: string;
25
+ /**
26
+ * Content-loading: hides content (preserves box dimensions) + shimmer bg.
27
+ * Mutually exclusive with `loading` — if both, `skeleton` wins (+ dev warn).
28
+ */
29
+ skeleton?: boolean;
30
+ /** Render as the single child element via Slot. */
31
+ asChild?: boolean;
32
+ /** Independent padding override (preset or `{x, y}` object). */
33
+ padding?: PaddingToken | {
34
+ x?: SizeValue;
35
+ y?: SizeValue;
36
+ };
37
+ /** Independent radius override (preset or raw value). */
38
+ radius?: RadiusToken | SizeValue;
39
+ /** Default `'button'` — NOT browser-default `'submit'`. */
40
+ type?: 'button' | 'submit' | 'reset';
4
41
  }
5
42
  export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
6
43
  //# sourceMappingURL=Button.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/actions/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExE,MAAM,WAAW,WAAY,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,cAAc;CAAG;AAE/F,eAAO,MAAM,MAAM,2GAUlB,CAAC"}
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/actions/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EAEzB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExE;;;;;;;;;GASG;AAEH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACrE,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;AAC7E,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAExC,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC,EAC3D,cAAc;IAChB,4CAA4C;IAC5C,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,kFAAkF;IAClF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,6EAA6E;IAC7E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mDAAmD;IACnD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gEAAgE;IAChE,OAAO,CAAC,EAAE,YAAY,GAAG;QAAE,CAAC,CAAC,EAAE,SAAS,CAAC;QAAC,CAAC,CAAC,EAAE,SAAS,CAAA;KAAE,CAAC;IAC1D,yDAAyD;IACzD,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IACjC,2DAA2D;IAC3D,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;CACtC;AAmFD,eAAO,MAAM,MAAM,2GAwFlB,CAAC"}
@@ -1,80 +1,272 @@
1
- import { type VariantProps } from 'tailwind-variants';
1
+ import { type VariantProps } from '../../utils';
2
+ /**
3
+ * Button visual surface — see `Button.standard.md` (rules) + `Button.spec.md` (values).
4
+ *
5
+ * Two-axis style system: `variant` × `tone`. Glass is tone-neutral by design
6
+ * (text/bg derived from `--color-inverse*` regardless of tone).
7
+ *
8
+ * Density: height + horizontal padding scale with `--ui-density-scale` CSS var
9
+ * (default `1`) via `calc()`.
10
+ *
11
+ * Forced-colors: every variant carries `border border-transparent` so HCM
12
+ * paints a visible boundary.
13
+ *
14
+ * Reduced motion: `motion-reduce:transition-none` on base.
15
+ *
16
+ * Skeleton state: `[data-state="skeleton"]` rule on base hides children +
17
+ * applies shimmer. Owned by Button.tsx (sets `data-state`).
18
+ */
2
19
  export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
3
20
  variant: {
4
- primary: string;
5
- secondary: string;
21
+ solid: string;
22
+ soft: string;
23
+ outline: string;
6
24
  ghost: string;
25
+ link: string;
26
+ glass: string;
27
+ };
28
+ tone: {
29
+ primary: string;
30
+ neutral: string;
31
+ danger: string;
32
+ success: string;
33
+ warning: string;
7
34
  };
8
35
  size: {
36
+ xs: string;
9
37
  sm: string;
10
38
  md: string;
11
39
  lg: string;
40
+ xl: string;
41
+ };
42
+ shape: {
43
+ default: string;
44
+ square: string;
45
+ circle: string;
46
+ };
47
+ fullWidth: {
48
+ true: string;
49
+ false: string;
50
+ };
51
+ wrap: {
52
+ true: string;
53
+ false: string;
12
54
  };
13
- }, undefined, "inline-flex items-center justify-center font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", import("tailwind-variants/dist/config.js").TVConfig<{
55
+ }, undefined, string[], import("tailwind-variants/dist/config.js").TVConfig<{
14
56
  variant: {
15
- primary: string;
16
- secondary: string;
57
+ solid: string;
58
+ soft: string;
59
+ outline: string;
17
60
  ghost: string;
61
+ link: string;
62
+ glass: string;
63
+ };
64
+ tone: {
65
+ primary: string;
66
+ neutral: string;
67
+ danger: string;
68
+ success: string;
69
+ warning: string;
18
70
  };
19
71
  size: {
72
+ xs: string;
20
73
  sm: string;
21
74
  md: string;
22
75
  lg: string;
76
+ xl: string;
77
+ };
78
+ shape: {
79
+ default: string;
80
+ square: string;
81
+ circle: string;
82
+ };
83
+ fullWidth: {
84
+ true: string;
85
+ false: string;
86
+ };
87
+ wrap: {
88
+ true: string;
89
+ false: string;
23
90
  };
24
91
  }, {
25
92
  variant: {
26
- primary: string;
27
- secondary: string;
93
+ solid: string;
94
+ soft: string;
95
+ outline: string;
28
96
  ghost: string;
97
+ link: string;
98
+ glass: string;
99
+ };
100
+ tone: {
101
+ primary: string;
102
+ neutral: string;
103
+ danger: string;
104
+ success: string;
105
+ warning: string;
29
106
  };
30
107
  size: {
108
+ xs: string;
31
109
  sm: string;
32
110
  md: string;
33
111
  lg: string;
112
+ xl: string;
113
+ };
114
+ shape: {
115
+ default: string;
116
+ square: string;
117
+ circle: string;
118
+ };
119
+ fullWidth: {
120
+ true: string;
121
+ false: string;
122
+ };
123
+ wrap: {
124
+ true: string;
125
+ false: string;
34
126
  };
35
127
  }>, {
36
128
  variant: {
37
- primary: string;
38
- secondary: string;
129
+ solid: string;
130
+ soft: string;
131
+ outline: string;
39
132
  ghost: string;
133
+ link: string;
134
+ glass: string;
135
+ };
136
+ tone: {
137
+ primary: string;
138
+ neutral: string;
139
+ danger: string;
140
+ success: string;
141
+ warning: string;
40
142
  };
41
143
  size: {
144
+ xs: string;
42
145
  sm: string;
43
146
  md: string;
44
147
  lg: string;
148
+ xl: string;
149
+ };
150
+ shape: {
151
+ default: string;
152
+ square: string;
153
+ circle: string;
154
+ };
155
+ fullWidth: {
156
+ true: string;
157
+ false: string;
158
+ };
159
+ wrap: {
160
+ true: string;
161
+ false: string;
45
162
  };
46
163
  }, undefined, import("tailwind-variants").TVReturnType<{
47
164
  variant: {
48
- primary: string;
49
- secondary: string;
165
+ solid: string;
166
+ soft: string;
167
+ outline: string;
50
168
  ghost: string;
169
+ link: string;
170
+ glass: string;
171
+ };
172
+ tone: {
173
+ primary: string;
174
+ neutral: string;
175
+ danger: string;
176
+ success: string;
177
+ warning: string;
51
178
  };
52
179
  size: {
180
+ xs: string;
53
181
  sm: string;
54
182
  md: string;
55
183
  lg: string;
184
+ xl: string;
56
185
  };
57
- }, undefined, "inline-flex items-center justify-center font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", import("tailwind-variants/dist/config.js").TVConfig<{
186
+ shape: {
187
+ default: string;
188
+ square: string;
189
+ circle: string;
190
+ };
191
+ fullWidth: {
192
+ true: string;
193
+ false: string;
194
+ };
195
+ wrap: {
196
+ true: string;
197
+ false: string;
198
+ };
199
+ }, undefined, string[], import("tailwind-variants/dist/config.js").TVConfig<{
58
200
  variant: {
59
- primary: string;
60
- secondary: string;
201
+ solid: string;
202
+ soft: string;
203
+ outline: string;
61
204
  ghost: string;
205
+ link: string;
206
+ glass: string;
207
+ };
208
+ tone: {
209
+ primary: string;
210
+ neutral: string;
211
+ danger: string;
212
+ success: string;
213
+ warning: string;
62
214
  };
63
215
  size: {
216
+ xs: string;
64
217
  sm: string;
65
218
  md: string;
66
219
  lg: string;
220
+ xl: string;
221
+ };
222
+ shape: {
223
+ default: string;
224
+ square: string;
225
+ circle: string;
226
+ };
227
+ fullWidth: {
228
+ true: string;
229
+ false: string;
230
+ };
231
+ wrap: {
232
+ true: string;
233
+ false: string;
67
234
  };
68
235
  }, {
69
236
  variant: {
70
- primary: string;
71
- secondary: string;
237
+ solid: string;
238
+ soft: string;
239
+ outline: string;
72
240
  ghost: string;
241
+ link: string;
242
+ glass: string;
243
+ };
244
+ tone: {
245
+ primary: string;
246
+ neutral: string;
247
+ danger: string;
248
+ success: string;
249
+ warning: string;
73
250
  };
74
251
  size: {
252
+ xs: string;
75
253
  sm: string;
76
254
  md: string;
77
255
  lg: string;
256
+ xl: string;
257
+ };
258
+ shape: {
259
+ default: string;
260
+ square: string;
261
+ circle: string;
262
+ };
263
+ fullWidth: {
264
+ true: string;
265
+ false: string;
266
+ };
267
+ wrap: {
268
+ true: string;
269
+ false: string;
78
270
  };
79
271
  }>, unknown, unknown, undefined>>;
80
272
  export type ButtonVariants = VariantProps<typeof buttonVariants>;
@@ -1 +1 @@
1
- {"version":3,"file":"Button.variants.d.ts","sourceRoot":"","sources":["../../../src/actions/button/Button.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAkBzB,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC"}
1
+ {"version":3,"file":"Button.variants.d.ts","sourceRoot":"","sources":["../../../src/actions/button/Button.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAEpD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAwGzB,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
- export { BackToTopButton, Button, ButtonGroup, CopyButton, DisclosureButton, FAB, IconButton, Link, OverlayButton, SegmentedControl, SpeedDial, SpeedDialAction, SpeedDialTrigger, ToggleButton, ToggleButtonGroup, Toolbar, ToolbarButton, ToolbarLink, ToolbarSeparator, buttonVariants, fabVariants, iconButtonVariants, linkVariants, overlayButtonVariants, toggleButtonVariants } from '../chunk-S6QNKXKP.js';
1
+ export { BackToTopButton, Button, ButtonGroup, CopyButton, DisclosureButton, FAB, IconButton, Link, OverlayButton, SegmentedControl, SpeedDial, SpeedDialAction, SpeedDialTrigger, ToggleButton, ToggleButtonGroup, Toolbar, ToolbarButton, ToolbarLink, ToolbarSeparator, buttonVariants, fabVariants, iconButtonVariants, linkVariants, toggleButtonVariants } from '../chunk-4ARRGMGD.js';
2
2
  import '../chunk-BMBIZLO4.js';
3
3
  import '../chunk-76ZIAFWD.js';
4
4
  import '../chunk-TDX22OWF.js';
@@ -1,16 +1,26 @@
1
- import { type ButtonHTMLAttributes, type ReactNode } from 'react';
2
- import { type OverlayButtonVariants } from './OverlayButton.variants';
3
- export interface OverlayButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, OverlayButtonVariants {
4
- /** REQUIRED accessible label — overlay buttons are typically icon-only. */
5
- 'aria-label': string;
6
- children: ReactNode;
7
- }
1
+ import { type ButtonProps } from '../button/Button';
8
2
  /**
9
- * Icon button absolutely positioned over its parent. Use for image-hover
10
- * affordances (zoom, delete, edit), close buttons on cards, etc.
3
+ * OverlayButton thin wrapper around Button, supplying the typical
4
+ * "icon-button glassy circle anchored over a card/image" preset.
5
+ *
6
+ * Glass styling, sizing, loading/skeleton, asChild, etc. all flow from Button.
7
+ * OverlayButton owns positioning + reveal-on-hover only.
11
8
  *
12
9
  * Pair with `appearOn="hover"` and a parent with `className="group"` to
13
- * reveal only on hover.
10
+ * reveal the button only when the parent is hovered.
14
11
  */
12
+ export type OverlayPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'center';
13
+ export type OverlayAppearOn = 'always' | 'hover';
14
+ export interface OverlayButtonProps extends Omit<ButtonProps, 'variant' | 'shape'> {
15
+ /** Anchor location relative to the positioned parent. Default `'top-right'`. */
16
+ position?: OverlayPosition;
17
+ /**
18
+ * Visibility — `'always'` shows on mount; `'hover'` reveals when the parent
19
+ * (which MUST have `className="group"`) is hovered. Default `'always'`.
20
+ */
21
+ appearOn?: OverlayAppearOn;
22
+ /** REQUIRED — overlay buttons are typically icon-only. */
23
+ 'aria-label': string;
24
+ }
15
25
  export declare const OverlayButton: import("react").ForwardRefExoticComponent<OverlayButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
16
26
  //# sourceMappingURL=OverlayButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OverlayButton.d.ts","sourceRoot":"","sources":["../../../src/actions/overlayButton/OverlayButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,oBAAoB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9E,OAAO,EAAyB,KAAK,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAE7F,MAAM,WAAW,kBACf,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC,EAC7C,qBAAqB;IACvB,2EAA2E;IAC3E,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,kHASzB,CAAC"}
1
+ {"version":3,"file":"OverlayButton.d.ts","sourceRoot":"","sources":["../../../src/actions/overlayButton/OverlayButton.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE5D;;;;;;;;;GASG;AAEH,MAAM,MAAM,eAAe,GACvB,WAAW,GACX,UAAU,GACV,cAAc,GACd,aAAa,GACb,QAAQ,CAAC;AAEb,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEjD,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,OAAO,CAAC;IAC9C,gFAAgF;IAChF,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,0DAA0D;IAC1D,YAAY,EAAE,MAAM,CAAC;CACtB;AAeD,eAAO,MAAM,aAAa,kHA2BzB,CAAC"}
@@ -1,3 +1,2 @@
1
- export { OverlayButton, type OverlayButtonProps } from './OverlayButton';
2
- export { overlayButtonVariants, type OverlayButtonVariants } from './OverlayButton.variants';
1
+ export { OverlayButton, type OverlayButtonProps, type OverlayPosition, type OverlayAppearOn, } from './OverlayButton';
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/actions/overlayButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,KAAK,qBAAqB,EAAE,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/actions/overlayButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,eAAe,GACrB,MAAM,iBAAiB,CAAC"}