@astryxdesign/theme-chocolate 0.0.0-bootstrap.0 → 0.0.15

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.
@@ -0,0 +1,230 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * Chocolate Theme
5
+ *
6
+ * A warm, cozy theme inspired by rich chocolate and caramel tones.
7
+ * Core palette: #8C5927, #B88859, #C4AC95, #EDE4D4, #FFFCF7
8
+ * Uses Fraunces for headings and Albert Sans for body text.
9
+ */
10
+
11
+ import {defineTheme, defineSyntaxTheme} from '@astryxdesign/core/theme';
12
+ import {chocolateIconRegistry} from './icons';
13
+
14
+ /** Chocolate syntax palette — warm browns and amber tones. */
15
+ const chocolateSyntax = defineSyntaxTheme({
16
+ name: 'xds-chocolate',
17
+ tokens: {
18
+ keyword: ['#8C5927', '#d4a06a'],
19
+ string: ['#2e6b4a', '#7bc49e'],
20
+ comment: ['#B88859', '#B88859'],
21
+ number: ['#a06018', '#d4b870'],
22
+ function: ['#3a5e8c', '#7ba8d4'],
23
+ type: ['#6b4a8c', '#b08ed4'],
24
+ variable: ['#4a3520', '#EDE4D4'],
25
+ operator: ['#B88859', '#c4a882'],
26
+ constant: ['#a06018', '#d4b870'],
27
+ tag: ['#8c3a3a', '#d47a7a'],
28
+ attribute: ['#8C5927', '#d4a06a'],
29
+ property: ['#3a7c6b', '#70c4b0'],
30
+ punctuation: ['#B88859', '#6b5540'],
31
+ background: ['#FFFCF7', '#1c1610'],
32
+ },
33
+ });
34
+
35
+ export const chocolateTheme = defineTheme({
36
+ name: 'chocolate',
37
+
38
+ typography: {
39
+ scale: {base: 14, ratio: 1.2},
40
+ body: {
41
+ family: 'Albert Sans',
42
+ fallbacks:
43
+ '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',
44
+ },
45
+ heading: {
46
+ family: 'Fraunces',
47
+ fallbacks:
48
+ 'Georgia, "Times New Roman", Times, serif',
49
+ weights: {3: 'bold', 4: 'bold'},
50
+ },
51
+ code: {
52
+ family: 'JetBrains Mono',
53
+ fallbacks: '"SF Mono", Monaco, Consolas, monospace',
54
+ },
55
+ },
56
+
57
+ motion: {fast: 125, medium: 300, slow: 700, ratio: 0.75},
58
+
59
+ syntax: chocolateSyntax,
60
+
61
+ tokens: {
62
+ // =========================================================================
63
+ // Colors — warm chocolate palette
64
+ // Core: #8C5927, #B88859, #C4AC95, #EDE4D4, #FFFCF7
65
+ // =========================================================================
66
+
67
+ // Core semantic
68
+ '--color-accent': ['#8C5927', '#d4a06a'],
69
+ '--color-accent-muted': ['#8C592714', '#d4a06a20'],
70
+ '--color-neutral': ['#8C59270F', '#EDE4D41A'],
71
+ '--color-background-surface': ['#FFFCF7', '#1c1610'],
72
+ '--color-background-body': ['#FFFCF7', '#141010'],
73
+ '--color-overlay': ['#4a352080', '#140e0aCC'],
74
+ '--color-overlay-hover': ['#4a35200D', '#EDE4D40D'],
75
+ '--color-overlay-pressed': ['#4a35201A', '#EDE4D41A'],
76
+ '--color-background-muted': ['#EDE4D4', '#2a2018'],
77
+
78
+ // Text
79
+ '--color-text-primary': ['#4a3520', '#EDE4D4'],
80
+ '--color-text-secondary': ['#B88859', '#c4a882'],
81
+ '--color-text-disabled': ['#C4AC95', '#6b5540'],
82
+ '--color-text-accent': ['#8C5927', '#d4a06a'],
83
+ '--color-on-dark': '#FFFCF7',
84
+ '--color-on-light': '#4a3520',
85
+ '--color-on-accent': ['#FFFFFF', '#4a3520'],
86
+ '--color-on-success': ['#FFFFFF', '#4a3520'],
87
+ '--color-on-error': ['#FFFFFF', '#4a3520'],
88
+ '--color-on-warning': ['#4a3520', '#4a3520'],
89
+
90
+ // Icon
91
+ '--color-icon-accent': ['#8C5927', '#d4a06a'],
92
+ '--color-icon-primary': ['#4a3520', '#EDE4D4'],
93
+ '--color-icon-secondary': ['#B88859', '#c4a882'],
94
+ '--color-icon-disabled': ['#C4AC95', '#6b5540'],
95
+
96
+ // Surface variants
97
+ '--color-background-card': ['#EDE4D4', '#2a2018'],
98
+ '--color-background-popover': ['#FFFCF7', '#2a2018'],
99
+ '--color-background-inverted': ['#4a3520', '#EDE4D4'],
100
+
101
+ // Status / Sentiment
102
+ '--color-success': ['#709900', '#96bf2a'],
103
+ '--color-success-muted': ['#70990020', '#96bf2a20'],
104
+ '--color-error': ['#FD0000', '#ff5c5c'],
105
+ '--color-error-muted': ['#FD000020', '#ff5c5c20'],
106
+ '--color-warning': ['#FFB600', '#ffc940'],
107
+ '--color-warning-muted': ['#FFB60020', '#ffc94020'],
108
+
109
+ // Border
110
+ '--color-border': ['#C4AC95', '#EDE4D41A'],
111
+ '--color-border-emphasized': ['#B88859', '#6b5540'],
112
+
113
+ // Effects
114
+ '--color-skeleton': ['#C4AC95', '#6b5540'],
115
+ '--color-shadow': ['#4a35201A', '#0000004D'],
116
+ '--color-tint-hover': ['black', 'white'],
117
+
118
+ // Categorical — Blue
119
+ '--color-background-blue': ['#3a5e8c33', '#3a5e8c33'],
120
+ '--color-border-blue': ['#3a5e8c', '#7ba8d4'],
121
+ '--color-icon-blue': ['#3a5e8c', '#7ba8d4'],
122
+ '--color-text-blue': ['#2e4a6e', '#8dbce0'],
123
+
124
+ // Categorical — Cyan
125
+ '--color-background-cyan': ['#3a7c7c33', '#3a7c7c33'],
126
+ '--color-border-cyan': ['#3a7c7c', '#70c4c4'],
127
+ '--color-icon-cyan': ['#3a7c7c', '#70c4c4'],
128
+ '--color-text-cyan': ['#2e6060', '#82d4d4'],
129
+
130
+ // Categorical — Gray
131
+ '--color-background-gray': ['#B8885933', '#6b554033'],
132
+ '--color-border-gray': ['#B88859', '#B88859'],
133
+ '--color-icon-gray': ['#B88859', '#c4a882'],
134
+ '--color-text-gray': ['#4a3520', '#EDE4D4'],
135
+
136
+ // Categorical — Green
137
+ '--color-background-green': ['#70990033', '#96bf2a33'],
138
+ '--color-border-green': ['#709900', '#96bf2a'],
139
+ '--color-icon-green': ['#709900', '#96bf2a'],
140
+ '--color-text-green': ['#5a7a00', '#a8d43a'],
141
+
142
+ // Categorical — Orange
143
+ '--color-background-orange': ['#c4762033', '#d4903a33'],
144
+ '--color-border-orange': ['#c47620', '#d4903a'],
145
+ '--color-icon-orange': ['#c47620', '#d4903a'],
146
+ '--color-text-orange': ['#a06018', '#e0a04a'],
147
+
148
+ // Categorical — Pink
149
+ '--color-background-pink': ['#c44a7033', '#e07a9a33'],
150
+ '--color-border-pink': ['#c44a70', '#e07a9a'],
151
+ '--color-icon-pink': ['#c44a70', '#e07a9a'],
152
+ '--color-text-pink': ['#a03a5a', '#f08aaa'],
153
+
154
+ // Categorical — Purple
155
+ '--color-background-purple': ['#6b4a8c33', '#b08ed433'],
156
+ '--color-border-purple': ['#6b4a8c', '#b08ed4'],
157
+ '--color-icon-purple': ['#6b4a8c', '#b08ed4'],
158
+ '--color-text-purple': ['#553a70', '#c0a0e0'],
159
+
160
+ // Categorical — Red
161
+ '--color-background-red': ['#FD000033', '#ff5c5c33'],
162
+ '--color-border-red': ['#FD0000', '#ff5c5c'],
163
+ '--color-icon-red': ['#FD0000', '#ff5c5c'],
164
+ '--color-text-red': ['#cc0000', '#ff7a7a'],
165
+
166
+ // Categorical — Teal
167
+ '--color-background-teal': ['#2e6b5a33', '#5ab89833'],
168
+ '--color-border-teal': ['#2e6b5a', '#5ab898'],
169
+ '--color-icon-teal': ['#2e6b5a', '#5ab898'],
170
+ '--color-text-teal': ['#245546', '#6ccaaa'],
171
+
172
+ // Categorical — Yellow
173
+ '--color-background-yellow': ['#FFB60033', '#ffc94033'],
174
+ '--color-border-yellow': ['#FFB600', '#ffc940'],
175
+ '--color-icon-yellow': ['#FFB600', '#ffc940'],
176
+ '--color-text-yellow': ['#cc9200', '#ffd960'],
177
+
178
+ // =========================================================================
179
+ // Radius — soft and rounded
180
+ // =========================================================================
181
+ '--radius-none': '0.125rem',
182
+ '--radius-inner': '0.375rem',
183
+ '--radius-element': '0.625rem',
184
+ '--radius-container': '0.75rem',
185
+ '--radius-page': '1.5rem',
186
+ '--radius-full': '9999px',
187
+
188
+ // =========================================================================
189
+ // Shadows — warm-toned
190
+ // =========================================================================
191
+ '--shadow-low':
192
+ '0 2px 4px #4a35200D, 0 4px 8px #4a35201A',
193
+ '--shadow-med':
194
+ '0 2px 4px #4a35200D, 0 4px 12px #4a35201A',
195
+ '--shadow-high':
196
+ '0 4px 6px #4a35201A, 0 12px 24px #4a352026',
197
+ '--shadow-inset-hover': 'inset 0px 0px 0px 2px #8C592730',
198
+ '--shadow-inset-selected': 'inset 0px 0px 0px 2px #8C592750',
199
+ '--shadow-inset-success': 'inset 0px 0px 0px 2px #70990050',
200
+ '--shadow-inset-warning': 'inset 0px 0px 0px 2px #FFB60050',
201
+ '--shadow-inset-error': 'inset 0px 0px 0px 2px #FD000050',
202
+ },
203
+
204
+ components: {
205
+ button: {
206
+ base: {
207
+ borderRadius: 'var(--radius-full)',
208
+ },
209
+ 'variant:secondary': {
210
+ borderWidth: '1px',
211
+ borderStyle: 'solid',
212
+ borderColor: 'var(--color-border-emphasized)',
213
+ },
214
+ },
215
+
216
+ card: {
217
+ base: {
218
+ padding: 'var(--spacing-3)',
219
+ },
220
+ },
221
+
222
+ section: {
223
+ base: {
224
+ padding: 'var(--spacing-3)',
225
+ },
226
+ },
227
+ },
228
+
229
+ icons: chocolateIconRegistry,
230
+ });
package/src/icons.tsx ADDED
@@ -0,0 +1,77 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file icons.tsx
5
+ * @input Uses lucide-react icon components, IconRegistry type
6
+ * @output Exports chocolateIconRegistry for the neutral theme
7
+ * @position Icon configuration for the neutral theme; consumed by index.ts
8
+ *
9
+ * Maps semantic icon names to Lucide icon components.
10
+ * These icons are bundled with the theme, not with @astryxdesign/core.
11
+ */
12
+
13
+ import React from 'react';
14
+ import type {IconRegistry} from '@astryxdesign/core/Icon';
15
+
16
+ import {
17
+ X,
18
+ ChevronDown,
19
+ ChevronLeft,
20
+ ChevronRight,
21
+ Check,
22
+ CheckCircle,
23
+ XCircle,
24
+ AlertTriangle,
25
+ Info,
26
+ Calendar,
27
+ Clock,
28
+ ExternalLink,
29
+ Menu,
30
+ MoreHorizontal,
31
+ Search,
32
+ ArrowUp,
33
+ ArrowDown,
34
+ ArrowUpDown,
35
+ Filter,
36
+ EyeOff,
37
+ Columns,
38
+ Copy,
39
+ CheckCheck,
40
+ Wrench,
41
+ Square,
42
+ Mic,
43
+ } from 'lucide-react';
44
+
45
+ const iconProps = {
46
+ size: '1em',
47
+ 'aria-hidden': true as const,
48
+ };
49
+
50
+ export const chocolateIconRegistry: IconRegistry = {
51
+ close: <X {...iconProps} />,
52
+ chevronDown: <ChevronDown {...iconProps} />,
53
+ chevronLeft: <ChevronLeft {...iconProps} />,
54
+ chevronRight: <ChevronRight {...iconProps} />,
55
+ check: <Check {...iconProps} />,
56
+ success: <CheckCircle {...iconProps} />,
57
+ error: <XCircle {...iconProps} />,
58
+ warning: <AlertTriangle {...iconProps} />,
59
+ info: <Info {...iconProps} />,
60
+ calendar: <Calendar {...iconProps} />,
61
+ clock: <Clock {...iconProps} />,
62
+ externalLink: <ExternalLink {...iconProps} />,
63
+ menu: <Menu {...iconProps} />,
64
+ moreHorizontal: <MoreHorizontal {...iconProps} />,
65
+ search: <Search {...iconProps} />,
66
+ arrowUp: <ArrowUp {...iconProps} />,
67
+ arrowDown: <ArrowDown {...iconProps} />,
68
+ arrowsUpDown: <ArrowUpDown {...iconProps} />,
69
+ funnel: <Filter {...iconProps} />,
70
+ eyeSlash: <EyeOff {...iconProps} />,
71
+ viewColumns: <Columns {...iconProps} />,
72
+ copy: <Copy {...iconProps} />,
73
+ checkDouble: <CheckCheck {...iconProps} />,
74
+ wrench: <Wrench {...iconProps} />,
75
+ stop: <Square {...iconProps} />,
76
+ microphone: <Mic {...iconProps} />,
77
+ };
package/src/source.ts ADDED
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ export {chocolateTheme} from './chocolateTheme';
4
+ export {chocolateIconRegistry} from './icons';