@sableui/react 0.0.0-stage → 0.1.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/AGENTS.md +157 -0
- package/CHANGELOG.md +55 -0
- package/CONTRIBUTING.md +221 -0
- package/DESIGN.md +548 -0
- package/LICENSE +21 -0
- package/README.md +194 -2
- package/THIRD_PARTY_NOTICES.md +44 -0
- package/bin/sable-lint.mjs +0 -0
- package/bin/sable.mjs +1223 -0
- package/dist/_contract-CYScOdf5.d.ts +150 -0
- package/dist/chunk-3IWZYBGH.js +398 -0
- package/dist/chunk-5Z5KLOAU.js +167 -0
- package/dist/chunk-7MG4SHYX.js +15 -0
- package/dist/chunk-ADLLDWLW.js +15 -0
- package/dist/chunk-EP55KSYA.js +14 -0
- package/dist/chunk-J23ELQQZ.js +9396 -0
- package/dist/chunk-JI7WJP2L.js +286 -0
- package/dist/chunk-K7RUHUGC.js +14 -0
- package/dist/chunk-KO3NAEBF.js +15 -0
- package/dist/chunk-L4IEIQQA.js +14 -0
- package/dist/chunk-L6Y46C62.js +270 -0
- package/dist/chunk-NEQNXI2G.js +25 -0
- package/dist/chunk-PAOZBZME.js +40 -0
- package/dist/chunk-RWP4XBSK.js +139 -0
- package/dist/chunk-SRQWQUTW.js +63 -0
- package/dist/chunk-YXBOYWBN.js +15 -0
- package/dist/foundations/index.d.ts +88 -0
- package/dist/foundations/index.js +792 -0
- package/dist/icon/index.d.ts +60 -0
- package/dist/icon/index.js +2 -0
- package/dist/icon-sets/brands.d.ts +44 -0
- package/dist/icon-sets/brands.js +147 -0
- package/dist/icon-sets/reicon.d.ts +8 -0
- package/dist/icon-sets/reicon.js +1 -0
- package/dist/index.d.ts +7013 -0
- package/dist/index.js +15462 -0
- package/dist/ios/chrome.css +83 -0
- package/dist/ios/frame.css +5 -0
- package/dist/ios/index.d.ts +70 -0
- package/dist/ios/index.js +313 -0
- package/dist/ios/preview.d.ts +64 -0
- package/dist/ios/preview.js +133 -0
- package/dist/ios/styles.css +77 -0
- package/dist/layout/index.d.ts +280 -0
- package/dist/layout/index.js +2 -0
- package/dist/meta-6dUzgC6M.d.ts +205 -0
- package/dist/patterns/index.d.ts +36 -0
- package/dist/patterns/index.js +934 -0
- package/dist/presets/index.d.ts +37 -0
- package/dist/presets/index.js +117 -0
- package/dist/registry-CyL28OzJ.d.ts +28 -0
- package/dist/styles.css +1893 -0
- package/dist/theme-provider-BWcizhAt.d.ts +105 -0
- package/dist/themes/atelier/atelier.css +213 -0
- package/dist/themes/atelier/index.d.ts +9 -0
- package/dist/themes/atelier/index.js +1 -0
- package/dist/themes/base/base.css +443 -0
- package/dist/themes/base/index.d.ts +9 -0
- package/dist/themes/base/index.js +1 -0
- package/dist/themes/ember/ember.css +270 -0
- package/dist/themes/ember/index.d.ts +9 -0
- package/dist/themes/ember/index.js +1 -0
- package/dist/themes/index.d.ts +10 -0
- package/dist/themes/index.js +8 -0
- package/dist/themes/meridian/index.d.ts +9 -0
- package/dist/themes/meridian/index.js +1 -0
- package/dist/themes/meridian/meridian.css +255 -0
- package/dist/themes/poppy/index.d.ts +6 -0
- package/dist/themes/poppy/index.js +1 -0
- package/dist/themes/poppy/poppy.css +174 -0
- package/dist/themes/prism/index.d.ts +6 -0
- package/dist/themes/prism/index.js +1 -0
- package/dist/themes/prism/prism.css +183 -0
- package/dist/themes/verdant/index.d.ts +9 -0
- package/dist/themes/verdant/index.js +1 -0
- package/dist/themes/verdant/verdant.css +210 -0
- package/dist/themes.css +30 -0
- package/llms/components/accordion.md +93 -0
- package/llms/components/app-header.md +70 -0
- package/llms/components/app-shell.md +117 -0
- package/llms/components/attachment.md +105 -0
- package/llms/components/avatar.md +141 -0
- package/llms/components/badge.md +117 -0
- package/llms/components/banner.md +119 -0
- package/llms/components/bottom-nav.md +80 -0
- package/llms/components/breadcrumbs.md +75 -0
- package/llms/components/browser.md +67 -0
- package/llms/components/bubble.md +119 -0
- package/llms/components/button.md +199 -0
- package/llms/components/calendar.md +75 -0
- package/llms/components/card.md +135 -0
- package/llms/components/carousel.md +87 -0
- package/llms/components/chat-composer.md +126 -0
- package/llms/components/checkbox-card.md +98 -0
- package/llms/components/checkbox.md +90 -0
- package/llms/components/code-block.md +81 -0
- package/llms/components/code.md +62 -0
- package/llms/components/collapsible.md +83 -0
- package/llms/components/color-field.md +100 -0
- package/llms/components/combobox.md +119 -0
- package/llms/components/command-menu.md +158 -0
- package/llms/components/context-card.md +73 -0
- package/llms/components/context-menu.md +79 -0
- package/llms/components/data-table.md +99 -0
- package/llms/components/date-picker.md +97 -0
- package/llms/components/description.md +96 -0
- package/llms/components/destructive-action-modal.md +76 -0
- package/llms/components/dialog.md +127 -0
- package/llms/components/dots-menu.md +64 -0
- package/llms/components/empty-state.md +113 -0
- package/llms/components/entity.md +67 -0
- package/llms/components/feedback.md +63 -0
- package/llms/components/fieldset.md +106 -0
- package/llms/components/file-dropzone.md +103 -0
- package/llms/components/form.md +111 -0
- package/llms/components/gliding-highlight.md +84 -0
- package/llms/components/inline-status.md +62 -0
- package/llms/components/input.md +127 -0
- package/llms/components/kbd.md +57 -0
- package/llms/components/label.md +73 -0
- package/llms/components/marker.md +99 -0
- package/llms/components/marquee.md +66 -0
- package/llms/components/menu.md +122 -0
- package/llms/components/message-scroller.md +110 -0
- package/llms/components/message.md +114 -0
- package/llms/components/meter.md +124 -0
- package/llms/components/middle-truncate.md +62 -0
- package/llms/components/note.md +81 -0
- package/llms/components/notification-badge.md +67 -0
- package/llms/components/number-field.md +70 -0
- package/llms/components/otp-field.md +101 -0
- package/llms/components/page-header.md +76 -0
- package/llms/components/page-loader.md +67 -0
- package/llms/components/pagination.md +92 -0
- package/llms/components/panel-group.md +120 -0
- package/llms/components/panel-section.md +122 -0
- package/llms/components/phone.md +70 -0
- package/llms/components/pill.md +73 -0
- package/llms/components/popover.md +79 -0
- package/llms/components/progress.md +98 -0
- package/llms/components/radio-card.md +90 -0
- package/llms/components/radio.md +86 -0
- package/llms/components/relative-time.md +60 -0
- package/llms/components/scroller.md +88 -0
- package/llms/components/scrub-field.md +97 -0
- package/llms/components/search-input.md +84 -0
- package/llms/components/select.md +106 -0
- package/llms/components/separator.md +70 -0
- package/llms/components/settings-menu.md +139 -0
- package/llms/components/sheet.md +97 -0
- package/llms/components/show-more.md +59 -0
- package/llms/components/side-nav.md +106 -0
- package/llms/components/sidebar.md +87 -0
- package/llms/components/skeleton.md +62 -0
- package/llms/components/slider.md +114 -0
- package/llms/components/spinner.md +87 -0
- package/llms/components/status-bar.md +91 -0
- package/llms/components/status-dot.md +70 -0
- package/llms/components/stepper.md +125 -0
- package/llms/components/streaming-text.md +86 -0
- package/llms/components/switch.md +87 -0
- package/llms/components/table.md +112 -0
- package/llms/components/tabs.md +84 -0
- package/llms/components/textarea.md +88 -0
- package/llms/components/theme-selector.md +95 -0
- package/llms/components/theme-switcher.md +71 -0
- package/llms/components/thinking-orb.md +91 -0
- package/llms/components/toast.md +130 -0
- package/llms/components/toggle.md +95 -0
- package/llms/components/toolbar.md +168 -0
- package/llms/components/tooltip.md +93 -0
- package/llms/components/tree.md +227 -0
- package/llms/components/video.md +66 -0
- package/llms/components/workspace.md +138 -0
- package/llms/foundations/accessibility.md +60 -0
- package/llms/foundations/motion.md +96 -0
- package/llms/foundations/scrolling.md +41 -0
- package/llms/foundations/shape.md +73 -0
- package/llms/foundations/spacing.md +82 -0
- package/llms/foundations/surfaces.md +69 -0
- package/llms/foundations/typography.md +120 -0
- package/llms/layout/aspect-box.md +37 -0
- package/llms/layout/bleed.md +31 -0
- package/llms/layout/center.md +37 -0
- package/llms/layout/columns.md +51 -0
- package/llms/layout/grid-overlay.md +40 -0
- package/llms/layout/grid.md +47 -0
- package/llms/layout/page.md +39 -0
- package/llms/layout/region.md +49 -0
- package/llms/layout/row.md +40 -0
- package/llms/layout/safe-area.md +37 -0
- package/llms/layout/spacer.md +39 -0
- package/llms/layout/split-pane.md +41 -0
- package/llms/layout/stack.md +39 -0
- package/llms/patterns/auth-page.md +68 -0
- package/llms/patterns/brand-landing-page.md +423 -0
- package/llms/patterns/chat-panel.md +210 -0
- package/llms/patterns/dashboard-page.md +170 -0
- package/llms/patterns/feed-page.md +103 -0
- package/llms/patterns/landing-page.md +122 -0
- package/llms/patterns/list-detail-page.md +100 -0
- package/llms/patterns/settings-page.md +121 -0
- package/llms/reference/token-intent.md +324 -0
- package/llms/reference/utilities.md +129 -0
- package/llms/tasks/adding-a-component.md +113 -0
- package/llms/tasks/auditing-an-app.md +216 -0
- package/llms/tasks/building-a-page.md +109 -0
- package/llms/tasks/building-a-tool.md +141 -0
- package/llms/tasks/building-an-ios-prototype.md +105 -0
- package/llms/tasks/building-with-sable.md +73 -0
- package/llms/tasks/choosing-a-component.md +109 -0
- package/llms/tasks/converting-an-app.md +139 -0
- package/llms/tasks/creating-a-preset.md +43 -0
- package/llms/tasks/creating-design-assets.md +96 -0
- package/llms/tasks/designing-a-surface.md +115 -0
- package/llms/tasks/developing-taste.md +157 -0
- package/llms/tasks/getting-started.md +63 -0
- package/llms/tasks/learning-from-builds.md +74 -0
- package/llms/tasks/reviewing-a-design.md +114 -0
- package/llms/tasks/reviewing-a-journey.md +84 -0
- package/llms/tasks/reviewing-motion.md +92 -0
- package/llms/tasks/using-presets.md +87 -0
- package/llms/taste/asset-plan.template.json +53 -0
- package/llms/taste/composition-follows-content.md +20 -0
- package/llms/taste/hierarchy-is-a-relationship.md +22 -0
- package/llms/taste/lessons.json +57 -0
- package/llms/taste/motion-needs-a-reason.md +21 -0
- package/llms/taste/surface-states-travel-together.md +20 -0
- package/llms-full.txt +14906 -0
- package/llms.txt +405 -0
- package/package.json +185 -3
- package/registry.json +18812 -0
- package/scripts/agent-setup.mjs +54 -0
- package/scripts/design-atlas.mjs +221 -0
- package/scripts/design-directions.mjs +123 -0
- package/scripts/design-memory.mjs +166 -0
- package/scripts/design-preferences.mjs +227 -0
- package/scripts/design-presets.mjs +48 -0
- package/scripts/grade.mjs +509 -0
- package/scripts/lint-rules.mjs +1065 -0
- package/scripts/review-evidence.mjs +120 -0
- package/scripts/skeleton.mjs +248 -0
- package/skills/entry/SKILL.md +34 -0
- package/skills/sable/SKILL.md +187 -0
- package/skills/sable/agents/openai.yaml +6 -0
- package/targets/ios.json +982 -0
- package/third-party/reicon-LICENSE.txt +20 -0
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
// src/themes/_contract.ts
|
|
2
|
+
var SEMANTIC_TOKENS = [
|
|
3
|
+
// Surfaces & text
|
|
4
|
+
"background",
|
|
5
|
+
"foreground",
|
|
6
|
+
"card",
|
|
7
|
+
"card-foreground",
|
|
8
|
+
"popover",
|
|
9
|
+
"popover-foreground",
|
|
10
|
+
"muted",
|
|
11
|
+
"muted-foreground",
|
|
12
|
+
"border",
|
|
13
|
+
// A visually-stronger structural divider — grid lines, table rules, section
|
|
14
|
+
// separators — distinct from `border`, which is tuned for subtle chrome
|
|
15
|
+
// (badge/input outlines). Same neutral ramp as `border`, pulled from a
|
|
16
|
+
// higher-contrast step. See DESIGN.md / CONTRIBUTING.md → "Theme contract".
|
|
17
|
+
"border-strong",
|
|
18
|
+
"input",
|
|
19
|
+
"ring",
|
|
20
|
+
// Actions
|
|
21
|
+
"primary",
|
|
22
|
+
"primary-foreground",
|
|
23
|
+
"secondary",
|
|
24
|
+
"secondary-foreground",
|
|
25
|
+
"accent",
|
|
26
|
+
"accent-foreground",
|
|
27
|
+
"destructive",
|
|
28
|
+
"destructive-foreground",
|
|
29
|
+
// Success — the positive-state counterpart to destructive (mirrors it 1:1).
|
|
30
|
+
// Backed by caribbean-green; a SEPARATE token from the `tone-standard`
|
|
31
|
+
// post-type so success-as-state can be retuned without moving the post tone.
|
|
32
|
+
"success",
|
|
33
|
+
"success-foreground",
|
|
34
|
+
// Tones (semantic — carry meaning, not decoration)
|
|
35
|
+
"tone-standard",
|
|
36
|
+
"tone-collectible",
|
|
37
|
+
"tone-edition",
|
|
38
|
+
"tone-info",
|
|
39
|
+
"tone-warning",
|
|
40
|
+
"highlight",
|
|
41
|
+
// Tone ink — the legible text/icon color ON a tone fill. Theme-adaptive:
|
|
42
|
+
// because a tone fill flips lightness with the mode (dark 600/700 in light
|
|
43
|
+
// mode, lighter dark-tuned values in dark mode), its ink must flip too. These
|
|
44
|
+
// let a component write `text-tone-edition-foreground` — an intent token with
|
|
45
|
+
// no palette name and no `dark:` variant — instead of naming palette steps.
|
|
46
|
+
"tone-standard-foreground",
|
|
47
|
+
"tone-collectible-foreground",
|
|
48
|
+
"tone-edition-foreground",
|
|
49
|
+
"tone-info-foreground",
|
|
50
|
+
"tone-warning-foreground",
|
|
51
|
+
"highlight-foreground",
|
|
52
|
+
// Overlay — a fixed, theme-independent dark surface for things that sit OVER
|
|
53
|
+
// content rather than on a theme surface: modal/sheet scrims, media letterbox,
|
|
54
|
+
// pills on imagery. `overlay-foreground` is its always-legible light ink.
|
|
55
|
+
// Replaces ad-hoc `bg-black/50` + `text-white`.
|
|
56
|
+
"overlay",
|
|
57
|
+
"overlay-foreground",
|
|
58
|
+
// Sidebar set
|
|
59
|
+
"sidebar",
|
|
60
|
+
"sidebar-foreground",
|
|
61
|
+
"sidebar-primary",
|
|
62
|
+
"sidebar-primary-foreground",
|
|
63
|
+
"sidebar-accent",
|
|
64
|
+
"sidebar-accent-foreground",
|
|
65
|
+
"sidebar-border",
|
|
66
|
+
"sidebar-ring"
|
|
67
|
+
];
|
|
68
|
+
var MOTION_TOKENS = [
|
|
69
|
+
"motion-scale",
|
|
70
|
+
// Duration ladder (75/150/200/300/500) + semantic enter/exit
|
|
71
|
+
"motion-duration-instant",
|
|
72
|
+
"motion-duration-fast",
|
|
73
|
+
"motion-duration-base",
|
|
74
|
+
"motion-duration-slow",
|
|
75
|
+
"motion-duration-slower",
|
|
76
|
+
"motion-duration-enter",
|
|
77
|
+
"motion-duration-exit",
|
|
78
|
+
// Easings — standard/decelerate/emphasized are overshoot-free; spring/bounce
|
|
79
|
+
// add a tasteful single overshoot (enter only).
|
|
80
|
+
"motion-ease-standard",
|
|
81
|
+
"motion-ease-decelerate",
|
|
82
|
+
"motion-ease-emphasized",
|
|
83
|
+
"motion-ease-spring",
|
|
84
|
+
"motion-ease-bounce",
|
|
85
|
+
"motion-ease-linear"
|
|
86
|
+
];
|
|
87
|
+
var RADIUS_TOKENS = [
|
|
88
|
+
"theme-radius-none",
|
|
89
|
+
"theme-radius-xs",
|
|
90
|
+
"theme-radius-sm",
|
|
91
|
+
"theme-radius-md",
|
|
92
|
+
"theme-radius-lg",
|
|
93
|
+
"theme-radius-xl",
|
|
94
|
+
"theme-radius-full"
|
|
95
|
+
];
|
|
96
|
+
var TYPE_SCALE_TOKENS = [
|
|
97
|
+
// Display — the optional 4xl size hook lives in TYPE_REFINEMENT_TOKENS.
|
|
98
|
+
"type-display-4xl-weight",
|
|
99
|
+
"type-display-4xl-leading",
|
|
100
|
+
"type-display-4xl-tracking",
|
|
101
|
+
"type-display-3xl-size",
|
|
102
|
+
"type-display-3xl-weight",
|
|
103
|
+
"type-display-3xl-leading",
|
|
104
|
+
"type-display-3xl-tracking",
|
|
105
|
+
"type-display-2xl-size",
|
|
106
|
+
"type-display-2xl-weight",
|
|
107
|
+
"type-display-2xl-leading",
|
|
108
|
+
"type-display-2xl-tracking",
|
|
109
|
+
"type-display-xl-size",
|
|
110
|
+
"type-display-xl-weight",
|
|
111
|
+
"type-display-xl-leading",
|
|
112
|
+
"type-display-xl-tracking",
|
|
113
|
+
"type-display-lg-size",
|
|
114
|
+
"type-display-lg-weight",
|
|
115
|
+
"type-display-lg-leading",
|
|
116
|
+
"type-display-lg-tracking",
|
|
117
|
+
// Heading — one shared weight; size/leading/tracking per tier.
|
|
118
|
+
"type-heading-weight",
|
|
119
|
+
"type-heading-1-size",
|
|
120
|
+
"type-heading-1-leading",
|
|
121
|
+
"type-heading-1-tracking",
|
|
122
|
+
"type-heading-2-size",
|
|
123
|
+
"type-heading-2-leading",
|
|
124
|
+
"type-heading-2-tracking",
|
|
125
|
+
"type-heading-3-size",
|
|
126
|
+
"type-heading-3-leading",
|
|
127
|
+
"type-heading-3-tracking",
|
|
128
|
+
"type-heading-4-size",
|
|
129
|
+
"type-heading-4-leading",
|
|
130
|
+
"type-heading-4-tracking",
|
|
131
|
+
// Title — shared weight/leading; tracking per tier (lg uses the base tracking).
|
|
132
|
+
"type-title-weight",
|
|
133
|
+
"type-title-leading",
|
|
134
|
+
"type-title-tracking",
|
|
135
|
+
"type-title-sm-tracking"
|
|
136
|
+
];
|
|
137
|
+
var TYPE_REFINEMENT_TOKENS = [
|
|
138
|
+
"type-display-4xl-size",
|
|
139
|
+
"type-title-lg-size",
|
|
140
|
+
"type-title-sm-size",
|
|
141
|
+
"type-body-lg-size",
|
|
142
|
+
"type-body-lg-weight",
|
|
143
|
+
"type-body-lg-leading",
|
|
144
|
+
"type-body-lg-tracking",
|
|
145
|
+
"type-body-md-size",
|
|
146
|
+
"type-body-md-weight",
|
|
147
|
+
"type-body-md-leading",
|
|
148
|
+
"type-body-md-tracking",
|
|
149
|
+
"type-body-sm-size",
|
|
150
|
+
"type-body-sm-weight",
|
|
151
|
+
"type-body-sm-leading",
|
|
152
|
+
"type-body-sm-tracking",
|
|
153
|
+
"type-body-xs-size",
|
|
154
|
+
"type-body-xs-weight",
|
|
155
|
+
"type-body-xs-leading",
|
|
156
|
+
"type-body-xs-tracking",
|
|
157
|
+
"type-label-lg-size",
|
|
158
|
+
"type-label-lg-weight",
|
|
159
|
+
"type-label-lg-leading",
|
|
160
|
+
"type-label-lg-tracking",
|
|
161
|
+
"type-label-md-size",
|
|
162
|
+
"type-label-md-weight",
|
|
163
|
+
"type-label-md-leading",
|
|
164
|
+
"type-label-md-tracking",
|
|
165
|
+
"type-label-sm-size",
|
|
166
|
+
"type-label-sm-weight",
|
|
167
|
+
"type-label-sm-leading",
|
|
168
|
+
"type-label-sm-tracking",
|
|
169
|
+
"type-label-xs-size",
|
|
170
|
+
"type-label-xs-weight",
|
|
171
|
+
"type-label-xs-leading",
|
|
172
|
+
"type-label-xs-tracking",
|
|
173
|
+
"type-label-xs-transform",
|
|
174
|
+
"type-caption-size",
|
|
175
|
+
"type-caption-weight",
|
|
176
|
+
"type-caption-leading",
|
|
177
|
+
"type-caption-tracking",
|
|
178
|
+
"type-mono-xl-size",
|
|
179
|
+
"type-mono-xl-weight",
|
|
180
|
+
"type-mono-xl-leading",
|
|
181
|
+
"type-mono-xl-tracking",
|
|
182
|
+
"type-mono-lg-size",
|
|
183
|
+
"type-mono-lg-weight",
|
|
184
|
+
"type-mono-lg-leading",
|
|
185
|
+
"type-mono-lg-tracking",
|
|
186
|
+
"type-mono-md-size",
|
|
187
|
+
"type-mono-md-weight",
|
|
188
|
+
"type-mono-md-leading",
|
|
189
|
+
"type-mono-md-tracking",
|
|
190
|
+
"type-mono-caption-size",
|
|
191
|
+
"type-mono-caption-weight",
|
|
192
|
+
"type-mono-caption-leading",
|
|
193
|
+
"type-mono-caption-tracking",
|
|
194
|
+
"type-mono-sm-size",
|
|
195
|
+
"type-mono-sm-weight",
|
|
196
|
+
"type-mono-sm-leading",
|
|
197
|
+
"type-mono-sm-tracking"
|
|
198
|
+
];
|
|
199
|
+
var TYPE_OVERLINE_TOKENS = [
|
|
200
|
+
"type-overline-size",
|
|
201
|
+
"type-overline-weight",
|
|
202
|
+
"type-overline-leading",
|
|
203
|
+
"type-overline-tracking",
|
|
204
|
+
"type-overline-transform"
|
|
205
|
+
];
|
|
206
|
+
var DENSITY_TOKENS = [
|
|
207
|
+
"control-xs",
|
|
208
|
+
"control-sm",
|
|
209
|
+
"control-md",
|
|
210
|
+
"control-cta",
|
|
211
|
+
"control-lg",
|
|
212
|
+
/** Width of a numeric property field — a property grid is built from these. */
|
|
213
|
+
"field-numeric-width",
|
|
214
|
+
/** Docked panel chrome. */
|
|
215
|
+
"panel-width",
|
|
216
|
+
"panel-width-min",
|
|
217
|
+
"panel-width-max",
|
|
218
|
+
"chrome-bar-height",
|
|
219
|
+
"status-bar-height",
|
|
220
|
+
/**
|
|
221
|
+
* Button shape. A DENSITY token because the workspace register flattens it —
|
|
222
|
+
* neither Figma nor Paper has a pill in its chrome — and therefore something
|
|
223
|
+
* every density scope must be able to restore.
|
|
224
|
+
*
|
|
225
|
+
* It lived outside this list while compact overrode it, which is precisely why
|
|
226
|
+
* the "declares every density token in both densities" test passed against a
|
|
227
|
+
* real asymmetry: a comfortable subtree nested in a compact one recovered the
|
|
228
|
+
* whole control ladder and kept flat buttons forever. The contract had a hole
|
|
229
|
+
* exactly where the bug was.
|
|
230
|
+
*/
|
|
231
|
+
"button-radius",
|
|
232
|
+
/**
|
|
233
|
+
* The spacing that travels WITH control height. Compact used to shrink the
|
|
234
|
+
* ladder and leave every gap and row inset at its comfortable 8px, so a
|
|
235
|
+
* 32px button kept a 40px button's icon gap and a dense menu kept a roomy
|
|
236
|
+
* menu's padding. Comfortable values equal what the components hardcoded,
|
|
237
|
+
* so the default register renders unchanged.
|
|
238
|
+
*/
|
|
239
|
+
"control-gap",
|
|
240
|
+
"item-px",
|
|
241
|
+
"item-gap",
|
|
242
|
+
/**
|
|
243
|
+
* Tree geometry — a layer/object list is the other shape (with the property
|
|
244
|
+
* grid) that every tool has, and its left edges are the thing that most
|
|
245
|
+
* visibly goes wrong. Three tokens, one invariant:
|
|
246
|
+
*
|
|
247
|
+
* --tree-indent MUST equal --tree-column.
|
|
248
|
+
*
|
|
249
|
+
* A row is [rail][column: disclosure][column: type][name …][actions]. If the
|
|
250
|
+
* indent step is smaller than the column, a child's content lands LEFT of
|
|
251
|
+
* where its parent's content starts and the nesting reads INVERTED — the
|
|
252
|
+
* defect this promotion exists to make unrepeatable. Enforced in themes.test.
|
|
253
|
+
*/
|
|
254
|
+
"tree-rail",
|
|
255
|
+
"tree-column",
|
|
256
|
+
"tree-indent"
|
|
257
|
+
];
|
|
258
|
+
var LAYERING_TOKENS = [
|
|
259
|
+
"z-sticky",
|
|
260
|
+
"z-nav",
|
|
261
|
+
"z-overlay",
|
|
262
|
+
"z-toast",
|
|
263
|
+
"z-skip-link"
|
|
264
|
+
];
|
|
265
|
+
var WORKSPACE_SURFACE_TOKENS = [
|
|
266
|
+
"canvas",
|
|
267
|
+
"canvas-foreground",
|
|
268
|
+
"panel",
|
|
269
|
+
"panel-foreground",
|
|
270
|
+
"panel-raised",
|
|
271
|
+
"hairline",
|
|
272
|
+
"hairline-strong"
|
|
273
|
+
];
|
|
274
|
+
var DERIVED_EDGE_TOKENS = ["border-floating"];
|
|
275
|
+
var TYPE_UI_TOKENS = [
|
|
276
|
+
"type-ui-md-size",
|
|
277
|
+
"type-ui-md-weight",
|
|
278
|
+
"type-ui-sm-size",
|
|
279
|
+
"type-ui-sm-weight",
|
|
280
|
+
"type-ui-leading",
|
|
281
|
+
"type-ui-section-weight",
|
|
282
|
+
"type-ui-micro-size",
|
|
283
|
+
"type-ui-micro-weight"
|
|
284
|
+
];
|
|
285
|
+
|
|
286
|
+
export { DENSITY_TOKENS, DERIVED_EDGE_TOKENS, LAYERING_TOKENS, MOTION_TOKENS, RADIUS_TOKENS, SEMANTIC_TOKENS, TYPE_OVERLINE_TOKENS, TYPE_REFINEMENT_TOKENS, TYPE_SCALE_TOKENS, TYPE_UI_TOKENS, WORKSPACE_SURFACE_TOKENS };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// src/themes/meridian/index.ts
|
|
2
|
+
var meridianTheme = {
|
|
3
|
+
id: "meridian",
|
|
4
|
+
label: "Meridian",
|
|
5
|
+
modes: ["light", "dark"],
|
|
6
|
+
defaultMode: "light",
|
|
7
|
+
fonts: {
|
|
8
|
+
sans: '"Instrument Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
9
|
+
mono: '"Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace'
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
var meridian_default = meridianTheme;
|
|
13
|
+
|
|
14
|
+
export { meridianTheme, meridian_default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// src/themes/verdant/index.ts
|
|
2
|
+
var verdantTheme = {
|
|
3
|
+
id: "verdant",
|
|
4
|
+
label: "Verdant",
|
|
5
|
+
modes: ["light", "dark"],
|
|
6
|
+
defaultMode: "light",
|
|
7
|
+
fonts: {
|
|
8
|
+
sans: '"Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
9
|
+
mono: '"IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace',
|
|
10
|
+
display: '"Instrument Serif", Georgia, "Times New Roman", serif'
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
var verdant_default = verdantTheme;
|
|
14
|
+
|
|
15
|
+
export { verdantTheme, verdant_default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// src/themes/ember/index.ts
|
|
2
|
+
var emberTheme = {
|
|
3
|
+
id: "ember",
|
|
4
|
+
label: "Ember",
|
|
5
|
+
modes: ["dark", "light"],
|
|
6
|
+
defaultMode: "dark",
|
|
7
|
+
fonts: {
|
|
8
|
+
sans: '"Work Sans", sans-serif',
|
|
9
|
+
mono: '"DM Mono", ui-monospace, monospace'
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
var ember_default = emberTheme;
|
|
13
|
+
|
|
14
|
+
export { emberTheme, ember_default };
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { verdantTheme } from './chunk-KO3NAEBF.js';
|
|
2
|
+
import { emberTheme } from './chunk-L4IEIQQA.js';
|
|
3
|
+
import { baseTheme } from './chunk-EP55KSYA.js';
|
|
4
|
+
import { poppyTheme } from './chunk-ADLLDWLW.js';
|
|
5
|
+
import { meridianTheme } from './chunk-K7RUHUGC.js';
|
|
6
|
+
import { atelierTheme } from './chunk-YXBOYWBN.js';
|
|
7
|
+
import { prismTheme } from './chunk-7MG4SHYX.js';
|
|
8
|
+
import { createContext, useMemo, useState, useEffect, useCallback, useContext } from 'react';
|
|
9
|
+
import { jsx } from 'react/jsx-runtime';
|
|
10
|
+
|
|
11
|
+
// src/themes/registry.ts
|
|
12
|
+
var SABLE_THEME_ATTRIBUTE = "data-sable-theme";
|
|
13
|
+
var DEFAULT_THEME_ID = baseTheme.id;
|
|
14
|
+
var defaultThemeId = DEFAULT_THEME_ID;
|
|
15
|
+
var themeManifests = [
|
|
16
|
+
baseTheme,
|
|
17
|
+
meridianTheme,
|
|
18
|
+
prismTheme,
|
|
19
|
+
verdantTheme,
|
|
20
|
+
emberTheme,
|
|
21
|
+
poppyTheme,
|
|
22
|
+
atelierTheme
|
|
23
|
+
];
|
|
24
|
+
var featuredThemeManifests = themeManifests.filter((theme) => !theme.deprecated);
|
|
25
|
+
var themeIds = themeManifests.map((theme) => theme.id);
|
|
26
|
+
var themeManifestById = Object.fromEntries(
|
|
27
|
+
themeManifests.map((theme) => [theme.id, theme])
|
|
28
|
+
);
|
|
29
|
+
function isThemeId(value) {
|
|
30
|
+
return Object.hasOwn(themeManifestById, value);
|
|
31
|
+
}
|
|
32
|
+
function getThemeManifest(themeId) {
|
|
33
|
+
return themeManifestById[themeId];
|
|
34
|
+
}
|
|
35
|
+
function buildThemeManifestById(customThemes = []) {
|
|
36
|
+
const merged = { ...themeManifestById };
|
|
37
|
+
for (const theme of customThemes) merged[theme.id] = theme;
|
|
38
|
+
return merged;
|
|
39
|
+
}
|
|
40
|
+
function isKnownThemeId(value, manifestById) {
|
|
41
|
+
return Object.hasOwn(manifestById, value);
|
|
42
|
+
}
|
|
43
|
+
var SABLE_COLOR_STORAGE_KEY = "sable-color-preference";
|
|
44
|
+
var SABLE_THEME_STORAGE_KEY = "sable-theme-id";
|
|
45
|
+
var SableThemeContext = createContext(null);
|
|
46
|
+
function coercePreference(value, fallback) {
|
|
47
|
+
if (value === "light" || value === "dark" || value === "system") return value;
|
|
48
|
+
return fallback;
|
|
49
|
+
}
|
|
50
|
+
function coerceThemeId(value, fallback, manifestById = {}) {
|
|
51
|
+
if (!value) return fallback;
|
|
52
|
+
if (isThemeId(value) || isKnownThemeId(value, manifestById)) {
|
|
53
|
+
return manifestById[value]?.deprecated?.replacement ?? value;
|
|
54
|
+
}
|
|
55
|
+
return fallback;
|
|
56
|
+
}
|
|
57
|
+
function systemColorMode() {
|
|
58
|
+
if (typeof window === "undefined" || !window.matchMedia) return "dark";
|
|
59
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
60
|
+
}
|
|
61
|
+
function readStorage(key) {
|
|
62
|
+
if (!key || typeof window === "undefined") return null;
|
|
63
|
+
try {
|
|
64
|
+
return window.localStorage.getItem(key);
|
|
65
|
+
} catch {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function writeStorage(key, value) {
|
|
70
|
+
if (!key || typeof window === "undefined") return;
|
|
71
|
+
try {
|
|
72
|
+
window.localStorage.setItem(key, value);
|
|
73
|
+
} catch {
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function rootElement() {
|
|
77
|
+
return typeof document === "undefined" ? null : document.documentElement;
|
|
78
|
+
}
|
|
79
|
+
function resolveTarget(target) {
|
|
80
|
+
if (target === void 0 || target === "root") return rootElement();
|
|
81
|
+
return target();
|
|
82
|
+
}
|
|
83
|
+
var SABLE_TRANSITION_SUPPRESSOR_ATTRIBUTE = "data-sable-theme-transition";
|
|
84
|
+
var TRANSITION_SUPPRESSOR_CSS = "*,*::before,*::after{transition:none !important}";
|
|
85
|
+
function withSuppressedTransitions(mutate) {
|
|
86
|
+
if (typeof document === "undefined" || !document.head || !document.body || typeof document.createElement !== "function") {
|
|
87
|
+
mutate();
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const style = document.createElement("style");
|
|
91
|
+
style.setAttribute(SABLE_TRANSITION_SUPPRESSOR_ATTRIBUTE, "");
|
|
92
|
+
style.appendChild(document.createTextNode(TRANSITION_SUPPRESSOR_CSS));
|
|
93
|
+
document.head.appendChild(style);
|
|
94
|
+
const removeStyle = () => style.parentNode?.removeChild(style);
|
|
95
|
+
try {
|
|
96
|
+
mutate();
|
|
97
|
+
} catch (error) {
|
|
98
|
+
removeStyle();
|
|
99
|
+
throw error;
|
|
100
|
+
}
|
|
101
|
+
void document.body.offsetHeight;
|
|
102
|
+
const raf = typeof requestAnimationFrame === "function" ? requestAnimationFrame : null;
|
|
103
|
+
if (!raf) {
|
|
104
|
+
removeStyle();
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
raf(() => {
|
|
108
|
+
raf(removeStyle);
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
function applySableColorMode(mode, target = rootElement()) {
|
|
112
|
+
if (!target) return;
|
|
113
|
+
withSuppressedTransitions(() => {
|
|
114
|
+
target.classList.toggle("dark", mode === "dark");
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
function applySableTheme(themeId, target = rootElement()) {
|
|
118
|
+
if (!target) return;
|
|
119
|
+
withSuppressedTransitions(() => {
|
|
120
|
+
if (themeId === defaultThemeId) {
|
|
121
|
+
target.removeAttribute(SABLE_THEME_ATTRIBUTE);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
target.setAttribute(SABLE_THEME_ATTRIBUTE, themeId);
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
function SableThemeProvider({
|
|
128
|
+
children,
|
|
129
|
+
defaultPreference = "dark",
|
|
130
|
+
preference: controlledPreference,
|
|
131
|
+
onPreferenceChange,
|
|
132
|
+
defaultThemeId: defaultThemeId2 = defaultThemeId,
|
|
133
|
+
themeId: controlledThemeId,
|
|
134
|
+
onThemeIdChange,
|
|
135
|
+
colorStorageKey = SABLE_COLOR_STORAGE_KEY,
|
|
136
|
+
themeStorageKey = SABLE_THEME_STORAGE_KEY,
|
|
137
|
+
target = "root",
|
|
138
|
+
customThemes
|
|
139
|
+
}) {
|
|
140
|
+
const themeManifestById2 = useMemo(
|
|
141
|
+
() => buildThemeManifestById(customThemes),
|
|
142
|
+
[customThemes]
|
|
143
|
+
);
|
|
144
|
+
const [uncontrolledPreference, setUncontrolledPreference] = useState(
|
|
145
|
+
() => coercePreference(readStorage(colorStorageKey), defaultPreference)
|
|
146
|
+
);
|
|
147
|
+
const [uncontrolledThemeId, setUncontrolledThemeId] = useState(
|
|
148
|
+
() => coerceThemeId(readStorage(themeStorageKey), defaultThemeId2, themeManifestById2)
|
|
149
|
+
);
|
|
150
|
+
const [resolvedSystem, setResolvedSystem] = useState(systemColorMode);
|
|
151
|
+
const preference = controlledPreference ?? uncontrolledPreference;
|
|
152
|
+
const themeId = controlledThemeId ?? uncontrolledThemeId;
|
|
153
|
+
const mode = preference === "system" ? resolvedSystem : preference;
|
|
154
|
+
useEffect(() => {
|
|
155
|
+
if (typeof window === "undefined" || !window.matchMedia) return;
|
|
156
|
+
const media = window.matchMedia("(prefers-color-scheme: dark)");
|
|
157
|
+
const onChange = () => setResolvedSystem(media.matches ? "dark" : "light");
|
|
158
|
+
media.addEventListener?.("change", onChange);
|
|
159
|
+
return () => media.removeEventListener?.("change", onChange);
|
|
160
|
+
}, []);
|
|
161
|
+
useEffect(() => {
|
|
162
|
+
if (typeof window === "undefined") return;
|
|
163
|
+
function onStorage(event) {
|
|
164
|
+
if (controlledPreference === void 0) {
|
|
165
|
+
if (event.key === colorStorageKey) {
|
|
166
|
+
setUncontrolledPreference(
|
|
167
|
+
coercePreference(event.newValue, defaultPreference)
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
if (event.key === null) {
|
|
171
|
+
setUncontrolledPreference(
|
|
172
|
+
coercePreference(readStorage(colorStorageKey), defaultPreference)
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if (controlledThemeId === void 0) {
|
|
177
|
+
if (event.key === themeStorageKey) {
|
|
178
|
+
setUncontrolledThemeId(
|
|
179
|
+
coerceThemeId(event.newValue, defaultThemeId2, themeManifestById2)
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
if (event.key === null) {
|
|
183
|
+
setUncontrolledThemeId(
|
|
184
|
+
coerceThemeId(
|
|
185
|
+
readStorage(themeStorageKey),
|
|
186
|
+
defaultThemeId2,
|
|
187
|
+
themeManifestById2
|
|
188
|
+
)
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
window.addEventListener("storage", onStorage);
|
|
194
|
+
return () => window.removeEventListener("storage", onStorage);
|
|
195
|
+
}, [
|
|
196
|
+
colorStorageKey,
|
|
197
|
+
controlledPreference,
|
|
198
|
+
controlledThemeId,
|
|
199
|
+
defaultPreference,
|
|
200
|
+
defaultThemeId2,
|
|
201
|
+
themeManifestById2,
|
|
202
|
+
themeStorageKey
|
|
203
|
+
]);
|
|
204
|
+
useEffect(() => {
|
|
205
|
+
applySableColorMode(mode, resolveTarget(target));
|
|
206
|
+
}, [mode, target]);
|
|
207
|
+
useEffect(() => {
|
|
208
|
+
applySableTheme(themeId, resolveTarget(target));
|
|
209
|
+
}, [themeId, target]);
|
|
210
|
+
const setPreference = useCallback(
|
|
211
|
+
(next) => {
|
|
212
|
+
if (controlledPreference === void 0) setUncontrolledPreference(next);
|
|
213
|
+
writeStorage(colorStorageKey, next);
|
|
214
|
+
onPreferenceChange?.(next);
|
|
215
|
+
},
|
|
216
|
+
[controlledPreference, colorStorageKey, onPreferenceChange]
|
|
217
|
+
);
|
|
218
|
+
const setThemeId = useCallback(
|
|
219
|
+
(next) => {
|
|
220
|
+
if (controlledThemeId === void 0) setUncontrolledThemeId(next);
|
|
221
|
+
writeStorage(themeStorageKey, next);
|
|
222
|
+
onThemeIdChange?.(next);
|
|
223
|
+
},
|
|
224
|
+
[controlledThemeId, onThemeIdChange, themeStorageKey]
|
|
225
|
+
);
|
|
226
|
+
const toggle = useCallback(() => {
|
|
227
|
+
setPreference(mode === "dark" ? "light" : "dark");
|
|
228
|
+
}, [mode, setPreference]);
|
|
229
|
+
const value = useMemo(
|
|
230
|
+
() => ({
|
|
231
|
+
mode,
|
|
232
|
+
colorMode: mode,
|
|
233
|
+
preference,
|
|
234
|
+
colorPreference: preference,
|
|
235
|
+
themeId,
|
|
236
|
+
themes: featuredThemeManifests,
|
|
237
|
+
setPreference,
|
|
238
|
+
setColorPreference: setPreference,
|
|
239
|
+
setThemeId,
|
|
240
|
+
toggle,
|
|
241
|
+
toggleColorMode: toggle
|
|
242
|
+
}),
|
|
243
|
+
[mode, preference, themeId, setPreference, setThemeId, toggle]
|
|
244
|
+
);
|
|
245
|
+
return /* @__PURE__ */ jsx(SableThemeContext.Provider, { value, children });
|
|
246
|
+
}
|
|
247
|
+
function useSableTheme() {
|
|
248
|
+
const ctx = useContext(SableThemeContext);
|
|
249
|
+
if (ctx) return ctx;
|
|
250
|
+
return {
|
|
251
|
+
mode: "dark",
|
|
252
|
+
colorMode: "dark",
|
|
253
|
+
preference: "dark",
|
|
254
|
+
colorPreference: "dark",
|
|
255
|
+
themeId: defaultThemeId,
|
|
256
|
+
themes: featuredThemeManifests,
|
|
257
|
+
setPreference: () => {
|
|
258
|
+
},
|
|
259
|
+
setColorPreference: () => {
|
|
260
|
+
},
|
|
261
|
+
setThemeId: () => {
|
|
262
|
+
},
|
|
263
|
+
toggle: () => {
|
|
264
|
+
},
|
|
265
|
+
toggleColorMode: () => {
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export { DEFAULT_THEME_ID, SABLE_COLOR_STORAGE_KEY, SABLE_THEME_ATTRIBUTE, SABLE_THEME_STORAGE_KEY, SableThemeProvider, applySableColorMode, applySableTheme, buildThemeManifestById, defaultThemeId, featuredThemeManifests, getThemeManifest, isKnownThemeId, isThemeId, themeIds, themeManifestById, themeManifests, useSableTheme };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
// src/components/phone/status-icons.tsx
|
|
4
|
+
function StatusIcons(props) {
|
|
5
|
+
return /* @__PURE__ */ jsxs("span", { "aria-hidden": true, ...props, children: [
|
|
6
|
+
/* @__PURE__ */ jsxs("svg", { viewBox: "0 0 17 12", width: "17", height: "12", fill: "currentColor", children: [
|
|
7
|
+
/* @__PURE__ */ jsx("rect", { x: "0", y: "7.5", width: "3", height: "4.5", rx: "1" }),
|
|
8
|
+
/* @__PURE__ */ jsx("rect", { x: "4.66", y: "5", width: "3", height: "7", rx: "1" }),
|
|
9
|
+
/* @__PURE__ */ jsx("rect", { x: "9.33", y: "2.5", width: "3", height: "9.5", rx: "1" }),
|
|
10
|
+
/* @__PURE__ */ jsx("rect", { x: "14", y: "0", width: "3", height: "12", rx: "1" })
|
|
11
|
+
] }),
|
|
12
|
+
/* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 12", width: "16", height: "12", fill: "none", stroke: "currentColor", strokeWidth: "2.1", strokeLinecap: "round", children: [
|
|
13
|
+
/* @__PURE__ */ jsx("path", { d: "M1.64 4.84 A9 9 0 0 1 14.36 4.84" }),
|
|
14
|
+
/* @__PURE__ */ jsx("path", { d: "M4.04 7.64 A5.6 5.6 0 0 1 11.96 7.64" }),
|
|
15
|
+
/* @__PURE__ */ jsx("path", { d: "M8 11.4 L6.25 9.65 A2.5 2.5 0 0 1 9.75 9.65 Z", fill: "currentColor", stroke: "none" })
|
|
16
|
+
] }),
|
|
17
|
+
/* @__PURE__ */ jsxs("svg", { viewBox: "0 0 27 13", width: "27", height: "13", fill: "currentColor", children: [
|
|
18
|
+
/* @__PURE__ */ jsx("rect", { x: "0.5", y: "0.5", width: "23", height: "12", rx: "3.8", fill: "none", stroke: "currentColor", opacity: "0.35" }),
|
|
19
|
+
/* @__PURE__ */ jsx("rect", { x: "2", y: "2", width: "20", height: "9", rx: "2.5" }),
|
|
20
|
+
/* @__PURE__ */ jsx("path", { d: "M25 4.5 a1.5 1.5 0 0 1 1.5 1.5 v1 a1.5 1.5 0 0 1 -1.5 1.5 z", opacity: "0.4" })
|
|
21
|
+
] })
|
|
22
|
+
] });
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { StatusIcons };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { reiconIconSet } from './chunk-5Z5KLOAU.js';
|
|
2
|
+
import { createContext, useMemo, useContext } from 'react';
|
|
3
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
var IconContext = createContext({
|
|
6
|
+
set: null,
|
|
7
|
+
defaultVariant: "regular"
|
|
8
|
+
});
|
|
9
|
+
function IconProvider({
|
|
10
|
+
set,
|
|
11
|
+
defaultVariant = "regular",
|
|
12
|
+
children
|
|
13
|
+
}) {
|
|
14
|
+
const value = useMemo(
|
|
15
|
+
() => ({ set, defaultVariant }),
|
|
16
|
+
[set, defaultVariant]
|
|
17
|
+
);
|
|
18
|
+
return /* @__PURE__ */ jsx(IconContext.Provider, { value, children });
|
|
19
|
+
}
|
|
20
|
+
function useIconSet() {
|
|
21
|
+
return useContext(IconContext);
|
|
22
|
+
}
|
|
23
|
+
function Icon({ name, variant, spin, className, title }) {
|
|
24
|
+
const { set, defaultVariant } = useIconSet();
|
|
25
|
+
const resolved = set ?? reiconIconSet;
|
|
26
|
+
return /* @__PURE__ */ jsx(Fragment, { children: resolved({ name, variant: variant ?? defaultVariant, spin, className, title }) });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// src/icon/compose.ts
|
|
30
|
+
function composeIconSets(...sets) {
|
|
31
|
+
return (props) => {
|
|
32
|
+
for (const set of sets) {
|
|
33
|
+
const rendered = set(props);
|
|
34
|
+
if (rendered !== null && rendered !== void 0) return rendered;
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { Icon, IconProvider, composeIconSets, useIconSet };
|