@drjoshcsimmons/scl 0.3.3 → 0.4.1
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.
- package/dist/components/ui/accordion/accordion.d.ts +1 -0
- package/dist/components/ui/accordion/accordion.d.ts.map +1 -1
- package/dist/components/ui/badge/badge.d.ts +5 -1
- package/dist/components/ui/badge/badge.d.ts.map +1 -1
- package/dist/components/ui/button/button.d.ts +7 -0
- package/dist/components/ui/button/button.d.ts.map +1 -1
- package/dist/components/ui/input/input.d.ts +6 -1
- package/dist/components/ui/input/input.d.ts.map +1 -1
- package/dist/components/ui/skeleton/skeleton.d.ts +5 -2
- package/dist/components/ui/skeleton/skeleton.d.ts.map +1 -1
- package/dist/components/ui/textarea/textarea.d.ts +6 -1
- package/dist/components/ui/textarea/textarea.d.ts.map +1 -1
- package/dist/globals.css +44 -0
- package/dist/index100.js +4 -14
- package/dist/index101.js +41 -43
- package/dist/index102.js +6 -50
- package/dist/index103.js +25 -9
- package/dist/index104.js +47 -29
- package/dist/index105.js +27 -178
- package/dist/index106.js +46 -7
- package/dist/index107.js +9 -30
- package/dist/index108.js +177 -51
- package/dist/index109.js +55 -30
- package/dist/index11.js +1 -1
- package/dist/index110.js +29 -47
- package/dist/index111.js +29 -47
- package/dist/index112.js +6 -48
- package/dist/index113.js +11 -47
- package/dist/index114.js +206 -6
- package/dist/index115.js +22 -12
- package/dist/index116.js +388 -194
- package/dist/index117.js +47 -21
- package/dist/index118.js +40 -392
- package/dist/index119.js +25 -2
- package/dist/index12.js +1 -1
- package/dist/index120.js +29 -53
- package/dist/index121.js +5 -65
- package/dist/index122.js +2 -25
- package/dist/index123.js +53 -29
- package/dist/index124.js +65 -5
- package/dist/index13.js +1 -1
- package/dist/index130.js +1 -1
- package/dist/index131.js +1 -1
- package/dist/index135.js +1 -1
- package/dist/index14.js +11 -10
- package/dist/index15.js +1 -1
- package/dist/index16.js +1 -1
- package/dist/index17.js +11 -11
- package/dist/index18.js +1 -1
- package/dist/index19.js +1 -1
- package/dist/index20.js +1 -1
- package/dist/index21.js +1 -1
- package/dist/index22.js +9 -7
- package/dist/index23.js +1 -1
- package/dist/index24.js +1 -1
- package/dist/index26.js +1 -1
- package/dist/index27.js +11 -10
- package/dist/index28.js +1 -1
- package/dist/index33.js +12 -12
- package/dist/index34.js +1 -0
- package/dist/index35.js +62 -226
- package/dist/index38.js +228 -60
- package/dist/index40.js +239 -0
- package/dist/{index59.js → index42.js} +1 -1
- package/dist/index45.js +508 -227
- package/dist/index47.js +862 -0
- package/dist/index5.js +1 -1
- package/dist/index50.js +129 -17
- package/dist/{index65.js → index53.js} +10 -10
- package/dist/{index67.js → index55.js} +14 -14
- package/dist/{index69.js → index58.js} +8 -8
- package/dist/index61.js +12 -12
- package/dist/{index71.js → index64.js} +8 -8
- package/dist/{index63.js → index66.js} +2 -2
- package/dist/{index73.js → index68.js} +3 -3
- package/dist/index7.js +1 -1
- package/dist/{index54.js → index70.js} +10 -10
- package/dist/index72.js +251 -0
- package/dist/{index43.js → index74.js} +1 -1
- package/dist/index76.js +18 -860
- package/dist/index78.js +40 -53
- package/dist/index79.js +10 -45
- package/dist/index8.js +5 -5
- package/dist/index80.js +4 -27
- package/dist/index81.js +30 -7
- package/dist/index82.js +10 -49
- package/dist/index83.js +6 -33
- package/dist/index84.js +26 -10
- package/dist/index85.js +67 -7
- package/dist/index86.js +118 -48
- package/dist/index87.js +12 -8
- package/dist/index88.js +135 -4
- package/dist/index89.js +11 -30
- package/dist/index9.js +22 -15
- package/dist/index90.js +216 -10
- package/dist/index91.js +14 -6
- package/dist/index92.js +67 -23
- package/dist/index93.js +32 -67
- package/dist/index94.js +47 -3
- package/dist/index95.js +52 -30
- package/dist/index96.js +47 -122
- package/dist/index97.js +8 -14
- package/dist/index98.js +29 -134
- package/dist/index99.js +7 -218
- package/dist/tokens/index.d.ts +9 -8
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/spacing.d.ts +11 -8
- package/dist/tokens/spacing.d.ts.map +1 -1
- package/dist/tokens/typography.d.ts +1 -0
- package/dist/tokens/typography.d.ts.map +1 -1
- package/package.json +4 -5
- package/dist/index48.js +0 -532
- package/dist/index52.js +0 -243
- package/dist/index57.js +0 -132
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
/** Root accordion container. Manages open/closed state of accordion items. */
|
|
3
4
|
declare const Accordion: React.ForwardRefExoticComponent<(AccordionPrimitive.AccordionSingleProps | AccordionPrimitive.AccordionMultipleProps) & React.RefAttributes<HTMLDivElement>>;
|
|
4
5
|
declare const AccordionItem: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
6
|
declare const AccordionTrigger: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/accordion/accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,iBAAiB,CAAC;AAEzB,QAAA,MAAM,SAAS,8JAA0B,CAAC;AAgB1C,QAAA,MAAM,aAAa,iKASjB,CAAC;AAGH,QAAA,MAAM,gBAAgB,0KAcpB,CAAC;AAGH,QAAA,MAAM,gBAAgB,oKAWpB,CAAC;AAGH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/accordion/accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,iBAAiB,CAAC;AAEzB,8EAA8E;AAC9E,QAAA,MAAM,SAAS,8JAA0B,CAAC;AAgB1C,QAAA,MAAM,aAAa,iKASjB,CAAC;AAGH,QAAA,MAAM,gBAAgB,0KAcpB,CAAC;AAGH,QAAA,MAAM,gBAAgB,oKAWpB,CAAC;AAGH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import type * as React from 'react';
|
|
2
|
+
/** Available badge visual variants. */
|
|
2
3
|
export type BadgeVariant = 'default' | 'secondary' | 'destructive' | 'outline' | 'secondary-outline' | 'destructive-outline';
|
|
3
|
-
|
|
4
|
+
/** Props for the Badge component. */
|
|
5
|
+
export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
6
|
+
/** Visual style variant. */
|
|
4
7
|
variant?: BadgeVariant;
|
|
5
8
|
}
|
|
9
|
+
/** An inline badge/label for status indicators, counts, or tags. */
|
|
6
10
|
declare function Badge({ className, variant, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
7
11
|
export { Badge };
|
|
8
12
|
//# sourceMappingURL=badge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/badge/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,WAAW,GACX,aAAa,GACb,SAAS,GACT,mBAAmB,GACnB,qBAAqB,CAAC;AAE1B,MAAM,WAAW,UAAW,SAAQ,KAAK,CAAC,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/badge/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC,OAAO,aAAa,CAAC;AAErB,uCAAuC;AACvC,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,WAAW,GACX,aAAa,GACb,SAAS,GACT,mBAAmB,GACnB,qBAAqB,CAAC;AAE1B,qCAAqC;AACrC,MAAM,WAAW,UAAW,SAAQ,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;IACvE,4BAA4B;IAC5B,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB;AAED,oEAAoE;AACpE,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,OAAmB,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,2CAEtE;AAED,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'secondary-outline' | 'ghost' | 'link' | 'destructive' | 'destructive-outline';
|
|
3
3
|
export type ButtonSize = 'default' | 'sm' | 'lg' | 'icon';
|
|
4
|
+
/** Props for the Button component. */
|
|
4
5
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
|
+
/** Visual style variant. */
|
|
5
7
|
variant?: ButtonVariant;
|
|
8
|
+
/** Size preset. */
|
|
6
9
|
size?: ButtonSize;
|
|
10
|
+
/** Render as child element (Radix Slot pattern). */
|
|
7
11
|
asChild?: boolean;
|
|
12
|
+
/** Show a loading spinner and disable the button. */
|
|
13
|
+
loading?: boolean;
|
|
8
14
|
}
|
|
15
|
+
/** A styled button with multiple variants, sizes, and loading state. */
|
|
9
16
|
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
10
17
|
export { Button };
|
|
11
18
|
//# sourceMappingURL=button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/button/button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,cAAc,CAAC;AAEtB,MAAM,MAAM,aAAa,GACrB,SAAS,GACT,WAAW,GACX,SAAS,GACT,mBAAmB,GACnB,OAAO,GACP,MAAM,GACN,aAAa,GACb,qBAAqB,CAAC;AAE1B,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;AAE1D,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IAChF,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,QAAA,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/button/button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,cAAc,CAAC;AAEtB,MAAM,MAAM,aAAa,GACrB,SAAS,GACT,WAAW,GACX,SAAS,GACT,mBAAmB,GACnB,OAAO,GACP,MAAM,GACN,aAAa,GACb,qBAAqB,CAAC;AAE1B,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;AAE1D,sCAAsC;AACtC,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IAChF,4BAA4B;IAC5B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,mBAAmB;IACnB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,oDAAoD;IACpD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,qDAAqD;IACrD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wEAAwE;AACxE,QAAA,MAAM,MAAM,uFAqBX,CAAC;AAGF,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
2
|
+
/** Props for the Input component. */
|
|
3
|
+
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
4
|
+
/** Whether the input is in an error/invalid state. */
|
|
5
|
+
error?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/** A styled text input with terminal aesthetics. Supports error state via the `error` prop. */
|
|
3
8
|
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
4
9
|
export { Input };
|
|
5
10
|
//# sourceMappingURL=input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/input/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,aAAa,CAAC;AAErB,
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/input/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,aAAa,CAAC;AAErB,qCAAqC;AACrC,MAAM,WAAW,UAAW,SAAQ,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC;IAC7E,sDAAsD;IACtD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,+FAA+F;AAC/F,QAAA,MAAM,KAAK,qFAYV,CAAC;AAGF,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type * as React from 'react';
|
|
2
|
-
|
|
2
|
+
/** Props for the Skeleton loading placeholder. */
|
|
3
|
+
export interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** Whether to show the blink animation. */
|
|
3
5
|
blink?: boolean;
|
|
4
6
|
}
|
|
5
|
-
|
|
7
|
+
/** A loading placeholder with terminal-style blink animation. */
|
|
8
|
+
declare function Skeleton({ className, blink, role, ...props }: SkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
6
9
|
export { Skeleton };
|
|
7
10
|
//# sourceMappingURL=skeleton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/skeleton/skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC,OAAO,gBAAgB,CAAC;AAExB,
|
|
1
|
+
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/skeleton/skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC,OAAO,gBAAgB,CAAC;AAExB,kDAAkD;AAClD,MAAM,WAAW,aAAc,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACzE,2CAA2C;IAC3C,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,iEAAiE;AACjE,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAY,EAAE,IAAe,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,2CAStF;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
2
|
+
/** Props for the Textarea component. */
|
|
3
|
+
export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
4
|
+
/** Whether the textarea is in an error/invalid state. */
|
|
5
|
+
error?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/** A styled textarea with terminal aesthetics. Supports error state via the `error` prop. */
|
|
3
8
|
declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
4
9
|
export { Textarea };
|
|
5
10
|
//# sourceMappingURL=textarea.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/textarea/textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,gBAAgB,CAAC;AAExB,
|
|
1
|
+
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/textarea/textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,gBAAgB,CAAC;AAExB,wCAAwC;AACxC,MAAM,WAAW,aAAc,SAAQ,KAAK,CAAC,sBAAsB,CAAC,mBAAmB,CAAC;IACtF,yDAAyD;IACzD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,6FAA6F;AAC7F,QAAA,MAAM,QAAQ,2FAWb,CAAC;AAGF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
package/dist/globals.css
CHANGED
|
@@ -234,3 +234,47 @@ body {
|
|
|
234
234
|
.scl-win95-scroll::-webkit-scrollbar-thumb:hover {
|
|
235
235
|
background-color: #d6d6d6;
|
|
236
236
|
}
|
|
237
|
+
|
|
238
|
+
/* Reduced Motion */
|
|
239
|
+
@media (prefers-reduced-motion: reduce) {
|
|
240
|
+
*,
|
|
241
|
+
*::before,
|
|
242
|
+
*::after {
|
|
243
|
+
animation-duration: 0.01ms !important;
|
|
244
|
+
animation-iteration-count: 1 !important;
|
|
245
|
+
transition-duration: 0.01ms !important;
|
|
246
|
+
scroll-behavior: auto !important;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/* Light Mode (opt-in via class) */
|
|
251
|
+
.scl-theme-light {
|
|
252
|
+
--scl-background: var(--scl-color-white);
|
|
253
|
+
--scl-foreground: var(--scl-color-black);
|
|
254
|
+
--scl-primary: hsl(120, 80%, 25%);
|
|
255
|
+
--scl-primary-foreground: var(--scl-color-white);
|
|
256
|
+
--scl-secondary: hsl(300, 80%, 35%);
|
|
257
|
+
--scl-secondary-foreground: var(--scl-color-white);
|
|
258
|
+
--scl-muted: hsl(0, 0%, 92%);
|
|
259
|
+
--scl-muted-foreground: hsl(120, 80%, 25%);
|
|
260
|
+
--scl-card: var(--scl-color-white);
|
|
261
|
+
--scl-card-foreground: var(--scl-color-black);
|
|
262
|
+
--scl-popover: var(--scl-color-white);
|
|
263
|
+
--scl-popover-foreground: var(--scl-color-black);
|
|
264
|
+
--scl-border: hsl(120, 80%, 25%);
|
|
265
|
+
--scl-ring: hsl(120, 80%, 25%);
|
|
266
|
+
--scl-input: var(--scl-color-white);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/* Screen Reader Only utility */
|
|
270
|
+
.scl-sr-only {
|
|
271
|
+
position: absolute;
|
|
272
|
+
width: 1px;
|
|
273
|
+
height: 1px;
|
|
274
|
+
padding: 0;
|
|
275
|
+
margin: -1px;
|
|
276
|
+
overflow: hidden;
|
|
277
|
+
clip: rect(0, 0, 0, 0);
|
|
278
|
+
white-space: nowrap;
|
|
279
|
+
border-width: 0;
|
|
280
|
+
}
|
package/dist/index100.js
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { useLayoutEffect as u } from "./index88.js";
|
|
5
|
-
import { jsx as l } from "react/jsx-runtime";
|
|
6
|
-
var p = "Portal", d = r.forwardRef((e, a) => {
|
|
7
|
-
var o;
|
|
8
|
-
const { container: f, ...i } = e, [m, n] = r.useState(!1);
|
|
9
|
-
u(() => n(!0), []);
|
|
10
|
-
const t = f || m && ((o = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : o.body);
|
|
11
|
-
return t ? s.createPortal(/* @__PURE__ */ l(c.div, { ...i, ref: a }), t) : null;
|
|
12
|
-
});
|
|
13
|
-
d.displayName = p;
|
|
1
|
+
function m(t, [a, n]) {
|
|
2
|
+
return Math.min(n, Math.max(a, t));
|
|
3
|
+
}
|
|
14
4
|
export {
|
|
15
|
-
|
|
5
|
+
m as clamp
|
|
16
6
|
};
|
package/dist/index101.js
CHANGED
|
@@ -1,50 +1,48 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import r from "react";
|
|
2
|
+
import { createContextScope as y } from "./index85.js";
|
|
3
|
+
import { useComposedRefs as M } from "./index84.js";
|
|
4
|
+
import { createSlot as x } from "./index118.js";
|
|
3
5
|
import { jsx as u } from "react/jsx-runtime";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
function g(s) {
|
|
7
|
+
const m = s + "CollectionProvider", [A, N] = y(m), [_, f] = A(
|
|
8
|
+
m,
|
|
9
|
+
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
10
|
+
), p = (c) => {
|
|
11
|
+
const { scope: e, children: l } = c, o = r.useRef(null), t = r.useRef(/* @__PURE__ */ new Map()).current;
|
|
12
|
+
return /* @__PURE__ */ u(_, { scope: e, itemMap: t, collectionRef: o, children: l });
|
|
13
|
+
};
|
|
14
|
+
p.displayName = m;
|
|
15
|
+
const a = s + "CollectionSlot", E = x(a), C = r.forwardRef(
|
|
16
|
+
(c, e) => {
|
|
17
|
+
const { scope: l, children: o } = c, t = f(a, l), n = M(e, t.collectionRef);
|
|
18
|
+
return /* @__PURE__ */ u(E, { ref: n, children: o });
|
|
11
19
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const n = l.forwardRef((o, t) => {
|
|
19
|
-
const { children: r, ...i } = o;
|
|
20
|
-
if (l.isValidElement(r)) {
|
|
21
|
-
const c = S(r), s = C(i, r.props);
|
|
22
|
-
return r.type !== l.Fragment && (s.ref = t ? m(t, c) : c), l.cloneElement(r, s);
|
|
20
|
+
);
|
|
21
|
+
C.displayName = a;
|
|
22
|
+
const d = s + "CollectionItemSlot", R = "data-radix-collection-item", T = x(d), I = r.forwardRef(
|
|
23
|
+
(c, e) => {
|
|
24
|
+
const { scope: l, children: o, ...t } = c, n = r.useRef(null), S = M(e, n), i = f(d, l);
|
|
25
|
+
return r.useEffect(() => (i.itemMap.set(n, { ref: n, ...t }), () => void i.itemMap.delete(n))), /* @__PURE__ */ u(T, { [R]: "", ref: S, children: o });
|
|
23
26
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
/^on[A-Z]/.test(t) ? r && i ? o[t] = (...s) => {
|
|
37
|
-
const a = i(...s);
|
|
38
|
-
return r(...s), a;
|
|
39
|
-
} : r && (o[t] = r) : t === "style" ? o[t] = { ...r, ...i } : t === "className" && (o[t] = [r, i].filter(Boolean).join(" "));
|
|
27
|
+
);
|
|
28
|
+
I.displayName = d;
|
|
29
|
+
function O(c) {
|
|
30
|
+
const e = f(s + "CollectionConsumer", c);
|
|
31
|
+
return r.useCallback(() => {
|
|
32
|
+
const o = e.collectionRef.current;
|
|
33
|
+
if (!o) return [];
|
|
34
|
+
const t = Array.from(o.querySelectorAll(`[${R}]`));
|
|
35
|
+
return Array.from(e.itemMap.values()).sort(
|
|
36
|
+
(i, v) => t.indexOf(i.ref.current) - t.indexOf(v.ref.current)
|
|
37
|
+
);
|
|
38
|
+
}, [e.collectionRef, e.itemMap]);
|
|
40
39
|
}
|
|
41
|
-
return
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return o ? e.ref : (n = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, o = n && "isReactWarning" in n && n.isReactWarning, o ? e.props.ref : e.props.ref || e.ref);
|
|
40
|
+
return [
|
|
41
|
+
{ Provider: p, Slot: C, ItemSlot: I },
|
|
42
|
+
O,
|
|
43
|
+
N
|
|
44
|
+
];
|
|
47
45
|
}
|
|
48
46
|
export {
|
|
49
|
-
|
|
47
|
+
g as createCollection
|
|
50
48
|
};
|
package/dist/index102.js
CHANGED
|
@@ -1,52 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}, f = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), p = {}, h = 0, W = function(r) {
|
|
7
|
-
return r && (r.host || W(r.parentNode));
|
|
8
|
-
}, D = function(r, u) {
|
|
9
|
-
return u.map(function(e) {
|
|
10
|
-
if (r.contains(e))
|
|
11
|
-
return e;
|
|
12
|
-
var n = W(e);
|
|
13
|
-
return n && r.contains(n) ? n : (console.error("aria-hidden", e, "in not contained inside", r, ". Doing nothing"), null);
|
|
14
|
-
}).filter(function(e) {
|
|
15
|
-
return !!e;
|
|
16
|
-
});
|
|
17
|
-
}, E = function(r, u, e, n) {
|
|
18
|
-
var i = D(u, Array.isArray(r) ? r : [r]);
|
|
19
|
-
p[e] || (p[e] = /* @__PURE__ */ new WeakMap());
|
|
20
|
-
var s = p[e], l = [], o = /* @__PURE__ */ new Set(), b = new Set(i), y = function(t) {
|
|
21
|
-
!t || o.has(t) || (o.add(t), y(t.parentNode));
|
|
22
|
-
};
|
|
23
|
-
i.forEach(y);
|
|
24
|
-
var A = function(t) {
|
|
25
|
-
!t || b.has(t) || Array.prototype.forEach.call(t.children, function(a) {
|
|
26
|
-
if (o.has(a))
|
|
27
|
-
A(a);
|
|
28
|
-
else
|
|
29
|
-
try {
|
|
30
|
-
var c = a.getAttribute(n), w = c !== null && c !== "false", d = (f.get(a) || 0) + 1, M = (s.get(a) || 0) + 1;
|
|
31
|
-
f.set(a, d), s.set(a, M), l.push(a), d === 1 && w && v.set(a, !0), M === 1 && a.setAttribute(e, "true"), w || a.setAttribute(n, "true");
|
|
32
|
-
} catch (k) {
|
|
33
|
-
console.error("aria-hidden: cannot operate on ", a, k);
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
return A(u), o.clear(), h++, function() {
|
|
38
|
-
l.forEach(function(t) {
|
|
39
|
-
var a = f.get(t) - 1, c = s.get(t) - 1;
|
|
40
|
-
f.set(t, a), s.set(t, c), a || (v.has(t) || t.removeAttribute(n), v.delete(t)), c || t.removeAttribute(e);
|
|
41
|
-
}), h--, h || (f = /* @__PURE__ */ new WeakMap(), f = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), p = {});
|
|
42
|
-
};
|
|
43
|
-
}, C = function(r, u, e) {
|
|
44
|
-
e === void 0 && (e = "data-aria-hidden");
|
|
45
|
-
var n = Array.from(Array.isArray(r) ? r : [r]), i = S(r);
|
|
46
|
-
return i ? (n.push.apply(n, Array.from(i.querySelectorAll("[aria-live], script"))), E(n, i, e, "aria-hidden")) : function() {
|
|
47
|
-
return null;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
1
|
+
import * as u from "react";
|
|
2
|
+
function t(r) {
|
|
3
|
+
const e = u.useRef({ value: r, previous: r });
|
|
4
|
+
return u.useMemo(() => (e.current.value !== r && (e.current.previous = e.current.value, e.current.value = r), e.current.previous), [r]);
|
|
5
|
+
}
|
|
50
6
|
export {
|
|
51
|
-
|
|
7
|
+
t as usePrevious
|
|
52
8
|
};
|
package/dist/index103.js
CHANGED
|
@@ -1,11 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
|
|
1
|
+
import * as h from "react";
|
|
2
|
+
import { useLayoutEffect as z } from "./index80.js";
|
|
3
|
+
function c(r) {
|
|
4
|
+
const [d, e] = h.useState(void 0);
|
|
5
|
+
return z(() => {
|
|
6
|
+
if (r) {
|
|
7
|
+
e({ width: r.offsetWidth, height: r.offsetHeight });
|
|
8
|
+
const f = new ResizeObserver((i) => {
|
|
9
|
+
if (!Array.isArray(i) || !i.length)
|
|
10
|
+
return;
|
|
11
|
+
const b = i[0];
|
|
12
|
+
let o, t;
|
|
13
|
+
if ("borderBoxSize" in b) {
|
|
14
|
+
const s = b.borderBoxSize, u = Array.isArray(s) ? s[0] : s;
|
|
15
|
+
o = u.inlineSize, t = u.blockSize;
|
|
16
|
+
} else
|
|
17
|
+
o = r.offsetWidth, t = r.offsetHeight;
|
|
18
|
+
e({ width: o, height: t });
|
|
19
|
+
});
|
|
20
|
+
return f.observe(r, { box: "border-box" }), () => f.unobserve(r);
|
|
21
|
+
} else
|
|
22
|
+
e(void 0);
|
|
23
|
+
}, [r]), d;
|
|
24
|
+
}
|
|
9
25
|
export {
|
|
10
|
-
|
|
26
|
+
c as useSize
|
|
11
27
|
};
|
package/dist/index104.js
CHANGED
|
@@ -1,32 +1,50 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import "
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"input",
|
|
14
|
-
"label",
|
|
15
|
-
"li",
|
|
16
|
-
"nav",
|
|
17
|
-
"ol",
|
|
18
|
-
"p",
|
|
19
|
-
"select",
|
|
20
|
-
"span",
|
|
21
|
-
"svg",
|
|
22
|
-
"ul"
|
|
23
|
-
], w = u.reduce((t, i) => {
|
|
24
|
-
const o = l(`Primitive.${i}`), r = f.forwardRef((e, m) => {
|
|
25
|
-
const { asChild: a, ...p } = e, s = a ? o : i;
|
|
26
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ n(s, { ...p, ref: m });
|
|
1
|
+
import * as l from "react";
|
|
2
|
+
import { composeRefs as m } from "./index84.js";
|
|
3
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
4
|
+
// @__NO_SIDE_EFFECTS__
|
|
5
|
+
function b(e) {
|
|
6
|
+
const n = /* @__PURE__ */ y(e), o = l.forwardRef((t, r) => {
|
|
7
|
+
const { children: i, ...c } = t, s = l.Children.toArray(i), a = s.find(E);
|
|
8
|
+
if (a) {
|
|
9
|
+
const f = a.props.children, d = s.map((p) => p === a ? l.Children.count(f) > 1 ? l.Children.only(null) : l.isValidElement(f) ? f.props.children : null : p);
|
|
10
|
+
return /* @__PURE__ */ u(n, { ...c, ref: r, children: l.isValidElement(f) ? l.cloneElement(f, void 0, d) : null });
|
|
11
|
+
}
|
|
12
|
+
return /* @__PURE__ */ u(n, { ...c, ref: r, children: i });
|
|
27
13
|
});
|
|
28
|
-
return
|
|
29
|
-
}
|
|
14
|
+
return o.displayName = `${e}.Slot`, o;
|
|
15
|
+
}
|
|
16
|
+
// @__NO_SIDE_EFFECTS__
|
|
17
|
+
function y(e) {
|
|
18
|
+
const n = l.forwardRef((o, t) => {
|
|
19
|
+
const { children: r, ...i } = o;
|
|
20
|
+
if (l.isValidElement(r)) {
|
|
21
|
+
const c = S(r), s = C(i, r.props);
|
|
22
|
+
return r.type !== l.Fragment && (s.ref = t ? m(t, c) : c), l.cloneElement(r, s);
|
|
23
|
+
}
|
|
24
|
+
return l.Children.count(r) > 1 ? l.Children.only(null) : null;
|
|
25
|
+
});
|
|
26
|
+
return n.displayName = `${e}.SlotClone`, n;
|
|
27
|
+
}
|
|
28
|
+
var g = Symbol("radix.slottable");
|
|
29
|
+
function E(e) {
|
|
30
|
+
return l.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === g;
|
|
31
|
+
}
|
|
32
|
+
function C(e, n) {
|
|
33
|
+
const o = { ...n };
|
|
34
|
+
for (const t in n) {
|
|
35
|
+
const r = e[t], i = n[t];
|
|
36
|
+
/^on[A-Z]/.test(t) ? r && i ? o[t] = (...s) => {
|
|
37
|
+
const a = i(...s);
|
|
38
|
+
return r(...s), a;
|
|
39
|
+
} : r && (o[t] = r) : t === "style" ? o[t] = { ...r, ...i } : t === "className" && (o[t] = [r, i].filter(Boolean).join(" "));
|
|
40
|
+
}
|
|
41
|
+
return { ...e, ...o };
|
|
42
|
+
}
|
|
43
|
+
function S(e) {
|
|
44
|
+
var t, r;
|
|
45
|
+
let n = (t = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : t.get, o = n && "isReactWarning" in n && n.isReactWarning;
|
|
46
|
+
return o ? e.ref : (n = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, o = n && "isReactWarning" in n && n.isReactWarning, o ? e.props.ref : e.props.ref || e.ref);
|
|
47
|
+
}
|
|
30
48
|
export {
|
|
31
|
-
|
|
49
|
+
b as createSlot
|
|
32
50
|
};
|