@phcdevworks/spectre-ui 0.0.1 → 0.0.3
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/README.md +251 -27
- package/dist/base.css +45 -15
- package/dist/components.css +234 -114
- package/dist/index.cjs +215 -148
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +86 -52
- package/dist/index.d.ts +86 -52
- package/dist/index.js +212 -143
- package/dist/index.js.map +1 -1
- package/dist/utilities.css +3 -3
- package/package.json +42 -27
package/dist/index.d.ts
CHANGED
|
@@ -1,69 +1,103 @@
|
|
|
1
|
-
import { Tokens, TailwindTheme, AccessibilityTokens, AnimationEntry, ButtonStateTokens, FormStateTokens, TokenScale, TransitionTokens, TypographyTokens } from '@phcdevworks/spectre-tokens';
|
|
2
1
|
import { Config } from 'tailwindcss';
|
|
2
|
+
import { SpectreTokens } from '@phcdevworks/spectre-tokens';
|
|
3
|
+
export { SpectreTokens, tokens as spectreTokens } from '@phcdevworks/spectre-tokens';
|
|
3
4
|
|
|
4
|
-
declare const
|
|
5
|
-
declare const
|
|
6
|
-
declare const
|
|
7
|
-
|
|
5
|
+
declare const spectreBaseStylesPath = "@phcdevworks/spectre-ui/dist/base.css";
|
|
6
|
+
declare const spectreComponentsStylesPath = "@phcdevworks/spectre-ui/dist/components.css";
|
|
7
|
+
declare const spectreUtilitiesStylesPath = "@phcdevworks/spectre-ui/dist/utilities.css";
|
|
8
|
+
declare const spectreStyles: {
|
|
9
|
+
base: string;
|
|
10
|
+
components: string;
|
|
11
|
+
utilities: string;
|
|
8
12
|
};
|
|
9
|
-
type SpectreTokens = Tokens;
|
|
10
|
-
type SpectreTailwindTheme = TailwindTheme;
|
|
11
|
-
type SpectreTokenScale = TokenScale;
|
|
12
|
-
type SpectreTransitionTokens = TransitionTokens;
|
|
13
|
-
type SpectreTypographyTokens = TypographyTokens;
|
|
14
|
-
type SpectreAccessibilityTokens = AccessibilityTokens;
|
|
15
|
-
type SpectreAnimationEntry = AnimationEntry;
|
|
16
|
-
type SpectreButtonStateTokens = ButtonStateTokens;
|
|
17
|
-
type SpectreFormStateTokens = FormStateTokens;
|
|
18
|
-
interface SpectreCssVariableOptions {
|
|
19
|
-
selector?: string;
|
|
20
|
-
prefix?: string;
|
|
21
|
-
}
|
|
22
|
-
type SpectreCssVariableMap = Record<string, string>;
|
|
23
|
-
declare const createSpectreTailwindTheme: (source?: SpectreTokens) => SpectreTailwindTheme;
|
|
24
|
-
declare const createSpectreCssVariableMap: (source?: SpectreTokens, options?: SpectreCssVariableOptions) => SpectreCssVariableMap;
|
|
25
|
-
declare const generateSpectreCssVariables: (source?: SpectreTokens, options?: SpectreCssVariableOptions) => string;
|
|
26
13
|
|
|
27
14
|
declare const spectrePreset: Config;
|
|
28
15
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
16
|
+
interface SpectreTailwindTheme {
|
|
17
|
+
theme: Config['theme'];
|
|
18
|
+
}
|
|
19
|
+
interface CreateSpectreTailwindThemeOptions {
|
|
20
|
+
tokens: SpectreTokens;
|
|
21
|
+
overrides?: Partial<SpectreTokens>;
|
|
22
|
+
}
|
|
23
|
+
declare function createSpectreTailwindTheme(options: CreateSpectreTailwindThemeOptions): SpectreTailwindTheme;
|
|
32
24
|
|
|
33
|
-
|
|
25
|
+
type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
26
|
+
type ButtonSize = 'sm' | 'md' | 'lg';
|
|
27
|
+
type ButtonTone = 'default' | 'success' | 'warning' | 'danger';
|
|
28
|
+
interface ButtonRecipeOptions {
|
|
34
29
|
variant?: ButtonVariant;
|
|
35
30
|
size?: ButtonSize;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
type InputState = 'default' | 'focus' | 'invalid' | 'valid' | 'disabled';
|
|
42
|
-
|
|
43
|
-
interface GetInputClassesOptions {
|
|
44
|
-
state?: InputState;
|
|
45
|
-
extraClasses?: string;
|
|
31
|
+
tone?: ButtonTone;
|
|
32
|
+
fullWidth?: boolean;
|
|
33
|
+
loading?: boolean;
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
iconOnly?: boolean;
|
|
46
36
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Generate Spectre button classes.
|
|
39
|
+
*
|
|
40
|
+
* Rules:
|
|
41
|
+
* - Base: "sp-btn"
|
|
42
|
+
* - Variant: "sp-btn--primary" / "sp-btn--secondary" / "sp-btn--ghost" / "sp-btn--danger"
|
|
43
|
+
* - default variant is "primary"
|
|
44
|
+
* - Size: "sp-btn--sm" / "sp-btn--md" / "sp-btn--lg"
|
|
45
|
+
* - default size is "md"
|
|
46
|
+
* - Tone: "sp-btn--tone-success" / "sp-btn--tone-warning" / "sp-btn--tone-danger"
|
|
47
|
+
* - default tone is "default" (no tone class)
|
|
48
|
+
* - fullWidth: add "sp-btn--full"
|
|
49
|
+
* - loading: add "sp-btn--loading"
|
|
50
|
+
* - disabled: add "sp-btn--disabled"
|
|
51
|
+
* - iconOnly: add "sp-btn--icon"
|
|
52
|
+
*
|
|
53
|
+
* Must return a single space-joined, trimmed class string.
|
|
54
|
+
*/
|
|
55
|
+
declare function getButtonClasses(opts?: ButtonRecipeOptions): string;
|
|
50
56
|
|
|
51
|
-
|
|
57
|
+
type CardVariant = 'elevated' | 'outline' | 'ghost';
|
|
58
|
+
interface CardRecipeOptions {
|
|
52
59
|
variant?: CardVariant;
|
|
53
|
-
|
|
60
|
+
interactive?: boolean;
|
|
61
|
+
padded?: boolean;
|
|
62
|
+
fullHeight?: boolean;
|
|
54
63
|
}
|
|
55
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Generate Spectre card classes.
|
|
66
|
+
*
|
|
67
|
+
* Rules:
|
|
68
|
+
* - Base class: "sp-card"
|
|
69
|
+
* - Variant (default: elevated):
|
|
70
|
+
* - "sp-card--elevated"
|
|
71
|
+
* - "sp-card--outline"
|
|
72
|
+
* - "sp-card--ghost"
|
|
73
|
+
* - interactive: add "sp-card--interactive"
|
|
74
|
+
* - padded: add "sp-card--padded"
|
|
75
|
+
* - fullHeight: add "sp-card--full"
|
|
76
|
+
*/
|
|
77
|
+
declare function getCardClasses(opts?: CardRecipeOptions): string;
|
|
56
78
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
79
|
+
type InputState = 'default' | 'error' | 'success';
|
|
80
|
+
type InputSize = 'sm' | 'md' | 'lg';
|
|
81
|
+
interface InputRecipeOptions {
|
|
82
|
+
state?: InputState;
|
|
83
|
+
size?: InputSize;
|
|
84
|
+
fullWidth?: boolean;
|
|
85
|
+
}
|
|
60
86
|
/**
|
|
61
|
-
*
|
|
87
|
+
* Generate Spectre input classes.
|
|
88
|
+
*
|
|
89
|
+
* Rules:
|
|
90
|
+
* - Base class: "sp-input"
|
|
91
|
+
* - State:
|
|
92
|
+
* - "default" => no state modifier
|
|
93
|
+
* - "error" => "sp-input--error"
|
|
94
|
+
* - "success" => "sp-input--success"
|
|
95
|
+
* - Size (default: md):
|
|
96
|
+
* - "sp-input--sm"
|
|
97
|
+
* - "sp-input--md"
|
|
98
|
+
* - "sp-input--lg"
|
|
99
|
+
* - fullWidth: add "sp-input--full"
|
|
62
100
|
*/
|
|
63
|
-
declare
|
|
64
|
-
readonly base: "@phcdevworks/spectre-ui/dist/base.css";
|
|
65
|
-
readonly components: "@phcdevworks/spectre-ui/dist/components.css";
|
|
66
|
-
readonly utilities: "@phcdevworks/spectre-ui/dist/utilities.css";
|
|
67
|
-
};
|
|
101
|
+
declare function getInputClasses(opts?: InputRecipeOptions): string;
|
|
68
102
|
|
|
69
|
-
export { type
|
|
103
|
+
export { type ButtonRecipeOptions, type ButtonSize, type ButtonTone, type ButtonVariant, type CardRecipeOptions, type CardVariant, type CreateSpectreTailwindThemeOptions, type InputRecipeOptions, type InputSize, type InputState, type SpectreTailwindTheme, createSpectreTailwindTheme, getButtonClasses, getCardClasses, getInputClasses, spectreBaseStylesPath, spectreComponentsStylesPath, spectrePreset, spectreStyles, spectreUtilitiesStylesPath };
|
package/dist/index.js
CHANGED
|
@@ -1,163 +1,232 @@
|
|
|
1
|
-
import
|
|
1
|
+
import plugin from 'tailwindcss/plugin';
|
|
2
|
+
import { tokens } from '@phcdevworks/spectre-tokens';
|
|
3
|
+
export { tokens as spectreTokens } from '@phcdevworks/spectre-tokens';
|
|
2
4
|
|
|
3
|
-
// src/
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
// src/css-constants.ts
|
|
6
|
+
var spectreBaseStylesPath = "@phcdevworks/spectre-ui/dist/base.css";
|
|
7
|
+
var spectreComponentsStylesPath = "@phcdevworks/spectre-ui/dist/components.css";
|
|
8
|
+
var spectreUtilitiesStylesPath = "@phcdevworks/spectre-ui/dist/utilities.css";
|
|
9
|
+
var spectreStyles = {
|
|
10
|
+
base: spectreBaseStylesPath,
|
|
11
|
+
components: spectreComponentsStylesPath,
|
|
12
|
+
utilities: spectreUtilitiesStylesPath
|
|
13
|
+
};
|
|
10
14
|
|
|
11
|
-
// src/tailwind/
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
// src/tailwind/theme.ts
|
|
16
|
+
function createSpectreTailwindTheme(options) {
|
|
17
|
+
const { tokens, overrides } = options;
|
|
18
|
+
const mergedTokens = {
|
|
19
|
+
...tokens,
|
|
20
|
+
...overrides ?? {}
|
|
21
|
+
};
|
|
22
|
+
const mergedColors = mergedTokens.colors ?? {};
|
|
23
|
+
const attachSemanticColors = (existing, semantic) => {
|
|
24
|
+
if (!semantic || Object.keys(semantic).length === 0) {
|
|
25
|
+
return Object.keys(existing).length > 0 ? existing : void 0;
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
...existing,
|
|
29
|
+
...semantic
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
const themeColors = {
|
|
33
|
+
...mergedColors
|
|
34
|
+
};
|
|
35
|
+
const surfaceColors = attachSemanticColors(
|
|
36
|
+
mergedColors.surface ?? {},
|
|
37
|
+
mergedTokens.surface
|
|
38
|
+
);
|
|
39
|
+
if (surfaceColors) {
|
|
40
|
+
themeColors.surface = surfaceColors;
|
|
16
41
|
}
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (
|
|
22
|
-
|
|
42
|
+
const textColors = attachSemanticColors(
|
|
43
|
+
mergedColors.text ?? {},
|
|
44
|
+
mergedTokens.text
|
|
45
|
+
);
|
|
46
|
+
if (textColors) {
|
|
47
|
+
themeColors.text = textColors;
|
|
23
48
|
}
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
49
|
+
const componentColors = attachSemanticColors(
|
|
50
|
+
mergedColors.component ?? {},
|
|
51
|
+
mergedTokens.component
|
|
52
|
+
);
|
|
53
|
+
if (componentColors) {
|
|
54
|
+
themeColors.component = componentColors;
|
|
27
55
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
DEFAULT: readColorValue("neutral", "50"),
|
|
48
|
-
muted: readColorValue("neutral", "100"),
|
|
49
|
-
strong: readColorValue("neutral", "900")
|
|
50
|
-
},
|
|
51
|
-
intent: {
|
|
52
|
-
info: readColorValue("info", "500"),
|
|
53
|
-
success: readColorValue("success", "500"),
|
|
54
|
-
warning: readColorValue("warning", "500"),
|
|
55
|
-
danger: readColorValue("error", "500")
|
|
56
|
+
const theme2 = {
|
|
57
|
+
// Safely map core token groups into Tailwind theme fields.
|
|
58
|
+
// Use `as any` where necessary to avoid overfitting types right now.
|
|
59
|
+
colors: themeColors,
|
|
60
|
+
spacing: mergedTokens.spacing ?? {},
|
|
61
|
+
borderRadius: mergedTokens.radii ?? {},
|
|
62
|
+
boxShadow: mergedTokens.shadows ?? {},
|
|
63
|
+
fontFamily: mergedTokens.typography?.families ?? {}
|
|
64
|
+
};
|
|
65
|
+
return { theme: theme2 };
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// src/tailwind/preset.ts
|
|
69
|
+
var { theme } = createSpectreTailwindTheme({
|
|
70
|
+
tokens: tokens
|
|
71
|
+
});
|
|
72
|
+
var resolveTokenValue = (value, fallback) => {
|
|
73
|
+
if (typeof value === "string") {
|
|
74
|
+
return value;
|
|
56
75
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
76
|
+
if (value && typeof value === "object") {
|
|
77
|
+
const maybeDefault = value.default;
|
|
78
|
+
if (typeof maybeDefault === "string") {
|
|
79
|
+
return maybeDefault;
|
|
80
|
+
}
|
|
81
|
+
const firstEntry = Object.values(value).find(
|
|
82
|
+
(entry) => typeof entry === "string"
|
|
83
|
+
);
|
|
84
|
+
if (typeof firstEntry === "string") {
|
|
85
|
+
return firstEntry;
|
|
67
86
|
}
|
|
68
87
|
}
|
|
88
|
+
return fallback;
|
|
69
89
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
90
|
+
var semanticUtilities = plugin(({ addUtilities }) => {
|
|
91
|
+
const tokens$1 = tokens;
|
|
92
|
+
const neutralScale = tokens$1?.colors?.neutral ?? {};
|
|
93
|
+
const formDefault = tokens$1?.forms?.default ?? {};
|
|
94
|
+
const surfaceTokens = tokens$1?.surface ?? {};
|
|
95
|
+
const textTokens = tokens$1?.text ?? {};
|
|
96
|
+
const surfacePage = resolveTokenValue(
|
|
97
|
+
surfaceTokens.page,
|
|
98
|
+
neutralScale["50"]
|
|
99
|
+
);
|
|
100
|
+
const surfaceCard = resolveTokenValue(
|
|
101
|
+
surfaceTokens.card,
|
|
102
|
+
formDefault.bg ?? surfacePage ?? neutralScale["50"]
|
|
103
|
+
);
|
|
104
|
+
const surfaceInput = resolveTokenValue(
|
|
105
|
+
surfaceTokens.input,
|
|
106
|
+
formDefault.bg ?? surfaceCard ?? surfacePage
|
|
107
|
+
);
|
|
108
|
+
const textOnPage = resolveTokenValue(
|
|
109
|
+
textTokens?.on?.page ?? textTokens?.onPage,
|
|
110
|
+
neutralScale["900"] ?? formDefault.text
|
|
111
|
+
);
|
|
112
|
+
const textOnSurface = resolveTokenValue(
|
|
113
|
+
textTokens?.on?.surface ?? textTokens?.onSurface,
|
|
114
|
+
formDefault.text ?? textOnPage ?? neutralScale["900"]
|
|
115
|
+
);
|
|
116
|
+
const utilities = {};
|
|
117
|
+
if (surfacePage) {
|
|
118
|
+
utilities[".bg-surface-page"] = { backgroundColor: surfacePage };
|
|
91
119
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
// src/recipes/button.ts
|
|
95
|
-
var getButtonClasses = ({
|
|
96
|
-
variant = "primary",
|
|
97
|
-
size = "md",
|
|
98
|
-
state = "default",
|
|
99
|
-
extraClasses = ""
|
|
100
|
-
} = {}) => {
|
|
101
|
-
const classes = [
|
|
102
|
-
buttonConfig.baseClass,
|
|
103
|
-
buttonConfig.variants[variant],
|
|
104
|
-
buttonConfig.sizes[size],
|
|
105
|
-
buttonConfig.states[state],
|
|
106
|
-
extraClasses
|
|
107
|
-
].filter(Boolean);
|
|
108
|
-
return classes.join(" ").trim();
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
// src/components/input.config.ts
|
|
112
|
-
var inputConfig = {
|
|
113
|
-
baseClass: "sp-input",
|
|
114
|
-
states: {
|
|
115
|
-
default: "",
|
|
116
|
-
focus: "sp-input-focus",
|
|
117
|
-
invalid: "sp-input-error",
|
|
118
|
-
valid: "sp-input-success",
|
|
119
|
-
disabled: "sp-input-disabled"
|
|
120
|
+
if (surfaceCard) {
|
|
121
|
+
utilities[".bg-surface-card"] = { backgroundColor: surfaceCard };
|
|
120
122
|
}
|
|
123
|
+
if (surfaceInput) {
|
|
124
|
+
utilities[".bg-surface-input"] = { backgroundColor: surfaceInput };
|
|
125
|
+
}
|
|
126
|
+
if (textOnPage) {
|
|
127
|
+
utilities[".text-on-page"] = { color: textOnPage };
|
|
128
|
+
}
|
|
129
|
+
if (textOnSurface) {
|
|
130
|
+
utilities[".text-on-surface"] = { color: textOnSurface };
|
|
131
|
+
}
|
|
132
|
+
addUtilities(utilities);
|
|
133
|
+
});
|
|
134
|
+
var spectrePreset = {
|
|
135
|
+
// Required for Tailwind's Config type with exactOptionalPropertyTypes
|
|
136
|
+
content: [],
|
|
137
|
+
theme: theme ?? {},
|
|
138
|
+
plugins: [semanticUtilities]
|
|
121
139
|
};
|
|
122
140
|
|
|
123
|
-
// src/recipes/
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
141
|
+
// src/recipes/button.ts
|
|
142
|
+
function getButtonClasses(opts = {}) {
|
|
143
|
+
const {
|
|
144
|
+
variant = "primary",
|
|
145
|
+
size = "md",
|
|
146
|
+
tone = "default",
|
|
147
|
+
fullWidth = false,
|
|
148
|
+
loading = false,
|
|
149
|
+
disabled = false,
|
|
150
|
+
iconOnly = false
|
|
151
|
+
} = opts;
|
|
152
|
+
const classes = [];
|
|
153
|
+
classes.push("sp-btn");
|
|
154
|
+
const variantMap = {
|
|
155
|
+
primary: "sp-btn--primary",
|
|
156
|
+
secondary: "sp-btn--secondary",
|
|
157
|
+
ghost: "sp-btn--ghost",
|
|
158
|
+
danger: "sp-btn--danger"
|
|
159
|
+
};
|
|
160
|
+
classes.push(variantMap[variant]);
|
|
161
|
+
const sizeMap = {
|
|
162
|
+
sm: "sp-btn--sm",
|
|
163
|
+
md: "sp-btn--md",
|
|
164
|
+
lg: "sp-btn--lg"
|
|
165
|
+
};
|
|
166
|
+
classes.push(sizeMap[size]);
|
|
167
|
+
if (tone !== "default") {
|
|
168
|
+
const toneMap = {
|
|
169
|
+
success: "sp-btn--tone-success",
|
|
170
|
+
warning: "sp-btn--tone-warning",
|
|
171
|
+
danger: "sp-btn--tone-danger"
|
|
172
|
+
};
|
|
173
|
+
classes.push(toneMap[tone]);
|
|
139
174
|
}
|
|
140
|
-
|
|
175
|
+
if (fullWidth) classes.push("sp-btn--full");
|
|
176
|
+
if (loading) classes.push("sp-btn--loading");
|
|
177
|
+
if (disabled) classes.push("sp-btn--disabled");
|
|
178
|
+
if (iconOnly) classes.push("sp-btn--icon");
|
|
179
|
+
return classes.filter(Boolean).join(" ").trim();
|
|
180
|
+
}
|
|
141
181
|
|
|
142
182
|
// src/recipes/card.ts
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
};
|
|
183
|
+
function getCardClasses(opts = {}) {
|
|
184
|
+
const {
|
|
185
|
+
variant = "elevated",
|
|
186
|
+
interactive = false,
|
|
187
|
+
padded = false,
|
|
188
|
+
fullHeight = false
|
|
189
|
+
} = opts;
|
|
190
|
+
const classes = [];
|
|
191
|
+
classes.push("sp-card");
|
|
192
|
+
const variantMap = {
|
|
193
|
+
elevated: "sp-card--elevated",
|
|
194
|
+
outline: "sp-card--outline",
|
|
195
|
+
ghost: "sp-card--ghost"
|
|
196
|
+
};
|
|
197
|
+
classes.push(variantMap[variant]);
|
|
198
|
+
if (interactive) classes.push("sp-card--interactive");
|
|
199
|
+
if (padded) classes.push("sp-card--padded");
|
|
200
|
+
if (fullHeight) classes.push("sp-card--full");
|
|
201
|
+
return classes.filter(Boolean).join(" ").trim();
|
|
202
|
+
}
|
|
150
203
|
|
|
151
|
-
// src/
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
204
|
+
// src/recipes/input.ts
|
|
205
|
+
function getInputClasses(opts = {}) {
|
|
206
|
+
const {
|
|
207
|
+
state = "default",
|
|
208
|
+
size = "md",
|
|
209
|
+
fullWidth = false
|
|
210
|
+
} = opts;
|
|
211
|
+
const classes = [];
|
|
212
|
+
classes.push("sp-input");
|
|
213
|
+
if (state === "error") {
|
|
214
|
+
classes.push("sp-input--error");
|
|
215
|
+
} else if (state === "success") {
|
|
216
|
+
classes.push("sp-input--success");
|
|
217
|
+
}
|
|
218
|
+
const sizeMap = {
|
|
219
|
+
sm: "sp-input--sm",
|
|
220
|
+
md: "sp-input--md",
|
|
221
|
+
lg: "sp-input--lg"
|
|
222
|
+
};
|
|
223
|
+
classes.push(sizeMap[size]);
|
|
224
|
+
if (fullWidth) {
|
|
225
|
+
classes.push("sp-input--full");
|
|
226
|
+
}
|
|
227
|
+
return classes.filter(Boolean).join(" ").trim();
|
|
228
|
+
}
|
|
160
229
|
|
|
161
|
-
export {
|
|
230
|
+
export { createSpectreTailwindTheme, getButtonClasses, getCardClasses, getInputClasses, spectreBaseStylesPath, spectreComponentsStylesPath, spectrePreset, spectreStyles, spectreUtilitiesStylesPath };
|
|
162
231
|
//# sourceMappingURL=index.js.map
|
|
163
232
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/tokens.ts","../src/tailwind/preset.ts","../src/components/button.config.ts","../src/recipes/button.ts","../src/components/input.config.ts","../src/recipes/input.ts","../src/components/card.config.ts","../src/recipes/card.ts","../src/index.ts"],"names":["baseCreateTailwindTheme","baseCreateCssVariableMap","baseGenerateCssVariables"],"mappings":";;;AAiBO,IAAM,aAAA,GAAgB;AACtB,IAAM,oBAAA,GAAuB;AAC7B,IAAM,qBAAA,GAAwB;AAmB9B,IAAM,0BAAA,GAA6B,CACxC,MAAA,GAAwB,aAAA,KACCA,oBAAwB,MAAM;AAElD,IAAM,8BAA8B,CACzC,MAAA,GAAwB,eACxB,OAAA,KAC0BC,oBAAA,CAAyB,QAAQ,OAAO;AAE7D,IAAM,8BAA8B,CACzC,MAAA,GAAwB,eACxB,OAAA,KACWC,oBAAA,CAAyB,QAAQ,OAAO;;;AC/CrD,IAAM,cAAA,GAAiB,CAAmC,KAAA,EAAU,GAAA,KAAyB;AAC3F,EAAA,MAAM,KAAA,GAAQ,MAAM,GAAG,CAAA;AACvB,EAAA,IAAI,SAAS,IAAA,EAAM;AACjB,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,+BAAA,EAAkC,MAAA,CAAO,GAAG,CAAC,CAAA,CAAE,CAAA;AAAA,EACjE;AAEA,EAAA,OAAO,KAAA;AACT,CAAA;AAEA,IAAM,cAAA,GAAiB,CAAC,KAAA,EAA0C,KAAA,KAAgD;AAChH,EAAA,MAAM,UAAA,GAAa,aAAA,CAAc,MAAA,CAAO,KAAK,CAAA;AAC7C,EAAA,IAAI,CAAC,UAAA,EAAY;AACf,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,6BAAA,EAAgC,KAAe,CAAA,CAAE,CAAA;AAAA,EACnE;AAEA,EAAA,MAAM,KAAA,GAAQ,WAAW,KAAe,CAAA;AACxC,EAAA,IAAI,CAAC,KAAA,EAAO;AACV,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,cAAA,EAAiB,MAAA,CAAO,KAAK,CAAC,CAAA,KAAA,EAAQ,MAAA,CAAO,KAAK,CAA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M,qBAAA,GAAwB;AAC9B,IAAM,2BAAA,GAA8B;AACpC,IAAM,0BAAA,GAA6B;AAKnC,IAAM,aAAA,GAAgB;AAAA,EAC3B,IAAA,EAAM,qBAAA;AAAA,EACN,UAAA,EAAY,2BAAA;AAAA,EACZ,SAAA,EAAW;AACb","file":"index.js","sourcesContent":["import tokens, {\n createCssVariableMap as baseCreateCssVariableMap,\n createTailwindTheme as baseCreateTailwindTheme,\n generateCssVariables as baseGenerateCssVariables,\n tailwindPreset,\n tailwindTheme,\n type AccessibilityTokens,\n type AnimationEntry,\n type ButtonStateTokens,\n type FormStateTokens,\n type TailwindTheme,\n type TokenScale,\n type Tokens,\n type TransitionTokens,\n type TypographyTokens,\n} from '@phcdevworks/spectre-tokens';\n\nexport const spectreTokens = tokens;\nexport const spectreTailwindTheme = tailwindTheme;\nexport const spectreTailwindPreset = tailwindPreset;\n\nexport type SpectreTokens = Tokens;\nexport type SpectreTailwindTheme = TailwindTheme;\nexport type SpectreTokenScale = TokenScale;\nexport type SpectreTransitionTokens = TransitionTokens;\nexport type SpectreTypographyTokens = TypographyTokens;\nexport type SpectreAccessibilityTokens = AccessibilityTokens;\nexport type SpectreAnimationEntry = AnimationEntry;\nexport type SpectreButtonStateTokens = ButtonStateTokens;\nexport type SpectreFormStateTokens = FormStateTokens;\n\nexport interface SpectreCssVariableOptions {\n selector?: string;\n prefix?: string;\n}\n\nexport type SpectreCssVariableMap = Record<string, string>;\n\nexport const createSpectreTailwindTheme = (\n source: SpectreTokens = spectreTokens,\n): SpectreTailwindTheme => baseCreateTailwindTheme(source);\n\nexport const createSpectreCssVariableMap = (\n source: SpectreTokens = spectreTokens,\n options?: SpectreCssVariableOptions,\n): SpectreCssVariableMap => baseCreateCssVariableMap(source, options);\n\nexport const generateSpectreCssVariables = (\n source: SpectreTokens = spectreTokens,\n options?: SpectreCssVariableOptions,\n): string => baseGenerateCssVariables(source, options);\n","import type { Config } from 'tailwindcss';\nimport { spectreTailwindTheme, spectreTokens } from '../tokens';\n\nconst readScaleValue = <T extends Record<string, string>>(scale: T, key: keyof T): string => {\n const value = scale[key];\n if (value == null) {\n throw new Error(`Missing Spectre token for key: ${String(key)}`);\n }\n\n return value;\n};\n\nconst readColorValue = (scale: keyof typeof spectreTokens.colors, shade: keyof Record<string, string>): string => {\n const scaleValue = spectreTokens.colors[scale];\n if (!scaleValue) {\n throw new Error(`Missing Spectre color scale: ${scale as string}`);\n }\n\n const value = scaleValue[shade as string];\n if (!value) {\n throw new Error(`Missing shade ${String(shade)} for ${String(scale)}`);\n }\n\n return value;\n};\n\nconst componentRadii = {\n btn: readScaleValue(spectreTokens.radii, 'md'),\n input: readScaleValue(spectreTokens.radii, 'md'),\n card: readScaleValue(spectreTokens.radii, 'lg'),\n pill: readScaleValue(spectreTokens.radii, 'pill'),\n};\n\nconst componentShadows = {\n soft: readScaleValue(spectreTokens.shadows, 'md'),\n card: readScaleValue(spectreTokens.shadows, 'lg'),\n};\n\nconst spacingShortcuts = {\n gutter: readScaleValue(spectreTokens.spacing, 'lg'),\n section: readScaleValue(spectreTokens.spacing, '2xl'),\n stack: readScaleValue(spectreTokens.spacing, 'md'),\n};\n\nconst componentColors = {\n surface: {\n DEFAULT: readColorValue('neutral', '50'),\n muted: readColorValue('neutral', '100'),\n strong: readColorValue('neutral', '900'),\n },\n intent: {\n info: readColorValue('info', '500'),\n success: readColorValue('success', '500'),\n warning: readColorValue('warning', '500'),\n danger: readColorValue('error', '500'),\n },\n};\n\nexport const spectrePreset: Config = {\n content: [],\n theme: {\n ...spectreTailwindTheme,\n extend: {\n borderRadius: componentRadii,\n boxShadow: componentShadows,\n spacing: spacingShortcuts,\n colors: componentColors,\n },\n },\n};\n","export type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'success' | 'danger';\nexport type ButtonSize = 'sm' | 'md' | 'lg';\nexport type ButtonState = 'default' | 'hover' | 'active' | 'disabled';\n\nexport interface ButtonClassConfig {\n baseClass: string;\n variants: Record<ButtonVariant, string>;\n sizes: Record<ButtonSize, string>;\n states: Record<ButtonState, string>;\n}\n\nexport const buttonConfig: ButtonClassConfig = {\n baseClass: 'sp-btn',\n variants: {\n primary: 'sp-btn-primary',\n secondary: 'sp-btn-secondary',\n ghost: 'sp-btn-ghost',\n success: 'sp-btn-success',\n danger: 'sp-btn-danger',\n },\n sizes: {\n sm: 'sp-btn-sm',\n md: 'sp-btn-md',\n lg: 'sp-btn-lg',\n },\n states: {\n default: '',\n hover: 'sp-btn-hover',\n active: 'sp-btn-active',\n disabled: 'sp-btn-disabled',\n },\n};\n","import { buttonConfig, type ButtonSize, type ButtonState, type ButtonVariant } from '../components/button.config';\n\nexport interface GetButtonClassesOptions {\n variant?: ButtonVariant;\n size?: ButtonSize;\n state?: ButtonState;\n extraClasses?: string;\n}\n\nexport const getButtonClasses = ({\n variant = 'primary',\n size = 'md',\n state = 'default',\n extraClasses = '',\n}: GetButtonClassesOptions = {}): string => {\n const classes = [\n buttonConfig.baseClass,\n buttonConfig.variants[variant],\n buttonConfig.sizes[size],\n buttonConfig.states[state],\n extraClasses,\n ].filter(Boolean);\n\n return classes.join(' ').trim();\n};\n","export type InputState = 'default' | 'focus' | 'invalid' | 'valid' | 'disabled';\n\nexport interface InputClassConfig {\n baseClass: string;\n states: Record<InputState, string>;\n}\n\nexport const inputConfig: InputClassConfig = {\n baseClass: 'sp-input',\n states: {\n default: '',\n focus: 'sp-input-focus',\n invalid: 'sp-input-error',\n valid: 'sp-input-success',\n disabled: 'sp-input-disabled',\n },\n};\n","import { inputConfig, type InputState } from '../components/input.config';\n\nexport interface GetInputClassesOptions {\n state?: InputState;\n extraClasses?: string;\n}\n\nexport const getInputClasses = ({\n state = 'default',\n extraClasses = '',\n}: GetInputClassesOptions = {}): string => {\n const classes = [inputConfig.baseClass, inputConfig.states[state], extraClasses].filter(Boolean);\n return classes.join(' ').trim();\n};\n","export type CardVariant = 'base' | 'elevated' | 'flat';\n\nexport interface CardClassConfig {\n baseClass: string;\n variants: Record<CardVariant, string>;\n}\n\nexport const cardConfig: CardClassConfig = {\n baseClass: 'sp-card',\n variants: {\n base: '',\n elevated: 'sp-card-elevated',\n flat: 'sp-card-flat',\n },\n};\n","import { cardConfig, type CardVariant } from '../components/card.config';\n\nexport interface GetCardClassesOptions {\n variant?: CardVariant;\n extraClasses?: string;\n}\n\nexport const getCardClasses = ({\n variant = 'base',\n extraClasses = '',\n}: GetCardClassesOptions = {}): string => {\n const classes = [cardConfig.baseClass, cardConfig.variants[variant], extraClasses].filter(Boolean);\n return classes.join(' ').trim();\n};\n","export {\n spectreTokens,\n spectreTailwindPreset,\n spectreTailwindTheme,\n createSpectreCssVariableMap,\n createSpectreTailwindTheme,\n generateSpectreCssVariables,\n} from './tokens';\n\nexport type {\n SpectreAccessibilityTokens,\n SpectreAnimationEntry,\n SpectreButtonStateTokens,\n SpectreFormStateTokens,\n SpectreTailwindTheme,\n SpectreTokenScale,\n SpectreTokens,\n SpectreTransitionTokens,\n SpectreTypographyTokens,\n} from './tokens';\n\nexport { spectrePreset } from './tailwind';\n\nexport {\n getButtonClasses,\n type GetButtonClassesOptions,\n} from './recipes/button';\nexport { getInputClasses, type GetInputClassesOptions } from './recipes/input';\nexport { getCardClasses, type GetCardClassesOptions } from './recipes/card';\n\nexport type {\n ButtonSize,\n ButtonState,\n ButtonVariant,\n} from './components/button.config';\nexport type { InputState } from './components/input.config';\nexport type { CardVariant } from './components/card.config';\n\nexport const spectreBaseStylesPath = '@phcdevworks/spectre-ui/dist/base.css';\nexport const spectreComponentsStylesPath = '@phcdevworks/spectre-ui/dist/components.css';\nexport const spectreUtilitiesStylesPath = '@phcdevworks/spectre-ui/dist/utilities.css';\n\n/**\n * Structured helper for consumers that prefer namespaced CSS entry points.\n */\nexport const spectreStyles = {\n base: spectreBaseStylesPath,\n components: spectreComponentsStylesPath,\n utilities: spectreUtilitiesStylesPath,\n} as const;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/css-constants.ts","../src/tailwind/theme.ts","../src/tailwind/pre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B;AAEA,EAAA,OAAO,QAAQ,MAAA,CAAO,OAAO,EAAE,IAAA,CAAK,GAAG,EAAE,IAAA,EAAK;AAChD","file":"index.js","sourcesContent":["export const spectreBaseStylesPath = \"@phcdevworks/spectre-ui/dist/base.css\";\nexport const spectreComponentsStylesPath = \"@phcdevworks/spectre-ui/dist/components.css\";\nexport const spectreUtilitiesStylesPath = \"@phcdevworks/spectre-ui/dist/utilities.css\";\n\nexport const spectreStyles = {\n base: spectreBaseStylesPath,\n components: spectreComponentsStylesPath,\n utilities: spectreUtilitiesStylesPath,\n};\n","import type { Config as TailwindConfig } from 'tailwindcss';\nimport type { SpectreTokens } from '../tokens';\n\nexport interface SpectreTailwindTheme {\n theme: TailwindConfig['theme'];\n}\n\nexport interface CreateSpectreTailwindThemeOptions {\n tokens: SpectreTokens;\n overrides?: Partial<SpectreTokens>;\n}\n\nexport function createSpectreTailwindTheme(\n options: CreateSpectreTailwindThemeOptions,\n): SpectreTailwindTheme {\n const { tokens, overrides } = options;\n\n // Shallow merge overrides into tokens\n const mergedTokens: SpectreTokens = {\n ...tokens,\n ...(overrides ?? {}),\n };\n\n const mergedColors = (mergedTokens as any).colors ?? {};\n\n const attachSemanticColors = (\n existing: Record<string, any>,\n semantic: Record<string, any> | undefined,\n ) => {\n if (!semantic || Object.keys(semantic).length === 0) {\n return Object.keys(existing).length > 0 ? existing : undefined;\n }\n\n return {\n ...existing,\n ...semantic,\n };\n };\n\n const themeColors: Record<string, any> = {\n ...mergedColors,\n };\n\n const surfaceColors = attachSemanticColors(\n mergedColors.surface ?? {},\n (mergedTokens as any).surface,\n );\n if (surfaceColors) {\n themeColors.surface = surfaceColors;\n }\n\n const textColors = attachSemanticColors(\n mergedColors.text ?? {},\n (mergedTokens as any).text,\n );\n if (textColors) {\n themeColors.text = textColors;\n }\n\n const componentColors = attachSemanticColors(\n mergedColors.component ?? {},\n (mergedTokens as any).component,\n );\n if (componentColors) {\n themeColors.component = componentColors;\n }\n\n const theme: TailwindConfig['theme'] = {\n // Safely map core token groups into Tailwind theme fields.\n // Use `as any` where necessary to avoid overfitting types right now.\n colors: themeColors,\n spacing: (mergedTokens as any).spacing ?? {},\n borderRadius: (mergedTokens as any).radii ?? {},\n boxShadow: (mergedTokens as any).shadows ?? {},\n fontFamily: (mergedTokens as any).typography?.families ?? {},\n };\n\n return { theme };\n}\n","import type { Config as TailwindConfig } from 'tailwindcss';\nimport plugin from 'tailwindcss/plugin';\nimport { spectreTokens } from '../tokens';\nimport { createSpectreTailwindTheme } from './theme';\n\nconst { theme } = createSpectreTailwindTheme({\n tokens: spectreTokens,\n});\n\nconst resolveTokenValue = (value: unknown, fallback?: string): string | undefined => {\n if (typeof value === 'string') {\n return value;\n }\n\n if (value && typeof value === 'object') {\n const maybeDefault = (value as Record<string, unknown>).default;\n if (typeof maybeDefault === 'string') {\n return maybeDefault;\n }\n\n const firstEntry = Object.values(value as Record<string, unknown>).find(\n (entry) => typeof entry === 'string',\n );\n if (typeof firstEntry === 'string') {\n return firstEntry;\n }\n }\n\n return fallback;\n};\n\nconst semanticUtilities = plugin(({ addUtilities }) => {\n const tokens = spectreTokens as any;\n const neutralScale = tokens?.colors?.neutral ?? {};\n const formDefault = tokens?.forms?.default ?? {};\n\n const surfaceTokens = tokens?.surface ?? {};\n const textTokens = tokens?.text ?? {};\n\n const surfacePage = resolveTokenValue(\n surfaceTokens.page,\n neutralScale['50'],\n );\n const surfaceCard = resolveTokenValue(\n surfaceTokens.card,\n formDefault.bg ?? surfacePage ?? neutralScale['50'],\n );\n const surfaceInput = resolveTokenValue(\n surfaceTokens.input,\n formDefault.bg ?? surfaceCard ?? surfacePage,\n );\n\n const textOnPage = resolveTokenValue(\n textTokens?.on?.page ?? textTokens?.onPage,\n neutralScale['900'] ?? formDefault.text,\n );\n const textOnSurface = resolveTokenValue(\n textTokens?.on?.surface ?? textTokens?.onSurface,\n formDefault.text ?? textOnPage ?? neutralScale['900'],\n );\n\n const utilities: Record<string, Record<string, string>> = {};\n\n if (surfacePage) {\n utilities['.bg-surface-page'] = { backgroundColor: surfacePage };\n }\n\n if (surfaceCard) {\n utilities['.bg-surface-card'] = { backgroundColor: surfaceCard };\n }\n\n if (surfaceInput) {\n utilities['.bg-surface-input'] = { backgroundColor: surfaceInput };\n }\n\n if (textOnPage) {\n utilities['.text-on-page'] = { color: textOnPage };\n }\n\n if (textOnSurface) {\n utilities['.text-on-surface'] = { color: textOnSurface };\n }\n\n addUtilities(utilities);\n});\n\nexport const spectrePreset: TailwindConfig = {\n // Required for Tailwind's Config type with exactOptionalPropertyTypes\n content: [],\n theme: theme ?? {},\n plugins: [semanticUtilities],\n};\n\nexport const spectreTailwindPreset: TailwindConfig = spectrePreset;\n","export type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';\nexport type ButtonSize = 'sm' | 'md' | 'lg';\nexport type ButtonTone = 'default' | 'success' | 'warning' | 'danger';\n\nexport interface ButtonRecipeOptions {\n variant?: ButtonVariant;\n size?: ButtonSize;\n tone?: ButtonTone;\n fullWidth?: boolean;\n loading?: boolean;\n disabled?: boolean;\n iconOnly?: boolean;\n}\n\n/**\n * Generate Spectre button classes.\n *\n * Rules:\n * - Base: \"sp-btn\"\n * - Variant: \"sp-btn--primary\" / \"sp-btn--secondary\" / \"sp-btn--ghost\" / \"sp-btn--danger\"\n * - default variant is \"primary\"\n * - Size: \"sp-btn--sm\" / \"sp-btn--md\" / \"sp-btn--lg\"\n * - default size is \"md\"\n * - Tone: \"sp-btn--tone-success\" / \"sp-btn--tone-warning\" / \"sp-btn--tone-danger\"\n * - default tone is \"default\" (no tone class)\n * - fullWidth: add \"sp-btn--full\"\n * - loading: add \"sp-btn--loading\"\n * - disabled: add \"sp-btn--disabled\"\n * - iconOnly: add \"sp-btn--icon\"\n *\n * Must return a single space-joined, trimmed class string.\n */\nexport function getButtonClasses(opts: ButtonRecipeOptions = {}): string {\n const {\n variant = 'primary',\n size = 'md',\n tone = 'default',\n fullWidth = false,\n loading = false,\n disabled = false,\n iconOnly = false,\n } = opts;\n\n const classes: string[] = [];\n\n // Base\n classes.push('sp-btn');\n\n // Variant\n const variantMap: Record<ButtonVariant, string> = {\n primary: 'sp-btn--primary',\n secondary: 'sp-btn--secondary',\n ghost: 'sp-btn--ghost',\n danger: 'sp-btn--danger',\n };\n classes.push(variantMap[variant]);\n\n // Size\n const sizeMap: Record<ButtonSize, string> = {\n sm: 'sp-btn--sm',\n md: 'sp-btn--md',\n lg: 'sp-btn--lg',\n };\n classes.push(sizeMap[size]);\n\n // Tone (optional)\n if (tone !== 'default') {\n const toneMap: Record<Exclude<ButtonTone, 'default'>, string> = {\n success: 'sp-btn--tone-success',\n warning: 'sp-btn--tone-warning',\n danger: 'sp-btn--tone-danger',\n };\n classes.push(toneMap[tone as Exclude<ButtonTone, 'default'>]);\n }\n\n // Flags\n if (fullWidth) classes.push('sp-btn--full');\n if (loading) classes.push('sp-btn--loading');\n if (disabled) classes.push('sp-btn--disabled');\n if (iconOnly) classes.push('sp-btn--icon');\n\n // Final class string\n return classes.filter(Boolean).join(' ').trim();\n}\n","export type CardVariant = 'elevated' | 'outline' | 'ghost';\n\nexport interface CardRecipeOptions {\n variant?: CardVariant;\n interactive?: boolean; // hover/focus styles\n padded?: boolean; // apply default padding\n fullHeight?: boolean;\n}\n\n/**\n * Generate Spectre card classes.\n *\n * Rules:\n * - Base class: \"sp-card\"\n * - Variant (default: elevated):\n * - \"sp-card--elevated\"\n * - \"sp-card--outline\"\n * - \"sp-card--ghost\"\n * - interactive: add \"sp-card--interactive\"\n * - padded: add \"sp-card--padded\"\n * - fullHeight: add \"sp-card--full\"\n */\nexport function getCardClasses(opts: CardRecipeOptions = {}): string {\n const {\n variant = 'elevated',\n interactive = false,\n padded = false,\n fullHeight = false,\n } = opts;\n\n const classes: string[] = [];\n\n // Base\n classes.push('sp-card');\n\n // Variant\n const variantMap: Record<CardVariant, string> = {\n elevated: 'sp-card--elevated',\n outline: 'sp-card--outline',\n ghost: 'sp-card--ghost',\n };\n classes.push(variantMap[variant]);\n\n // Flags\n if (interactive) classes.push('sp-card--interactive');\n if (padded) classes.push('sp-card--padded');\n if (fullHeight) classes.push('sp-card--full');\n\n return classes.filter(Boolean).join(' ').trim();\n}\n","export type InputState = 'default' | 'error' | 'success';\nexport type InputSize = 'sm' | 'md' | 'lg';\n\nexport interface InputRecipeOptions {\n state?: InputState;\n size?: InputSize;\n fullWidth?: boolean;\n}\n\n/**\n * Generate Spectre input classes.\n *\n * Rules:\n * - Base class: \"sp-input\"\n * - State:\n * - \"default\" => no state modifier\n * - \"error\" => \"sp-input--error\"\n * - \"success\" => \"sp-input--success\"\n * - Size (default: md):\n * - \"sp-input--sm\"\n * - \"sp-input--md\"\n * - \"sp-input--lg\"\n * - fullWidth: add \"sp-input--full\"\n */\nexport function getInputClasses(opts: InputRecipeOptions = {}): string {\n const {\n state = 'default',\n size = 'md',\n fullWidth = false,\n } = opts;\n\n const classes: string[] = [];\n\n // Base\n classes.push('sp-input');\n\n // State\n if (state === 'error') {\n classes.push('sp-input--error');\n } else if (state === 'success') {\n classes.push('sp-input--success');\n }\n\n // Size\n const sizeMap: Record<InputSize, string> = {\n sm: 'sp-input--sm',\n md: 'sp-input--md',\n lg: 'sp-input--lg',\n };\n classes.push(sizeMap[size]);\n\n // Flags\n if (fullWidth) {\n classes.push('sp-input--full');\n }\n\n return classes.filter(Boolean).join(' ').trim();\n}\n"]}
|
package/dist/utilities.css
CHANGED
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
|
|
15
15
|
.sp-container {
|
|
16
16
|
width: 100%;
|
|
17
|
-
max-width: var(--sp-breakpoint-xl, 1280px);
|
|
18
17
|
margin-left: auto;
|
|
19
18
|
margin-right: auto;
|
|
20
19
|
padding-left: var(--sp-space-md, 1rem);
|
|
21
20
|
padding-right: var(--sp-space-md, 1rem);
|
|
21
|
+
max-width: var(--sp-container-max-width, 72rem);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
.sp-section {
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
.sp-shadow-soft {
|
|
30
|
-
box-shadow: var(--sp-shadow-md, 0
|
|
30
|
+
box-shadow: var(--sp-shadow-md, 0 4px 10px rgba(15, 23, 42, 0.1));
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
.sp-shadow-strong {
|
|
34
|
-
box-shadow: var(--sp-shadow-lg, 0
|
|
34
|
+
box-shadow: var(--sp-shadow-lg, 0 10px 25px rgba(15, 23, 42, 0.18));
|
|
35
35
|
}
|
|
36
36
|
}
|