@techsio/ui-kit 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.storybook/main.d.ts.map +1 -1
- package/dist/.storybook/preview.d.ts.map +1 -1
- package/dist/organisms/footer.figma.js +51 -0
- package/dist/organisms/footer.js +11 -11
- package/dist/organisms/gallery.figma.js +34 -0
- package/dist/organisms/header.figma.js +58 -0
- package/dist/organisms/table.figma.js +87 -0
- package/dist/organisms/table.js +6 -6
- package/dist/src/organisms/footer.d.ts.map +1 -1
- package/dist/src/organisms/footer.figma.d.ts +2 -0
- package/dist/src/organisms/footer.figma.d.ts.map +1 -0
- package/dist/src/organisms/gallery.figma.d.ts +2 -0
- package/dist/src/organisms/gallery.figma.d.ts.map +1 -0
- package/dist/src/organisms/header.figma.d.ts +2 -0
- package/dist/src/organisms/header.figma.d.ts.map +1 -0
- package/dist/src/organisms/table.figma.d.ts +2 -0
- package/dist/src/organisms/table.figma.d.ts.map +1 -0
- package/dist/src/theme/theme-config.d.ts +41 -0
- package/dist/src/theme/theme-config.d.ts.map +1 -0
- package/dist/src/theme/theme-provider.d.ts +37 -0
- package/dist/src/theme/theme-provider.d.ts.map +1 -0
- package/dist/src/theme/theme-toggle.d.ts +4 -0
- package/dist/src/theme/theme-toggle.d.ts.map +1 -0
- package/dist/theme/theme-config.js +46 -0
- package/dist/theme/theme-provider.js +101 -0
- package/dist/theme/theme-toggle.js +71 -0
- package/package.json +34 -31
- package/src/tokens/_tokens-base.css +6 -0
- package/src/tokens/components/organisms/_footer.css +8 -82
- package/src/tokens/components/organisms/_gallery.css +11 -33
- package/src/tokens/components/organisms/_header.css +11 -80
- package/src/tokens/components/organisms/_table.css +15 -61
- package/src/tokens/figma/brand-overrides.css +49 -0
- package/src/tokens/figma/dark/variables.css +10 -6
- package/src/tokens/figma/light/variables.css +10 -6
- package/src/tokens/figma/neo/variables.css +1792 -0
- package/src/tokens/figma/neo-dark/variables.css +1792 -0
- package/src/tokens/figma/variables.css +13 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../.storybook/main.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAE9D,QAAA,MAAM,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../.storybook/main.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAE9D,QAAA,MAAM,MAAM,EAAE,eAkBb,CAAA;AAED,eAAe,MAAM,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../.storybook/preview.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../.storybook/preview.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAU1D,OAAO,yBAAyB,CAAA;AA2ChC,QAAA,MAAM,OAAO,EAAE,OA0Dd,CAAA;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import code_connect from "@figma/code-connect";
|
|
3
|
+
import { Footer } from "./footer.js";
|
|
4
|
+
code_connect.connect(Footer, "https://www.figma.com/design/12xb1pqXKwE2vbOByN3ntg/New-Design-System-vol.-2?node-id=1372-161", {
|
|
5
|
+
imports: [
|
|
6
|
+
'import { Footer } from "@libs/ui/organisms/footer"'
|
|
7
|
+
],
|
|
8
|
+
props: {
|
|
9
|
+
size: code_connect["enum"]("size", {
|
|
10
|
+
sm: "sm",
|
|
11
|
+
md: "md",
|
|
12
|
+
lg: "lg"
|
|
13
|
+
})
|
|
14
|
+
},
|
|
15
|
+
example: ({ size })=>/*#__PURE__*/ jsxs(Footer, {
|
|
16
|
+
size: size,
|
|
17
|
+
children: [
|
|
18
|
+
/*#__PURE__*/ jsx(Footer.Container, {
|
|
19
|
+
children: /*#__PURE__*/ jsxs(Footer.Section, {
|
|
20
|
+
children: [
|
|
21
|
+
/*#__PURE__*/ jsx(Footer.Title, {
|
|
22
|
+
children: "Shop"
|
|
23
|
+
}),
|
|
24
|
+
/*#__PURE__*/ jsxs(Footer.List, {
|
|
25
|
+
children: [
|
|
26
|
+
/*#__PURE__*/ jsx("li", {
|
|
27
|
+
children: /*#__PURE__*/ jsx(Footer.Link, {
|
|
28
|
+
href: "/new",
|
|
29
|
+
children: "New arrivals"
|
|
30
|
+
})
|
|
31
|
+
}),
|
|
32
|
+
/*#__PURE__*/ jsx("li", {
|
|
33
|
+
children: /*#__PURE__*/ jsx(Footer.Link, {
|
|
34
|
+
href: "/sale",
|
|
35
|
+
children: "Sale"
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
]
|
|
39
|
+
})
|
|
40
|
+
]
|
|
41
|
+
})
|
|
42
|
+
}),
|
|
43
|
+
/*#__PURE__*/ jsx(Footer.Divider, {}),
|
|
44
|
+
/*#__PURE__*/ jsx(Footer.Bottom, {
|
|
45
|
+
children: /*#__PURE__*/ jsx(Footer.Text, {
|
|
46
|
+
children: "\xa9 2026 Acme, Inc."
|
|
47
|
+
})
|
|
48
|
+
})
|
|
49
|
+
]
|
|
50
|
+
})
|
|
51
|
+
});
|
package/dist/organisms/footer.js
CHANGED
|
@@ -7,8 +7,8 @@ const footerVariants = tv({
|
|
|
7
7
|
root: "flex w-full items-center justify-center rounded-footer bg-footer-bg",
|
|
8
8
|
container: "w-full max-w-footer-max bg-footer-container-bg",
|
|
9
9
|
section: "bg-footer-section-bg",
|
|
10
|
-
list: "flex list-none flex-col gap-footer-list
|
|
11
|
-
bottom: "flex w-full items-center justify-between border-t-(
|
|
10
|
+
list: "flex list-none flex-col gap-footer-list bg-footer-list-bg",
|
|
11
|
+
bottom: "flex w-full items-center justify-between border-t-(length:--border-footer-width) bg-footer-bottom-bg pt-footer-bottom",
|
|
12
12
|
title: "font-footer-title text-footer-title-fg transition-footer-title hover:text-footer-title-fg-hover",
|
|
13
13
|
link: "font-footer-link text-footer-link-fg transition-footer-link hover:text-footer-link-fg-hover",
|
|
14
14
|
text: "text-footer-text-fg",
|
|
@@ -41,35 +41,35 @@ const footerVariants = tv({
|
|
|
41
41
|
},
|
|
42
42
|
size: {
|
|
43
43
|
sm: {
|
|
44
|
-
root: "p-footer-
|
|
44
|
+
root: "p-footer-sm",
|
|
45
45
|
container: "gap-footer-container-sm",
|
|
46
46
|
section: "gap-footer-section-sm",
|
|
47
|
-
list: "gap-footer-
|
|
47
|
+
list: "gap-footer-sm",
|
|
48
48
|
title: "text-footer-title-sm",
|
|
49
49
|
link: "text-footer-link-sm",
|
|
50
|
-
text: "text-footer-
|
|
50
|
+
text: "text-footer-sm",
|
|
51
51
|
bottom: "p-footer-bottom-sm",
|
|
52
52
|
divider: "my-footer-divider-sm"
|
|
53
53
|
},
|
|
54
54
|
md: {
|
|
55
|
-
root: "p-footer-
|
|
55
|
+
root: "p-footer-md",
|
|
56
56
|
container: "gap-footer-container-md",
|
|
57
57
|
section: "gap-footer-section-md",
|
|
58
|
-
list: "gap-footer-
|
|
58
|
+
list: "gap-footer-md",
|
|
59
59
|
title: "text-footer-title-md",
|
|
60
60
|
link: "text-footer-link-md",
|
|
61
|
-
text: "text-footer-
|
|
61
|
+
text: "text-footer-md",
|
|
62
62
|
bottom: "p-footer-bottom-md",
|
|
63
63
|
divider: "my-footer-divider-md"
|
|
64
64
|
},
|
|
65
65
|
lg: {
|
|
66
|
-
root: "p-footer-
|
|
66
|
+
root: "p-footer-lg",
|
|
67
67
|
container: "gap-footer-container-lg",
|
|
68
68
|
section: "gap-footer-section-lg",
|
|
69
|
-
list: "gap-footer-
|
|
69
|
+
list: "gap-footer-lg",
|
|
70
70
|
title: "text-footer-title-lg",
|
|
71
71
|
link: "text-footer-link-lg",
|
|
72
|
-
text: "text-footer-
|
|
72
|
+
text: "text-footer-lg",
|
|
73
73
|
bottom: "p-footer-bottom-lg",
|
|
74
74
|
divider: "my-footer-divider-lg"
|
|
75
75
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import code_connect from "@figma/code-connect";
|
|
3
|
+
import { Gallery } from "./gallery.js";
|
|
4
|
+
code_connect.connect(Gallery, "https://www.figma.com/design/12xb1pqXKwE2vbOByN3ntg/New-Design-System-vol.-2?node-id=1392-68", {
|
|
5
|
+
imports: [
|
|
6
|
+
'import { Gallery } from "@libs/ui/organisms/gallery"'
|
|
7
|
+
],
|
|
8
|
+
props: {
|
|
9
|
+
orientation: code_connect["enum"]("orientation", {
|
|
10
|
+
vertical: "vertical",
|
|
11
|
+
horizontal: "horizontal"
|
|
12
|
+
})
|
|
13
|
+
},
|
|
14
|
+
example: ({ orientation })=>/*#__PURE__*/ jsx(Gallery, {
|
|
15
|
+
items: [
|
|
16
|
+
{
|
|
17
|
+
id: "1",
|
|
18
|
+
src: "/product-1.jpg",
|
|
19
|
+
alt: "Product front"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: "2",
|
|
23
|
+
src: "/product-2.jpg",
|
|
24
|
+
alt: "Product side"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: "3",
|
|
28
|
+
src: "/product-3.jpg",
|
|
29
|
+
alt: "Product detail"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
orientation: orientation
|
|
33
|
+
})
|
|
34
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import code_connect from "@figma/code-connect";
|
|
3
|
+
import { Header } from "./header.js";
|
|
4
|
+
code_connect.connect(Header, "https://www.figma.com/design/12xb1pqXKwE2vbOByN3ntg/New-Design-System-vol.-2?node-id=1391-225", {
|
|
5
|
+
imports: [
|
|
6
|
+
'import { Header } from "@libs/ui/organisms/header"'
|
|
7
|
+
],
|
|
8
|
+
props: {
|
|
9
|
+
size: code_connect["enum"]("size", {
|
|
10
|
+
sm: "sm",
|
|
11
|
+
md: "md",
|
|
12
|
+
lg: "lg"
|
|
13
|
+
})
|
|
14
|
+
},
|
|
15
|
+
example: ({ size })=>/*#__PURE__*/ jsxs(Header, {
|
|
16
|
+
size: size,
|
|
17
|
+
children: [
|
|
18
|
+
/*#__PURE__*/ jsxs(Header.Desktop, {
|
|
19
|
+
children: [
|
|
20
|
+
/*#__PURE__*/ jsx(Header.Container, {
|
|
21
|
+
position: "start",
|
|
22
|
+
children: "Logo"
|
|
23
|
+
}),
|
|
24
|
+
/*#__PURE__*/ jsxs(Header.Nav, {
|
|
25
|
+
children: [
|
|
26
|
+
/*#__PURE__*/ jsx(Header.NavItem, {
|
|
27
|
+
active: true,
|
|
28
|
+
children: "Home"
|
|
29
|
+
}),
|
|
30
|
+
/*#__PURE__*/ jsx(Header.NavItem, {
|
|
31
|
+
children: "Shop"
|
|
32
|
+
}),
|
|
33
|
+
/*#__PURE__*/ jsx(Header.NavItem, {
|
|
34
|
+
children: "About"
|
|
35
|
+
})
|
|
36
|
+
]
|
|
37
|
+
}),
|
|
38
|
+
/*#__PURE__*/ jsx(Header.Actions, {
|
|
39
|
+
children: /*#__PURE__*/ jsx(Header.ActionItem, {
|
|
40
|
+
children: "Cart"
|
|
41
|
+
})
|
|
42
|
+
})
|
|
43
|
+
]
|
|
44
|
+
}),
|
|
45
|
+
/*#__PURE__*/ jsx(Header.Hamburger, {}),
|
|
46
|
+
/*#__PURE__*/ jsxs(Header.Mobile, {
|
|
47
|
+
children: [
|
|
48
|
+
/*#__PURE__*/ jsx(Header.NavItem, {
|
|
49
|
+
children: "Home"
|
|
50
|
+
}),
|
|
51
|
+
/*#__PURE__*/ jsx(Header.NavItem, {
|
|
52
|
+
children: "Shop"
|
|
53
|
+
})
|
|
54
|
+
]
|
|
55
|
+
})
|
|
56
|
+
]
|
|
57
|
+
})
|
|
58
|
+
});
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import code_connect from "@figma/code-connect";
|
|
3
|
+
import { Table } from "./table.js";
|
|
4
|
+
code_connect.connect(Table, "https://www.figma.com/design/12xb1pqXKwE2vbOByN3ntg/New-Design-System-vol.-2?node-id=1393-232", {
|
|
5
|
+
imports: [
|
|
6
|
+
'import { Table } from "@libs/ui/organisms/table"'
|
|
7
|
+
],
|
|
8
|
+
props: {
|
|
9
|
+
variant: code_connect["enum"]("variant", {
|
|
10
|
+
line: "line",
|
|
11
|
+
outline: "outline",
|
|
12
|
+
striped: "striped"
|
|
13
|
+
}),
|
|
14
|
+
size: code_connect["enum"]("size", {
|
|
15
|
+
sm: "sm",
|
|
16
|
+
md: "md",
|
|
17
|
+
lg: "lg"
|
|
18
|
+
})
|
|
19
|
+
},
|
|
20
|
+
example: ({ variant, size })=>/*#__PURE__*/ jsxs(Table, {
|
|
21
|
+
size: size,
|
|
22
|
+
variant: variant,
|
|
23
|
+
children: [
|
|
24
|
+
/*#__PURE__*/ jsx(Table.Caption, {
|
|
25
|
+
children: "Recent orders"
|
|
26
|
+
}),
|
|
27
|
+
/*#__PURE__*/ jsx(Table.Header, {
|
|
28
|
+
children: /*#__PURE__*/ jsxs(Table.Row, {
|
|
29
|
+
children: [
|
|
30
|
+
/*#__PURE__*/ jsx(Table.ColumnHeader, {
|
|
31
|
+
children: "Order"
|
|
32
|
+
}),
|
|
33
|
+
/*#__PURE__*/ jsx(Table.ColumnHeader, {
|
|
34
|
+
children: "Status"
|
|
35
|
+
}),
|
|
36
|
+
/*#__PURE__*/ jsx(Table.ColumnHeader, {
|
|
37
|
+
children: "Total"
|
|
38
|
+
})
|
|
39
|
+
]
|
|
40
|
+
})
|
|
41
|
+
}),
|
|
42
|
+
/*#__PURE__*/ jsxs(Table.Body, {
|
|
43
|
+
children: [
|
|
44
|
+
/*#__PURE__*/ jsxs(Table.Row, {
|
|
45
|
+
children: [
|
|
46
|
+
/*#__PURE__*/ jsx(Table.Cell, {
|
|
47
|
+
children: "#1001"
|
|
48
|
+
}),
|
|
49
|
+
/*#__PURE__*/ jsx(Table.Cell, {
|
|
50
|
+
children: "Shipped"
|
|
51
|
+
}),
|
|
52
|
+
/*#__PURE__*/ jsx(Table.Cell, {
|
|
53
|
+
children: "$99.00"
|
|
54
|
+
})
|
|
55
|
+
]
|
|
56
|
+
}),
|
|
57
|
+
/*#__PURE__*/ jsxs(Table.Row, {
|
|
58
|
+
children: [
|
|
59
|
+
/*#__PURE__*/ jsx(Table.Cell, {
|
|
60
|
+
children: "#1002"
|
|
61
|
+
}),
|
|
62
|
+
/*#__PURE__*/ jsx(Table.Cell, {
|
|
63
|
+
children: "Pending"
|
|
64
|
+
}),
|
|
65
|
+
/*#__PURE__*/ jsx(Table.Cell, {
|
|
66
|
+
children: "$149.00"
|
|
67
|
+
})
|
|
68
|
+
]
|
|
69
|
+
})
|
|
70
|
+
]
|
|
71
|
+
}),
|
|
72
|
+
/*#__PURE__*/ jsx(Table.Footer, {
|
|
73
|
+
children: /*#__PURE__*/ jsxs(Table.Row, {
|
|
74
|
+
children: [
|
|
75
|
+
/*#__PURE__*/ jsx(Table.Cell, {
|
|
76
|
+
children: "Total"
|
|
77
|
+
}),
|
|
78
|
+
/*#__PURE__*/ jsx(Table.Cell, {}),
|
|
79
|
+
/*#__PURE__*/ jsx(Table.Cell, {
|
|
80
|
+
children: "$248.00"
|
|
81
|
+
})
|
|
82
|
+
]
|
|
83
|
+
})
|
|
84
|
+
})
|
|
85
|
+
]
|
|
86
|
+
})
|
|
87
|
+
});
|
package/dist/organisms/table.js
CHANGED
|
@@ -21,7 +21,7 @@ const tableVariants = tv({
|
|
|
21
21
|
"font-table-footer text-table-footer-fg"
|
|
22
22
|
],
|
|
23
23
|
row: [
|
|
24
|
-
"border-b-(length:--border-width
|
|
24
|
+
"border-b-(length:--border-table-width) border-table-border",
|
|
25
25
|
"data-[selected=true]:bg-table-row-bg-selected",
|
|
26
26
|
"transition-colors duration-200 motion-reduce:transition-none"
|
|
27
27
|
],
|
|
@@ -37,13 +37,13 @@ const tableVariants = tv({
|
|
|
37
37
|
variant: {
|
|
38
38
|
line: {
|
|
39
39
|
root: "",
|
|
40
|
-
row: "border-b-(length:--border-width
|
|
40
|
+
row: "border-b-(length:--border-table-width) border-table-border"
|
|
41
41
|
},
|
|
42
42
|
outline: {
|
|
43
|
-
root: "border-(length:--border-width
|
|
43
|
+
root: "border-(length:--border-table-width) rounded-table border-table-border shadow-table-outline"
|
|
44
44
|
},
|
|
45
45
|
striped: {
|
|
46
|
-
row: "odd:bg-table-row-striped-
|
|
46
|
+
row: "odd:bg-table-row-striped-primary even:bg-table-row-striped-secondary"
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
interactive: {
|
|
@@ -87,8 +87,8 @@ const tableVariants = tv({
|
|
|
87
87
|
},
|
|
88
88
|
showColumnBorder: {
|
|
89
89
|
true: {
|
|
90
|
-
columnHeader: "border-r-(length:--border-width
|
|
91
|
-
cell: "border-r-(length:--border-width
|
|
90
|
+
columnHeader: "border-r-(length:--border-table-width) border-table-border",
|
|
91
|
+
cell: "border-r-(length:--border-table-width) border-table-border"
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
94
|
captionPlacement: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["../../../src/organisms/footer.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["../../../src/organisms/footer.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,wBAAwB,EAE7B,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAIrD,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAiFlB,CAAA;AAUF,UAAU,WACR,SAAQ,cAAc,CAAC,WAAW,CAAC,EACjC,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,UAAU,oBAAqB,SAAQ,cAAc,CAAC,WAAW,CAAC;IAChE,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,UAAU,kBAAmB,SAAQ,cAAc,CAAC,WAAW,CAAC;IAC9D,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,UAAU,gBAAiB,SAAQ,cAAc,CAAC,WAAW,CAAC;IAC5D,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,KAAK,mBAAmB,GAAG;IACzB,QAAQ,EAAE,SAAS,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,KAAK,qBAAqB,GAAG,mBAAmB,GAC9C,IAAI,CACF,wBAAwB,CAAC,GAAG,CAAC,EAC7B,MAAM,mBAAmB,GAAG,IAAI,GAAG,MAAM,CAC1C,GAAG;IACF,EAAE,CAAC,EAAE,KAAK,CAAA;IACV,IAAI,EAAE,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;CACzD,CAAA;AAEH,KAAK,qBAAqB,CAAC,CAAC,SAAS,WAAW,IAAI,mBAAmB,GACrE,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,MAAM,mBAAmB,GAAG,IAAI,CAAC,GAAG;IACpE,EAAE,EAAE,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;CACpB,CAAA;AAMH,UAAU,eAAgB,SAAQ,cAAc,CAAC,WAAW,CAAC;IAC3D,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,UAAU,eAAgB,SAAQ,cAAc,CAAC,gBAAgB,CAAC;IAChE,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,UAAU,kBAAmB,SAAQ,cAAc,CAAC,aAAa,CAAC;CAAG;AAErE,UAAU,iBAAkB,SAAQ,cAAc,CAAC,cAAc,CAAC;IAChE,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,wBAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,SAAS,EACT,MAAM,EACN,SAAS,GACV,EAAE,WAAW,2CAQb;yBAfe,MAAM;8CAoBnB,oBAAoB;4CASpB,kBAAkB;yCASwC,gBAAgB;;wCA2BlB,eAAe;kDAUvE,eAAe;2CAaf,kBAAkB;oDAUlB,iBAAiB;;AAtDpB,iBAAS,UAAU,CAAC,KAAK,EAAE,qBAAqB,GAAG,SAAS,CAAA;AAC5D,iBAAS,UAAU,CAAC,CAAC,SAAS,WAAW,EACvC,KAAK,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAC9B,SAAS,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"footer.figma.d.ts","sourceRoot":"","sources":["../../../src/organisms/footer.figma.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gallery.figma.d.ts","sourceRoot":"","sources":["../../../src/organisms/gallery.figma.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header.figma.d.ts","sourceRoot":"","sources":["../../../src/organisms/header.figma.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.figma.d.ts","sourceRoot":"","sources":["../../../src/organisms/table.figma.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export type ColorMode = "light" | "dark";
|
|
2
|
+
/** What the user can pick for the mode axis. `system` follows the OS. */
|
|
3
|
+
export type ModeSetting = ColorMode | "system";
|
|
4
|
+
export type BrandConfig = {
|
|
5
|
+
/** Human label shown in togglers. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Concrete modes this brand ships. Light-only brands omit "dark". */
|
|
8
|
+
modes: ColorMode[];
|
|
9
|
+
/**
|
|
10
|
+
* `data-theme` attribute value for this brand. Omitted for the base brand,
|
|
11
|
+
* which is the default `:root` / `@theme` and needs no attribute.
|
|
12
|
+
*/
|
|
13
|
+
attr?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const THEMES: {
|
|
16
|
+
readonly base: {
|
|
17
|
+
readonly label: "Default";
|
|
18
|
+
readonly modes: ["light", "dark"];
|
|
19
|
+
};
|
|
20
|
+
readonly neo: {
|
|
21
|
+
readonly label: "Neo (Red)";
|
|
22
|
+
readonly modes: ["light", "dark"];
|
|
23
|
+
readonly attr: "neo";
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export type BrandKey = keyof typeof THEMES;
|
|
27
|
+
export declare const DEFAULT_BRAND: BrandKey;
|
|
28
|
+
export declare const DEFAULT_MODE: ModeSetting;
|
|
29
|
+
/** localStorage keys used by the provider for persistence. */
|
|
30
|
+
export declare const BRAND_STORAGE_KEY = "ui-brand";
|
|
31
|
+
export declare const MODE_STORAGE_KEY = "ui-mode";
|
|
32
|
+
export declare function brandKeys(): BrandKey[];
|
|
33
|
+
export declare function getBrand(key: BrandKey): BrandConfig;
|
|
34
|
+
export declare function isBrandKey(value: string): value is BrandKey;
|
|
35
|
+
/** `data-theme` value for a brand, or `undefined` for the attribute-less base. */
|
|
36
|
+
export declare function brandAttr(key: BrandKey): string | undefined;
|
|
37
|
+
/** Whether a brand ships a dark variant (and therefore allows mode switching). */
|
|
38
|
+
export declare function brandSupportsDark(key: BrandKey): boolean;
|
|
39
|
+
/** Mode settings a brand allows in a toggler. Light-only brands get just light. */
|
|
40
|
+
export declare function availableModeSettings(key: BrandKey): ModeSetting[];
|
|
41
|
+
//# sourceMappingURL=theme-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-config.d.ts","sourceRoot":"","sources":["../../../src/theme/theme-config.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAA;AAExC,yEAAyE;AACzE,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,QAAQ,CAAA;AAE9C,MAAM,MAAM,WAAW,GAAG;IACxB,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAA;IACb,sEAAsE;IACtE,KAAK,EAAE,SAAS,EAAE,CAAA;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,eAAO,MAAM,MAAM;;;;;;;;;;CAG6B,CAAA;AAEhD,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,MAAM,CAAA;AAE1C,eAAO,MAAM,aAAa,EAAE,QAAiB,CAAA;AAC7C,eAAO,MAAM,YAAY,EAAE,WAAsB,CAAA;AAEjD,8DAA8D;AAC9D,eAAO,MAAM,iBAAiB,aAAa,CAAA;AAC3C,eAAO,MAAM,gBAAgB,YAAY,CAAA;AAEzC,wBAAgB,SAAS,IAAI,QAAQ,EAAE,CAEtC;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,QAAQ,GAAG,WAAW,CAEnD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,QAAQ,CAE3D;AAED,kFAAkF;AAClF,wBAAgB,SAAS,CAAC,GAAG,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,CAE3D;AAED,kFAAkF;AAClF,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,QAAQ,GAAG,OAAO,CAExD;AAED,mFAAmF;AACnF,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,QAAQ,GAAG,WAAW,EAAE,CAElE"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type PropsWithChildren } from "react";
|
|
2
|
+
import { type BrandKey, type ColorMode, type ModeSetting } from "./theme-config";
|
|
3
|
+
type AppThemeProviderProps = PropsWithChildren<{
|
|
4
|
+
defaultBrand?: BrandKey;
|
|
5
|
+
defaultMode?: ModeSetting;
|
|
6
|
+
}>;
|
|
7
|
+
export declare function AppThemeProvider({ defaultBrand, defaultMode, children, }: AppThemeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export type UseAppThemeResult = {
|
|
9
|
+
/** Active brand key. */
|
|
10
|
+
brand: BrandKey;
|
|
11
|
+
/** All brand keys, for building a brand toggler. */
|
|
12
|
+
brands: BrandKey[];
|
|
13
|
+
setBrand: (brand: BrandKey) => void;
|
|
14
|
+
/** Current mode setting (may be "system"). */
|
|
15
|
+
mode: ModeSetting;
|
|
16
|
+
/** Resolved concrete mode after applying "system". */
|
|
17
|
+
resolvedMode: ColorMode;
|
|
18
|
+
setMode: (mode: ModeSetting) => void;
|
|
19
|
+
/** Mode settings allowed for the active brand (light-only brands get just light). */
|
|
20
|
+
availableModes: ModeSetting[];
|
|
21
|
+
/** False during SSR and the first client render; gate brand-dependent UI on it. */
|
|
22
|
+
mounted: boolean;
|
|
23
|
+
};
|
|
24
|
+
export declare function useAppTheme(): UseAppThemeResult;
|
|
25
|
+
/**
|
|
26
|
+
* Pre-hydration script that applies the persisted brand's `data-theme` before
|
|
27
|
+
* the page paints, preventing a flash of the default brand. Render it as early
|
|
28
|
+
* as possible: in `<head>`, or — for the Next.js App Router, which does not
|
|
29
|
+
* allow arbitrary `<head>` children in a layout — as the first child of
|
|
30
|
+
* `<body>`, where it still runs synchronously before any body content renders.
|
|
31
|
+
* better-themes injects its own equivalent script for the mode axis.
|
|
32
|
+
*/
|
|
33
|
+
export declare function BrandThemeScript({ defaultBrand, }: {
|
|
34
|
+
defaultBrand?: BrandKey;
|
|
35
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=theme-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-provider.d.ts","sourceRoot":"","sources":["../../../src/theme/theme-provider.tsx"],"names":[],"mappings":"AAaA,OAAO,EAEL,KAAK,iBAAiB,EAIvB,MAAM,OAAO,CAAA;AACd,OAAO,EAGL,KAAK,QAAQ,EAIb,KAAK,SAAS,EAKd,KAAK,WAAW,EACjB,MAAM,gBAAgB,CAAA;AAmFvB,KAAK,qBAAqB,GAAG,iBAAiB,CAAC;IAC7C,YAAY,CAAC,EAAE,QAAQ,CAAA;IACvB,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B,CAAC,CAAA;AAEF,wBAAgB,gBAAgB,CAAC,EAC/B,YAA4B,EAC5B,WAA0B,EAC1B,QAAQ,GACT,EAAE,qBAAqB,2CAavB;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,wBAAwB;IACxB,KAAK,EAAE,QAAQ,CAAA;IACf,oDAAoD;IACpD,MAAM,EAAE,QAAQ,EAAE,CAAA;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAA;IACnC,8CAA8C;IAC9C,IAAI,EAAE,WAAW,CAAA;IACjB,sDAAsD;IACtD,YAAY,EAAE,SAAS,CAAA;IACvB,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAA;IACpC,qFAAqF;IACrF,cAAc,EAAE,WAAW,EAAE,CAAA;IAC7B,mFAAmF;IACnF,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,wBAAgB,WAAW,IAAI,iBAAiB,CA4B/C;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,YAA4B,GAC7B,EAAE;IACD,YAAY,CAAC,EAAE,QAAQ,CAAA;CACxB,2CAoBA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-toggle.d.ts","sourceRoot":"","sources":["../../../src/theme/theme-toggle.tsx"],"names":[],"mappings":"AA6BA,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,2CA6ChE"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const THEMES = {
|
|
2
|
+
base: {
|
|
3
|
+
label: "Default",
|
|
4
|
+
modes: [
|
|
5
|
+
"light",
|
|
6
|
+
"dark"
|
|
7
|
+
]
|
|
8
|
+
},
|
|
9
|
+
neo: {
|
|
10
|
+
label: "Neo (Red)",
|
|
11
|
+
modes: [
|
|
12
|
+
"light",
|
|
13
|
+
"dark"
|
|
14
|
+
],
|
|
15
|
+
attr: "neo"
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const DEFAULT_BRAND = "base";
|
|
19
|
+
const DEFAULT_MODE = "system";
|
|
20
|
+
const BRAND_STORAGE_KEY = "ui-brand";
|
|
21
|
+
const MODE_STORAGE_KEY = "ui-mode";
|
|
22
|
+
function brandKeys() {
|
|
23
|
+
return Object.keys(THEMES);
|
|
24
|
+
}
|
|
25
|
+
function getBrand(key) {
|
|
26
|
+
return THEMES[key];
|
|
27
|
+
}
|
|
28
|
+
function isBrandKey(value) {
|
|
29
|
+
return Object.hasOwn(THEMES, value);
|
|
30
|
+
}
|
|
31
|
+
function brandAttr(key) {
|
|
32
|
+
return getBrand(key).attr;
|
|
33
|
+
}
|
|
34
|
+
function brandSupportsDark(key) {
|
|
35
|
+
return getBrand(key).modes.includes("dark");
|
|
36
|
+
}
|
|
37
|
+
function availableModeSettings(key) {
|
|
38
|
+
return brandSupportsDark(key) ? [
|
|
39
|
+
"light",
|
|
40
|
+
"dark",
|
|
41
|
+
"system"
|
|
42
|
+
] : [
|
|
43
|
+
"light"
|
|
44
|
+
];
|
|
45
|
+
}
|
|
46
|
+
export { BRAND_STORAGE_KEY, DEFAULT_BRAND, DEFAULT_MODE, MODE_STORAGE_KEY, THEMES, availableModeSettings, brandAttr, brandKeys, brandSupportsDark, getBrand, isBrandKey };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { ThemeProvider, useTheme } from "better-themes";
|
|
4
|
+
import { createContext, useContext, useEffect, useState } from "react";
|
|
5
|
+
import { BRAND_STORAGE_KEY, DEFAULT_BRAND, DEFAULT_MODE, MODE_STORAGE_KEY, availableModeSettings, brandAttr, brandKeys, brandSupportsDark, isBrandKey } from "./theme-config.js";
|
|
6
|
+
function readStoredBrand() {
|
|
7
|
+
if ("undefined" == typeof window) return null;
|
|
8
|
+
try {
|
|
9
|
+
const value = window.localStorage.getItem(BRAND_STORAGE_KEY);
|
|
10
|
+
return value && isBrandKey(value) ? value : null;
|
|
11
|
+
} catch {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function persistBrand(brand) {
|
|
16
|
+
if ("undefined" == typeof window) return;
|
|
17
|
+
try {
|
|
18
|
+
window.localStorage.setItem(BRAND_STORAGE_KEY, brand);
|
|
19
|
+
} catch {}
|
|
20
|
+
}
|
|
21
|
+
function applyBrandAttr(brand) {
|
|
22
|
+
if ("undefined" == typeof document) return;
|
|
23
|
+
const attr = brandAttr(brand);
|
|
24
|
+
const root = document.documentElement;
|
|
25
|
+
if (attr) root.setAttribute("data-theme", attr);
|
|
26
|
+
else root.removeAttribute("data-theme");
|
|
27
|
+
}
|
|
28
|
+
const BrandContext = /*#__PURE__*/ createContext(null);
|
|
29
|
+
function BrandProvider({ defaultBrand, children }) {
|
|
30
|
+
const { setTheme } = useTheme();
|
|
31
|
+
const [brand, setBrandState] = useState(()=>readStoredBrand() ?? defaultBrand);
|
|
32
|
+
const [mounted, setMounted] = useState(false);
|
|
33
|
+
useEffect(()=>{
|
|
34
|
+
setMounted(true);
|
|
35
|
+
}, []);
|
|
36
|
+
useEffect(()=>{
|
|
37
|
+
applyBrandAttr(brand);
|
|
38
|
+
persistBrand(brand);
|
|
39
|
+
if (!brandSupportsDark(brand)) setTheme("light");
|
|
40
|
+
}, [
|
|
41
|
+
brand,
|
|
42
|
+
setTheme
|
|
43
|
+
]);
|
|
44
|
+
return /*#__PURE__*/ jsx(BrandContext.Provider, {
|
|
45
|
+
value: {
|
|
46
|
+
brand,
|
|
47
|
+
setBrand: setBrandState,
|
|
48
|
+
mounted
|
|
49
|
+
},
|
|
50
|
+
children: children
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function AppThemeProvider({ defaultBrand = DEFAULT_BRAND, defaultMode = DEFAULT_MODE, children }) {
|
|
54
|
+
return /*#__PURE__*/ jsx(ThemeProvider, {
|
|
55
|
+
attribute: "class",
|
|
56
|
+
defaultTheme: defaultMode,
|
|
57
|
+
disableTransitionOnChange: true,
|
|
58
|
+
enableSystem: true,
|
|
59
|
+
storageKey: MODE_STORAGE_KEY,
|
|
60
|
+
themes: [
|
|
61
|
+
"light",
|
|
62
|
+
"dark"
|
|
63
|
+
],
|
|
64
|
+
children: /*#__PURE__*/ jsx(BrandProvider, {
|
|
65
|
+
defaultBrand: defaultBrand,
|
|
66
|
+
children: children
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function useAppTheme() {
|
|
71
|
+
const brandCtx = useContext(BrandContext);
|
|
72
|
+
if (!brandCtx) throw new Error("useAppTheme must be used within AppThemeProvider");
|
|
73
|
+
const { theme, systemTheme, setTheme } = useTheme();
|
|
74
|
+
const { brand, setBrand, mounted } = brandCtx;
|
|
75
|
+
const mode = theme ?? DEFAULT_MODE;
|
|
76
|
+
const resolvedMode = "system" === mode ? systemTheme ?? "light" : mode;
|
|
77
|
+
return {
|
|
78
|
+
brand,
|
|
79
|
+
brands: brandKeys(),
|
|
80
|
+
setBrand,
|
|
81
|
+
mode,
|
|
82
|
+
resolvedMode,
|
|
83
|
+
setMode: (next)=>{
|
|
84
|
+
if ("light" === next || brandSupportsDark(brand)) setTheme(next);
|
|
85
|
+
},
|
|
86
|
+
availableModes: availableModeSettings(brand),
|
|
87
|
+
mounted
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function BrandThemeScript({ defaultBrand = DEFAULT_BRAND }) {
|
|
91
|
+
const attrByBrand = {};
|
|
92
|
+
for (const key of brandKeys())attrByBrand[key] = brandAttr(key);
|
|
93
|
+
const script = `(function(){try{var d=${JSON.stringify(defaultBrand)};var m=${JSON.stringify(attrByBrand)};var k=localStorage.getItem(${JSON.stringify(BRAND_STORAGE_KEY)});if(!k||!Object.prototype.hasOwnProperty.call(m,k)){k=d;}var a=m[k];var e=document.documentElement;if(a){e.setAttribute('data-theme',a);}else{e.removeAttribute('data-theme');}}catch(e){}})();`;
|
|
94
|
+
return /*#__PURE__*/ jsx("script", {
|
|
95
|
+
dangerouslySetInnerHTML: {
|
|
96
|
+
__html: script
|
|
97
|
+
},
|
|
98
|
+
suppressHydrationWarning: true
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
export { AppThemeProvider, BrandThemeScript, useAppTheme };
|