@orion-ds/react 4.6.0 → 4.6.2
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/blocks/sections/Gallery/Gallery.module.css +1 -1
- package/dist/blocks/sections/Gallery/Gallery.module.css.cjs +1 -1
- package/dist/blocks/sections/Gallery/Gallery.module.css.mjs +20 -20
- package/dist/blocks/templates/app/ChatPageTemplate/ChatPageTemplate.module.css +1 -1
- package/dist/blocks/templates/app/ChatPageTemplate/ChatPageTemplate.module.css.cjs +1 -1
- package/dist/blocks/templates/app/ChatPageTemplate/ChatPageTemplate.module.css.mjs +59 -59
- package/dist/blocks.css +2 -2
- package/dist/components/Avatar/Avatar.cjs +1 -1
- package/dist/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/components/Avatar/Avatar.mjs +54 -35
- package/dist/components/Avatar/Avatar.module.css +1 -1
- package/dist/components/Avatar/Avatar.module.css.cjs +1 -1
- package/dist/components/Avatar/Avatar.module.css.mjs +44 -30
- package/dist/components/Avatar/Avatar.types.d.ts +18 -0
- package/dist/components/Avatar/Avatar.types.d.ts.map +1 -1
- package/dist/components/EmptyState/EmptyState.cjs +1 -0
- package/dist/components/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/components/EmptyState/EmptyState.mjs +1 -0
- package/dist/components/Select/Select.cjs +1 -1
- package/dist/components/Select/Select.d.ts +18 -2
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.mjs +37 -31
- package/dist/components/Select/Select.stories.d.ts +3 -1
- package/dist/components/Select/Select.stories.d.ts.map +1 -1
- package/dist/components/Select/Select.types.d.ts +18 -1
- package/dist/components/Select/Select.types.d.ts.map +1 -1
- package/dist/components/Stack/Stack.cjs +2 -0
- package/dist/components/Stack/Stack.d.ts +5 -0
- package/dist/components/Stack/Stack.d.ts.map +1 -0
- package/dist/components/Stack/Stack.mjs +32 -0
- package/dist/components/Stack/Stack.module.css +1 -0
- package/dist/components/Stack/Stack.module.css.cjs +1 -0
- package/dist/components/Stack/Stack.module.css.mjs +30 -0
- package/dist/components/Stack/Stack.stories.d.ts +52 -0
- package/dist/components/Stack/Stack.stories.d.ts.map +1 -0
- package/dist/components/Stack/Stack.types.d.ts +82 -0
- package/dist/components/Stack/Stack.types.d.ts.map +1 -0
- package/dist/components/Stack/index.d.ts +3 -0
- package/dist/components/Stack/index.d.ts.map +1 -0
- package/dist/components/ThemeController/ThemeController.cjs +1 -1
- package/dist/components/ThemeController/ThemeController.mjs +20 -20
- package/dist/components/Toast/Toast.cjs +1 -1
- package/dist/components/Toast/Toast.d.ts.map +1 -1
- package/dist/components/Toast/Toast.mjs +48 -48
- package/dist/components/Toast/Toast.types.d.ts +5 -0
- package/dist/components/Toast/Toast.types.d.ts.map +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/hooks/useDisclosure.cjs +1 -1
- package/dist/hooks/useDisclosure.d.ts +12 -0
- package/dist/hooks/useDisclosure.d.ts.map +1 -1
- package/dist/hooks/useDisclosure.mjs +21 -17
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +86 -84
- package/dist/styles.css +3 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.types.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/Avatar.types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD;;GAEG;AACH,MAAM,MAAM,UAAU,GAClB,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,SAAS,CAAC;AAEd
|
|
1
|
+
{"version":3,"file":"Avatar.types.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/Avatar.types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD;;GAEG;AACH,MAAM,MAAM,UAAU,GAClB,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,SAAS,CAAC;AAEd;;GAEG;AACH,MAAM,MAAM,WAAW,GACnB,MAAM,GACN,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,KAAK,GACL,MAAM,GACN,MAAM,CAAC;AAEX;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,cAAc,CAAC;IACjE;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;;OAGG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAElB;;;;OAIG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;IAEpB;;;OAGG;IACH,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;IAEhD;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),f=require("react"),e=require("./EmptyState.module.css.cjs"),r=f.forwardRef(({icon:a,title:i,description:s,action:l,secondaryAction:d,size:c="md",className:m,...u},n)=>{const o=[e.default.emptyState,e.default[c],m].filter(Boolean).join(" ");return t.jsxs("div",{ref:n,className:o,...u,children:[a&&t.jsx("div",{className:e.default.icon,"aria-hidden":"true",children:a}),t.jsx("h3",{className:e.default.title,children:i}),s&&t.jsx("p",{className:e.default.description,children:s}),(l||d)&&t.jsxs("div",{className:e.default.actions,children:[l,d]})]})});r.displayName="EmptyState";exports.EmptyState=r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../../src/components/EmptyState/EmptyState.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../../src/components/EmptyState/EmptyState.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAG1D,eAAO,MAAM,UAAU,4GAuCtB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime")
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),o=require("react"),e=require("./Select.module.css.cjs"),u=o.forwardRef(({value:d,disabled:a,children:t,...c},i)=>l.jsx("option",{ref:i,value:d,disabled:a,...c,children:t}));u.displayName="Select.Option";const f=o.forwardRef(({label:d,error:a,helperText:t,options:c,placeholder:i="Select an option...",fullWidth:p=!1,size:h="md",optional:j=!1,className:x,id:b,disabled:N,required:r,children:S,...v},y)=>{const s=b||`select-${Math.random().toString(36).substr(2,9)}`,$=[e.default.selectContainer,p&&e.default.fullWidth,a&&e.default.error,x].filter(Boolean).join(" "),g=[e.default.select,e.default[h]].filter(Boolean).join(" ");return l.jsxs("div",{className:$,children:[d&&l.jsxs("label",{htmlFor:s,className:e.default.label,children:[d,j&&l.jsx("span",{className:e.default.optional,children:"(optional)"}),r&&l.jsx("span",{"aria-label":"required",children:"*"})]}),l.jsx("div",{className:e.default.selectWrapper,children:l.jsxs("select",{ref:y,id:s,className:g,disabled:N,required:r,"aria-invalid":a?"true":"false","aria-describedby":a?`${s}-error`:t?`${s}-helper`:void 0,...v,children:[i&&l.jsx("option",{value:"",disabled:!0,className:e.default.placeholder,children:i}),c?.map(n=>l.jsx("option",{value:n.value,disabled:n.disabled,children:n.label},n.value)),S]})}),t&&!a&&l.jsx("span",{id:`${s}-helper`,className:e.default.helperText,children:t}),a&&l.jsxs("span",{id:`${s}-error`,className:e.default.errorMessage,role:"alert",children:[l.jsx("span",{className:e.default.errorIcon,"aria-hidden":"true",children:"⚠"}),a]})]})});f.displayName="Select";const m=f;m.Option=u;exports.Select=m;
|
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
import { SelectProps } from './Select.types';
|
|
1
|
+
import { SelectProps, SelectOptionProps } from './Select.types';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* SelectOption component - used as Select.Option for compound component pattern
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <Select>
|
|
9
|
+
* <Select.Option value="us">United States</Select.Option>
|
|
10
|
+
* <Select.Option value="uk">United Kingdom</Select.Option>
|
|
11
|
+
* </Select>
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
declare const SelectOption: import('react').ForwardRefExoticComponent<SelectOptionProps & import('react').RefAttributes<HTMLOptionElement>>;
|
|
15
|
+
declare const SelectComponent: import('react').ForwardRefExoticComponent<SelectProps & import('react').RefAttributes<HTMLSelectElement>>;
|
|
16
|
+
export declare const Select: typeof SelectComponent & {
|
|
17
|
+
Option: typeof SelectOption;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
4
20
|
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGrE;;;;;;;;;;GAUG;AACH,QAAA,MAAM,YAAY,iHAMjB,CAAC;AAIF,QAAA,MAAM,eAAe,2GAgHpB,CAAC;AAKF,eAAO,MAAM,MAAM,EAAsB,OAAO,eAAe,GAAG;IAChE,MAAM,EAAE,OAAO,YAAY,CAAC;CAC7B,CAAC"}
|
|
@@ -1,47 +1,51 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { forwardRef as
|
|
2
|
+
import { jsxs as c, jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as m } from "react";
|
|
4
4
|
import e from "./Select.module.css.mjs";
|
|
5
|
-
const
|
|
5
|
+
const p = m(
|
|
6
|
+
({ value: n, disabled: l, children: i, ...o }, t) => /* @__PURE__ */ a("option", { ref: t, value: n, disabled: l, ...o, children: i })
|
|
7
|
+
);
|
|
8
|
+
p.displayName = "Select.Option";
|
|
9
|
+
const h = m(
|
|
6
10
|
({
|
|
7
11
|
label: n,
|
|
8
12
|
error: l,
|
|
9
|
-
helperText:
|
|
13
|
+
helperText: i,
|
|
10
14
|
options: o,
|
|
11
15
|
placeholder: t = "Select an option...",
|
|
12
|
-
fullWidth:
|
|
13
|
-
size:
|
|
14
|
-
optional:
|
|
15
|
-
className:
|
|
16
|
-
id:
|
|
17
|
-
disabled:
|
|
16
|
+
fullWidth: f = !1,
|
|
17
|
+
size: N = "md",
|
|
18
|
+
optional: u = !1,
|
|
19
|
+
className: b,
|
|
20
|
+
id: v,
|
|
21
|
+
disabled: S,
|
|
18
22
|
required: d,
|
|
19
|
-
children:
|
|
20
|
-
...
|
|
21
|
-
},
|
|
22
|
-
const s =
|
|
23
|
+
children: $,
|
|
24
|
+
...j
|
|
25
|
+
}, y) => {
|
|
26
|
+
const s = v || `select-${Math.random().toString(36).substr(2, 9)}`, C = [
|
|
23
27
|
e.selectContainer,
|
|
24
|
-
|
|
28
|
+
f && e.fullWidth,
|
|
25
29
|
l && e.error,
|
|
26
|
-
|
|
27
|
-
].filter(Boolean).join(" "),
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
n && /* @__PURE__ */
|
|
30
|
+
b
|
|
31
|
+
].filter(Boolean).join(" "), O = [e.select, e[N]].filter(Boolean).join(" ");
|
|
32
|
+
return /* @__PURE__ */ c("div", { className: C, children: [
|
|
33
|
+
n && /* @__PURE__ */ c("label", { htmlFor: s, className: e.label, children: [
|
|
30
34
|
n,
|
|
31
|
-
|
|
35
|
+
u && /* @__PURE__ */ a("span", { className: e.optional, children: "(optional)" }),
|
|
32
36
|
d && /* @__PURE__ */ a("span", { "aria-label": "required", children: "*" })
|
|
33
37
|
] }),
|
|
34
|
-
/* @__PURE__ */ a("div", { className: e.selectWrapper, children: /* @__PURE__ */
|
|
38
|
+
/* @__PURE__ */ a("div", { className: e.selectWrapper, children: /* @__PURE__ */ c(
|
|
35
39
|
"select",
|
|
36
40
|
{
|
|
37
|
-
ref:
|
|
41
|
+
ref: y,
|
|
38
42
|
id: s,
|
|
39
|
-
className:
|
|
40
|
-
disabled:
|
|
43
|
+
className: O,
|
|
44
|
+
disabled: S,
|
|
41
45
|
required: d,
|
|
42
46
|
"aria-invalid": l ? "true" : "false",
|
|
43
|
-
"aria-describedby": l ? `${s}-error` :
|
|
44
|
-
...
|
|
47
|
+
"aria-describedby": l ? `${s}-error` : i ? `${s}-helper` : void 0,
|
|
48
|
+
...j,
|
|
45
49
|
children: [
|
|
46
50
|
t && /* @__PURE__ */ a("option", { value: "", disabled: !0, className: e.placeholder, children: t }),
|
|
47
51
|
o?.map((r) => /* @__PURE__ */ a(
|
|
@@ -53,12 +57,12 @@ const C = y(
|
|
|
53
57
|
},
|
|
54
58
|
r.value
|
|
55
59
|
)),
|
|
56
|
-
|
|
60
|
+
$
|
|
57
61
|
]
|
|
58
62
|
}
|
|
59
63
|
) }),
|
|
60
|
-
|
|
61
|
-
l && /* @__PURE__ */
|
|
64
|
+
i && !l && /* @__PURE__ */ a("span", { id: `${s}-helper`, className: e.helperText, children: i }),
|
|
65
|
+
l && /* @__PURE__ */ c(
|
|
62
66
|
"span",
|
|
63
67
|
{
|
|
64
68
|
id: `${s}-error`,
|
|
@@ -73,7 +77,9 @@ const C = y(
|
|
|
73
77
|
] });
|
|
74
78
|
}
|
|
75
79
|
);
|
|
76
|
-
|
|
80
|
+
h.displayName = "Select";
|
|
81
|
+
const g = h;
|
|
82
|
+
g.Option = p;
|
|
77
83
|
export {
|
|
78
|
-
|
|
84
|
+
g as Select
|
|
79
85
|
};
|
|
@@ -2,7 +2,9 @@ import { StoryObj } from '@storybook/react';
|
|
|
2
2
|
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: import('react').ForwardRefExoticComponent<import('./Select.types').SelectProps & import('react').RefAttributes<HTMLSelectElement
|
|
5
|
+
component: import('react').ForwardRefExoticComponent<import('./Select.types').SelectProps & import('react').RefAttributes<HTMLSelectElement>> & {
|
|
6
|
+
Option: import('react').ForwardRefExoticComponent<import('./Select.types').SelectOptionProps & import('react').RefAttributes<HTMLOptionElement>>;
|
|
7
|
+
};
|
|
6
8
|
parameters: {
|
|
7
9
|
layout: string;
|
|
8
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAKvD,QAAA,MAAM,IAAI
|
|
1
|
+
{"version":3,"file":"Select.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAKvD,QAAA,MAAM,IAAI;;;;;;;;;CAOqB,CAAC;AAEhC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAqBnC,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAYvB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAOtB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAOxB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAUvB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAWtB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAOnB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAOpB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAOnB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAiC7B,CAAC"}
|
|
@@ -1,13 +1,30 @@
|
|
|
1
1
|
import { SelectHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Select option type
|
|
4
|
+
* Select option type (for options prop)
|
|
5
5
|
*/
|
|
6
6
|
export interface SelectOption {
|
|
7
7
|
value: string;
|
|
8
8
|
label: string;
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Select.Option component props (for compound component usage)
|
|
13
|
+
*/
|
|
14
|
+
export interface SelectOptionProps extends React.OptionHTMLAttributes<HTMLOptionElement> {
|
|
15
|
+
/**
|
|
16
|
+
* Option value
|
|
17
|
+
*/
|
|
18
|
+
value: string;
|
|
19
|
+
/**
|
|
20
|
+
* Option label (displayed text)
|
|
21
|
+
*/
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Disabled state
|
|
25
|
+
*/
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
}
|
|
11
28
|
/**
|
|
12
29
|
* Select component props
|
|
13
30
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.types.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,WAAY,SAAQ,IAAI,CACvC,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,MAAM,CACP;IACC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IAEzB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAE1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB"}
|
|
1
|
+
{"version":3,"file":"Select.types.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IACtF;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,WAAY,SAAQ,IAAI,CACvC,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,MAAM,CACP;IACC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IAEzB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAE1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react/jsx-runtime"),S=require("react"),e=require("./Stack.module.css.cjs"),t=S.forwardRef(({direction:a="vertical",gap:r="md",align:s="stretch",justify:l="flex-start",wrap:c="nowrap",as:u="div",className:o,children:i,...d},n)=>{const f=[e.default.stack,e.default[a],e.default[`gap-${r}`],e.default[`align-${s}`],e.default[`justify-${l}`],e.default[`wrap-${c}`],o].filter(Boolean).join(" ");return m.jsx(u,{ref:n,className:f,...d,children:i})});t.displayName="Stack";exports.Stack=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stack.d.ts","sourceRoot":"","sources":["../../../src/components/Stack/Stack.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,eAAO,MAAM,KAAK,gFAiCjB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import d from "react";
|
|
4
|
+
import a from "./Stack.module.css.mjs";
|
|
5
|
+
const $ = d.forwardRef(
|
|
6
|
+
({
|
|
7
|
+
direction: t = "vertical",
|
|
8
|
+
gap: r = "md",
|
|
9
|
+
align: s = "stretch",
|
|
10
|
+
justify: o = "flex-start",
|
|
11
|
+
wrap: e = "nowrap",
|
|
12
|
+
as: c = "div",
|
|
13
|
+
className: i,
|
|
14
|
+
children: m,
|
|
15
|
+
...l
|
|
16
|
+
}, f) => {
|
|
17
|
+
const p = [
|
|
18
|
+
a.stack,
|
|
19
|
+
a[t],
|
|
20
|
+
a[`gap-${r}`],
|
|
21
|
+
a[`align-${s}`],
|
|
22
|
+
a[`justify-${o}`],
|
|
23
|
+
a[`wrap-${e}`],
|
|
24
|
+
i
|
|
25
|
+
].filter(Boolean).join(" ");
|
|
26
|
+
return /* @__PURE__ */ n(c, { ref: f, className: p, ...l, children: m });
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
$.displayName = "Stack";
|
|
30
|
+
export {
|
|
31
|
+
$ as Stack
|
|
32
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._stack_svmor_8{display:flex;box-sizing:border-box}._vertical_svmor_17{flex-direction:column}._horizontal_svmor_21{flex-direction:row}._gap-xs_svmor_29{gap:var(--spacing-2)}._gap-sm_svmor_33{gap:var(--spacing-3)}._gap-md_svmor_37{gap:var(--spacing-4)}._gap-lg_svmor_41{gap:var(--spacing-6)}._gap-xl_svmor_45{gap:var(--spacing-8)}._align-flex-start_svmor_53{align-items:flex-start}._align-center_svmor_57{align-items:center}._align-flex-end_svmor_61{align-items:flex-end}._align-stretch_svmor_65{align-items:stretch}._align-baseline_svmor_69{align-items:baseline}._justify-flex-start_svmor_77{justify-content:flex-start}._justify-center_svmor_81{justify-content:center}._justify-flex-end_svmor_85{justify-content:flex-end}._justify-space-between_svmor_89{justify-content:space-between}._justify-space-around_svmor_93{justify-content:space-around}._justify-space-evenly_svmor_97{justify-content:space-evenly}._wrap-nowrap_svmor_105{flex-wrap:nowrap}._wrap-wrap_svmor_109{flex-wrap:wrap}._wrap-wrap-reverse_svmor_113{flex-wrap:wrap-reverse}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s="_stack_svmor_8",_="_vertical_svmor_17",e="_horizontal_svmor_21",r={stack:s,vertical:_,horizontal:e,"gap-xs":"_gap-xs_svmor_29","gap-sm":"_gap-sm_svmor_33","gap-md":"_gap-md_svmor_37","gap-lg":"_gap-lg_svmor_41","gap-xl":"_gap-xl_svmor_45","align-flex-start":"_align-flex-start_svmor_53","align-center":"_align-center_svmor_57","align-flex-end":"_align-flex-end_svmor_61","align-stretch":"_align-stretch_svmor_65","align-baseline":"_align-baseline_svmor_69","justify-flex-start":"_justify-flex-start_svmor_77","justify-center":"_justify-center_svmor_81","justify-flex-end":"_justify-flex-end_svmor_85","justify-space-between":"_justify-space-between_svmor_89","justify-space-around":"_justify-space-around_svmor_93","justify-space-evenly":"_justify-space-evenly_svmor_97","wrap-nowrap":"_wrap-nowrap_svmor_105","wrap-wrap":"_wrap-wrap_svmor_109","wrap-wrap-reverse":"_wrap-wrap-reverse_svmor_113"};exports.default=r;exports.horizontal=e;exports.stack=s;exports.vertical=_;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const _ = "_stack_svmor_8", s = "_vertical_svmor_17", a = "_horizontal_svmor_21", r = {
|
|
2
|
+
stack: _,
|
|
3
|
+
vertical: s,
|
|
4
|
+
horizontal: a,
|
|
5
|
+
"gap-xs": "_gap-xs_svmor_29",
|
|
6
|
+
"gap-sm": "_gap-sm_svmor_33",
|
|
7
|
+
"gap-md": "_gap-md_svmor_37",
|
|
8
|
+
"gap-lg": "_gap-lg_svmor_41",
|
|
9
|
+
"gap-xl": "_gap-xl_svmor_45",
|
|
10
|
+
"align-flex-start": "_align-flex-start_svmor_53",
|
|
11
|
+
"align-center": "_align-center_svmor_57",
|
|
12
|
+
"align-flex-end": "_align-flex-end_svmor_61",
|
|
13
|
+
"align-stretch": "_align-stretch_svmor_65",
|
|
14
|
+
"align-baseline": "_align-baseline_svmor_69",
|
|
15
|
+
"justify-flex-start": "_justify-flex-start_svmor_77",
|
|
16
|
+
"justify-center": "_justify-center_svmor_81",
|
|
17
|
+
"justify-flex-end": "_justify-flex-end_svmor_85",
|
|
18
|
+
"justify-space-between": "_justify-space-between_svmor_89",
|
|
19
|
+
"justify-space-around": "_justify-space-around_svmor_93",
|
|
20
|
+
"justify-space-evenly": "_justify-space-evenly_svmor_97",
|
|
21
|
+
"wrap-nowrap": "_wrap-nowrap_svmor_105",
|
|
22
|
+
"wrap-wrap": "_wrap-wrap_svmor_109",
|
|
23
|
+
"wrap-wrap-reverse": "_wrap-wrap-reverse_svmor_113"
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
r as default,
|
|
27
|
+
a as horizontal,
|
|
28
|
+
_ as stack,
|
|
29
|
+
s as vertical
|
|
30
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: import('react').ForwardRefExoticComponent<import('./Stack.types').StackProps & import('react').RefAttributes<HTMLElement>>;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
tags: string[];
|
|
10
|
+
argTypes: {
|
|
11
|
+
direction: {
|
|
12
|
+
control: "select";
|
|
13
|
+
options: string[];
|
|
14
|
+
};
|
|
15
|
+
gap: {
|
|
16
|
+
control: "select";
|
|
17
|
+
options: string[];
|
|
18
|
+
};
|
|
19
|
+
align: {
|
|
20
|
+
control: "select";
|
|
21
|
+
options: string[];
|
|
22
|
+
};
|
|
23
|
+
justify: {
|
|
24
|
+
control: "select";
|
|
25
|
+
options: string[];
|
|
26
|
+
};
|
|
27
|
+
wrap: {
|
|
28
|
+
control: "select";
|
|
29
|
+
options: string[];
|
|
30
|
+
};
|
|
31
|
+
as: {
|
|
32
|
+
control: "select";
|
|
33
|
+
options: string[];
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export default meta;
|
|
38
|
+
type Story = StoryObj<typeof meta>;
|
|
39
|
+
export declare const Vertical: Story;
|
|
40
|
+
export declare const Horizontal: Story;
|
|
41
|
+
export declare const GapXs: Story;
|
|
42
|
+
export declare const GapSm: Story;
|
|
43
|
+
export declare const GapMd: Story;
|
|
44
|
+
export declare const GapLg: Story;
|
|
45
|
+
export declare const GapXl: Story;
|
|
46
|
+
export declare const AllGaps: Story;
|
|
47
|
+
export declare const AlignVariants: Story;
|
|
48
|
+
export declare const JustifyVariants: Story;
|
|
49
|
+
export declare const ButtonGroup: Story;
|
|
50
|
+
export declare const FormLayout: Story;
|
|
51
|
+
export declare const CardGrid: Story;
|
|
52
|
+
//# sourceMappingURL=Stack.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stack.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Stack/Stack.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAMvD,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCoB,CAAC;AAE/B,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAMnC,eAAO,MAAM,QAAQ,EAAE,KAYtB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAYxB,CAAC;AAMF,eAAO,MAAM,KAAK,EAAE,KAYnB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAYnB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAYnB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAYnB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAYnB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KA8GrB,CAAC;AAMF,eAAO,MAAM,aAAa,EAAE,KAyG3B,CAAC;AAMF,eAAO,MAAM,eAAe,EAAE,KAkG7B,CAAC;AAMF,eAAO,MAAM,WAAW,EAAE,KAQzB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAmBxB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAgEtB,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { HTMLAttributes, ElementType, PropsWithChildren } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Stack gap (spacing between children)
|
|
5
|
+
* Maps to design system spacing tokens
|
|
6
|
+
*/
|
|
7
|
+
export type StackGap = "xs" | "sm" | "md" | "lg" | "xl";
|
|
8
|
+
/**
|
|
9
|
+
* Stack direction
|
|
10
|
+
*/
|
|
11
|
+
export type StackDirection = "horizontal" | "vertical";
|
|
12
|
+
/**
|
|
13
|
+
* Flex align-items values
|
|
14
|
+
*/
|
|
15
|
+
export type StackAlign = "flex-start" | "center" | "flex-end" | "stretch" | "baseline";
|
|
16
|
+
/**
|
|
17
|
+
* Flex justify-content values
|
|
18
|
+
*/
|
|
19
|
+
export type StackJustify = "flex-start" | "center" | "flex-end" | "space-between" | "space-around" | "space-evenly";
|
|
20
|
+
/**
|
|
21
|
+
* Flex wrap values
|
|
22
|
+
*/
|
|
23
|
+
export type StackWrap = "nowrap" | "wrap" | "wrap-reverse";
|
|
24
|
+
/**
|
|
25
|
+
* Stack component props
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* // Vertical stack with medium gap (default)
|
|
30
|
+
* <Stack gap="md">
|
|
31
|
+
* <Card />
|
|
32
|
+
* <Card />
|
|
33
|
+
* <Card />
|
|
34
|
+
* </Stack>
|
|
35
|
+
*
|
|
36
|
+
* // Horizontal stack
|
|
37
|
+
* <Stack direction="horizontal" gap="sm" align="center">
|
|
38
|
+
* <Button>Action</Button>
|
|
39
|
+
* <Button>Cancel</Button>
|
|
40
|
+
* </Stack>
|
|
41
|
+
*
|
|
42
|
+
* // Custom element type
|
|
43
|
+
* <Stack as="form" direction="vertical" gap="lg">
|
|
44
|
+
* <Field label="Name" />
|
|
45
|
+
* <Field label="Email" />
|
|
46
|
+
* <Button type="submit">Submit</Button>
|
|
47
|
+
* </Stack>
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export interface StackProps extends PropsWithChildren<HTMLAttributes<HTMLElement>> {
|
|
51
|
+
/**
|
|
52
|
+
* Stack direction
|
|
53
|
+
* @default 'vertical'
|
|
54
|
+
*/
|
|
55
|
+
direction?: StackDirection;
|
|
56
|
+
/**
|
|
57
|
+
* Gap between children (uses design system spacing tokens)
|
|
58
|
+
* @default 'md'
|
|
59
|
+
*/
|
|
60
|
+
gap?: StackGap;
|
|
61
|
+
/**
|
|
62
|
+
* Align items (flex align-items)
|
|
63
|
+
* @default 'stretch'
|
|
64
|
+
*/
|
|
65
|
+
align?: StackAlign;
|
|
66
|
+
/**
|
|
67
|
+
* Justify content (flex justify-content)
|
|
68
|
+
* @default 'flex-start'
|
|
69
|
+
*/
|
|
70
|
+
justify?: StackJustify;
|
|
71
|
+
/**
|
|
72
|
+
* Flex wrap behavior
|
|
73
|
+
* @default 'nowrap'
|
|
74
|
+
*/
|
|
75
|
+
wrap?: StackWrap;
|
|
76
|
+
/**
|
|
77
|
+
* Custom element type to render as
|
|
78
|
+
* @default 'div'
|
|
79
|
+
*/
|
|
80
|
+
as?: ElementType;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=Stack.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stack.types.d.ts","sourceRoot":"","sources":["../../../src/components/Stack/Stack.types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE5E;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,UAAU,CAAC;AAEvD;;GAEG;AACH,MAAM,MAAM,UAAU,GAClB,YAAY,GACZ,QAAQ,GACR,UAAU,GACV,SAAS,GACT,UAAU,CAAC;AAEf;;GAEG;AACH,MAAM,MAAM,YAAY,GACpB,YAAY,GACZ,QAAQ,GACR,UAAU,GACV,eAAe,GACf,cAAc,GACd,cAAc,CAAC;AAEnB;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,cAAc,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,WAAW,UAAW,SAAQ,iBAAiB,CACnD,cAAc,CAAC,WAAW,CAAC,CAC5B;IACC;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B;;;OAGG;IACH,GAAG,CAAC,EAAE,QAAQ,CAAC;IAEf;;;OAGG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB;;;OAGG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;IAEvB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;;OAGG;IACH,EAAE,CAAC,EAAE,WAAW,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Stack/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EACV,UAAU,EACV,QAAQ,EACR,cAAc,EACd,UAAU,EACV,YAAY,EACZ,SAAS,GACV,MAAM,eAAe,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),b=require("../../contexts/ThemeContext.cjs"),S=require("../../hooks/useTheme.cjs"),
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),b=require("../../contexts/ThemeContext.cjs"),S=require("../../hooks/useTheme.cjs"),h=require("../Switch/Switch.cjs"),l=require("../Button/Button.cjs"),d=require("../Card/Card.cjs"),i=require("../Badge/Badge.cjs"),z=require("../Radio/Radio.cjs"),T=require("../Alert/Alert.cjs"),n={orion:{accent:"#1B5BFF",radius:"12px",description:"Blue accent • 12px radius"},red:{accent:"#D7282F",radius:"9999px",description:"Red accent • Pill buttons"},deepblue:{accent:"#006FBA",radius:"12px",description:"Deep Blue accent • 12px radius"},orange:{accent:"#F15D22",radius:"9999px",description:"Red-Orange accent • Pill buttons"},ember:{accent:"#F15D22",radius:"12px",description:"Orange accent • Black buttons • 12px radius"},lemon:{accent:"#72FF43",radius:"9999px",description:"Lime green accent • Highly rounded"}},v=({showBrandSelector:o=!0,showThemeToggle:p=!0,showSummary:y=!0,compact:m=!1,className:x,style:u,onThemeChange:j,onBrandChange:f})=>{const k=S.useTheme();let g=null;try{g=b.useThemeContext()}catch{}const{theme:t,brand:a,setTheme:B,setBrand:C}=g??k,s=r=>{B(r),j?.(r)},c=r=>{C(r),f?.(r)};return m?e.jsxs("div",{className:x,style:{display:"flex",gap:"var(--spacing-3)",alignItems:"center",flexWrap:"wrap"},children:[p&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--spacing-2)"},children:[e.jsx("span",{style:{fontSize:"20px"},children:"☀️"}),e.jsx(h.Switch,{checked:t==="dark",onChange:r=>s(r.target.checked?"dark":"light")}),e.jsx("span",{style:{fontSize:"20px"},children:"🌙"})]}),o&&e.jsx("div",{style:{display:"flex",gap:"var(--spacing-2)"},children:Object.keys(n).map(r=>e.jsx(l.Button,{variant:a===r?"primary":"secondary",size:"sm",onClick:()=>c(r),children:r.charAt(0).toUpperCase()+r.slice(1)},r))})]}):e.jsxs(d.Card,{variant:"elevated",className:x,style:{background:"var(--interactive-primary)",color:"var(--interactive-primary-text)",...u},children:[e.jsx(d.Card.Header,{children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--spacing-2)"},children:[e.jsx("span",{style:{fontSize:"24px"},children:"🎨"}),e.jsxs("div",{children:[e.jsx("h3",{style:{margin:0,color:"var(--interactive-primary-text)"},children:"Theme & Brand Settings"}),e.jsx("p",{style:{margin:0,fontSize:"var(--text-sm)",opacity:.9,color:"var(--interactive-primary-text)"},children:"Customize the appearance in real-time"})]})]})}),e.jsx(d.Card.Body,{style:{background:"var(--surface-base)",color:"var(--text-primary)"},children:e.jsxs("div",{style:{display:"grid",gap:"var(--spacing-6)"},children:[p&&e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"var(--spacing-3)"},children:[e.jsxs("div",{children:[e.jsx("label",{style:{display:"block",fontSize:"var(--text-lg)",fontWeight:"var(--font-weight-bold)",color:"var(--text-primary)",marginBottom:"var(--spacing-1)"},children:"Color Mode"}),e.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--text-secondary)",margin:0},children:"Switch between light and dark themes"})]}),e.jsx(i.Badge,{variant:t==="light"?"warning":"primary",size:"lg",children:t==="light"?"☀️ Light":"🌙 Dark"})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--spacing-3)",padding:"var(--spacing-4)",background:"var(--surface-subtle)",borderRadius:"var(--radius-control)",border:"2px solid var(--border-subtle)"},children:[e.jsx("span",{style:{fontSize:"32px"},children:"☀️"}),e.jsx(h.Switch,{checked:t==="dark",onChange:r=>s(r.target.checked?"dark":"light"),size:"lg"}),e.jsx("span",{style:{fontSize:"32px"},children:"🌙"}),e.jsxs("div",{style:{marginLeft:"auto",display:"flex",gap:"var(--spacing-2)"},children:[e.jsx(l.Button,{variant:t==="light"?"primary":"ghost",size:"sm",onClick:()=>s("light"),children:"Light"}),e.jsx(l.Button,{variant:t==="dark"?"primary":"ghost",size:"sm",onClick:()=>s("dark"),children:"Dark"})]})]})]}),o&&e.jsxs("div",{children:[e.jsxs("div",{style:{marginBottom:"var(--spacing-3)"},children:[e.jsx("label",{style:{display:"block",fontSize:"var(--text-lg)",fontWeight:"var(--font-weight-bold)",color:"var(--text-primary)",marginBottom:"var(--spacing-1)"},children:"Brand Identity"}),e.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--text-secondary)",margin:0},children:"Select a brand to see different accent colors and styling"})]}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(250px, 1fr))",gap:"var(--spacing-3)"},children:Object.keys(n).map(r=>e.jsxs("div",{onClick:()=>c(r),style:{padding:"var(--spacing-4)",background:a===r?"var(--interactive-primary)":"var(--surface-subtle)",color:a===r?"white":"var(--text-primary)",borderRadius:"var(--radius-control)",border:`2px solid ${a===r?"var(--interactive-primary)":"var(--border-subtle)"}`,cursor:"pointer",transition:"all 150ms ease"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"var(--spacing-2)"},children:[e.jsx(z.Radio,{name:"brand",value:r,checked:a===r,onChange:()=>c(r),label:r.charAt(0).toUpperCase()+r.slice(1),size:"lg"}),a===r&&e.jsx(i.Badge,{variant:"success",children:"Active"})]}),e.jsx("p",{style:{fontSize:"var(--text-sm)",margin:0,opacity:.8},children:n[r].description})]},r))})]}),y&&e.jsx(T.Alert,{variant:"info",title:"Current Settings",children:e.jsxs("div",{style:{display:"flex",gap:"var(--spacing-2)",flexWrap:"wrap"},children:[e.jsxs(i.Badge,{variant:"primary",children:["Theme: ",t]}),e.jsxs(i.Badge,{variant:"secondary",children:["Brand: ",a]}),e.jsxs(i.Badge,{variant:"secondary",children:["Accent: ",n[a].accent]}),e.jsxs(i.Badge,{variant:"secondary",children:["Radius:"," ",n[a].radius==="9999px"?"9999px (pills)":n[a].radius]})]})})]})})]})};v.displayName="ThemeController";exports.ThemeController=v;
|
|
@@ -6,8 +6,8 @@ import { Switch as v } from "../Switch/Switch.mjs";
|
|
|
6
6
|
import { Button as d } from "../Button/Button.mjs";
|
|
7
7
|
import { Card as o } from "../Card/Card.mjs";
|
|
8
8
|
import { Badge as n } from "../Badge/Badge.mjs";
|
|
9
|
-
import { Radio as
|
|
10
|
-
import { Alert as
|
|
9
|
+
import { Radio as F } from "../Radio/Radio.mjs";
|
|
10
|
+
import { Alert as I } from "../Alert/Alert.mjs";
|
|
11
11
|
const l = {
|
|
12
12
|
orion: {
|
|
13
13
|
accent: "#1B5BFF",
|
|
@@ -39,14 +39,14 @@ const l = {
|
|
|
39
39
|
radius: "9999px",
|
|
40
40
|
description: "Lime green accent • Highly rounded"
|
|
41
41
|
}
|
|
42
|
-
},
|
|
42
|
+
}, T = ({
|
|
43
43
|
showBrandSelector: p = !0,
|
|
44
|
-
showThemeToggle:
|
|
44
|
+
showThemeToggle: g = !0,
|
|
45
45
|
showSummary: y = !0,
|
|
46
46
|
compact: u = !1,
|
|
47
|
-
className:
|
|
48
|
-
style:
|
|
49
|
-
onThemeChange:
|
|
47
|
+
className: h,
|
|
48
|
+
style: x,
|
|
49
|
+
onThemeChange: f,
|
|
50
50
|
onBrandChange: k
|
|
51
51
|
}) => {
|
|
52
52
|
const C = S();
|
|
@@ -56,14 +56,14 @@ const l = {
|
|
|
56
56
|
} catch {
|
|
57
57
|
}
|
|
58
58
|
const { theme: t, brand: i, setTheme: b, setBrand: z } = m ?? C, c = (e) => {
|
|
59
|
-
b(e),
|
|
59
|
+
b(e), f?.(e);
|
|
60
60
|
}, s = (e) => {
|
|
61
61
|
z(e), k?.(e);
|
|
62
62
|
};
|
|
63
63
|
return u ? /* @__PURE__ */ a(
|
|
64
64
|
"div",
|
|
65
65
|
{
|
|
66
|
-
className:
|
|
66
|
+
className: h,
|
|
67
67
|
style: {
|
|
68
68
|
display: "flex",
|
|
69
69
|
gap: "var(--spacing-3)",
|
|
@@ -71,7 +71,7 @@ const l = {
|
|
|
71
71
|
flexWrap: "wrap"
|
|
72
72
|
},
|
|
73
73
|
children: [
|
|
74
|
-
|
|
74
|
+
g && /* @__PURE__ */ a(
|
|
75
75
|
"div",
|
|
76
76
|
{
|
|
77
77
|
style: {
|
|
@@ -108,11 +108,11 @@ const l = {
|
|
|
108
108
|
o,
|
|
109
109
|
{
|
|
110
110
|
variant: "elevated",
|
|
111
|
-
className:
|
|
111
|
+
className: h,
|
|
112
112
|
style: {
|
|
113
113
|
background: "var(--interactive-primary)",
|
|
114
|
-
color: "
|
|
115
|
-
...
|
|
114
|
+
color: "var(--interactive-primary-text)",
|
|
115
|
+
...x
|
|
116
116
|
},
|
|
117
117
|
children: [
|
|
118
118
|
/* @__PURE__ */ r(o.Header, { children: /* @__PURE__ */ a(
|
|
@@ -126,7 +126,7 @@ const l = {
|
|
|
126
126
|
children: [
|
|
127
127
|
/* @__PURE__ */ r("span", { style: { fontSize: "24px" }, children: "🎨" }),
|
|
128
128
|
/* @__PURE__ */ a("div", { children: [
|
|
129
|
-
/* @__PURE__ */ r("h3", { style: { margin: 0, color: "
|
|
129
|
+
/* @__PURE__ */ r("h3", { style: { margin: 0, color: "var(--interactive-primary-text)" }, children: "Theme & Brand Settings" }),
|
|
130
130
|
/* @__PURE__ */ r(
|
|
131
131
|
"p",
|
|
132
132
|
{
|
|
@@ -134,7 +134,7 @@ const l = {
|
|
|
134
134
|
margin: 0,
|
|
135
135
|
fontSize: "var(--text-sm)",
|
|
136
136
|
opacity: 0.9,
|
|
137
|
-
color: "
|
|
137
|
+
color: "var(--interactive-primary-text)"
|
|
138
138
|
},
|
|
139
139
|
children: "Customize the appearance in real-time"
|
|
140
140
|
}
|
|
@@ -151,7 +151,7 @@ const l = {
|
|
|
151
151
|
color: "var(--text-primary)"
|
|
152
152
|
},
|
|
153
153
|
children: /* @__PURE__ */ a("div", { style: { display: "grid", gap: "var(--spacing-6)" }, children: [
|
|
154
|
-
|
|
154
|
+
g && /* @__PURE__ */ a("div", { children: [
|
|
155
155
|
/* @__PURE__ */ a(
|
|
156
156
|
"div",
|
|
157
157
|
{
|
|
@@ -316,7 +316,7 @@ const l = {
|
|
|
316
316
|
},
|
|
317
317
|
children: [
|
|
318
318
|
/* @__PURE__ */ r(
|
|
319
|
-
|
|
319
|
+
F,
|
|
320
320
|
{
|
|
321
321
|
name: "brand",
|
|
322
322
|
value: e,
|
|
@@ -348,7 +348,7 @@ const l = {
|
|
|
348
348
|
}
|
|
349
349
|
)
|
|
350
350
|
] }),
|
|
351
|
-
y && /* @__PURE__ */ r(
|
|
351
|
+
y && /* @__PURE__ */ r(I, { variant: "info", title: "Current Settings", children: /* @__PURE__ */ a(
|
|
352
352
|
"div",
|
|
353
353
|
{
|
|
354
354
|
style: {
|
|
@@ -384,7 +384,7 @@ const l = {
|
|
|
384
384
|
}
|
|
385
385
|
);
|
|
386
386
|
};
|
|
387
|
-
|
|
387
|
+
T.displayName = "ThemeController";
|
|
388
388
|
export {
|
|
389
|
-
|
|
389
|
+
T as ThemeController
|
|
390
390
|
};
|