@arbor-css/core 0.0.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/dist/arborPreset.d.ts +344 -0
- package/dist/arborPreset.d.ts.map +1 -0
- package/dist/arborPreset.js +198 -0
- package/dist/arborPreset.js.map +1 -0
- package/dist/cli/run.d.ts +3 -0
- package/dist/cli/run.d.ts.map +1 -0
- package/dist/cli/run.js +42 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/config.d.ts +15 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +4 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/primitives/labelProps.d.ts +1 -0
- package/dist/primitives/labelProps.d.ts.map +1 -0
- package/dist/primitives/labelProps.js +2 -0
- package/dist/primitives/labelProps.js.map +1 -0
- package/dist/primitives/localProps.d.ts +1 -0
- package/dist/primitives/localProps.d.ts.map +1 -0
- package/dist/primitives/localProps.js +2 -0
- package/dist/primitives/localProps.js.map +1 -0
- package/dist/primitives/primitives.d.ts +46 -0
- package/dist/primitives/primitives.d.ts.map +1 -0
- package/dist/primitives/primitives.js +75 -0
- package/dist/primitives/primitives.js.map +1 -0
- package/dist/primitives/systemProps.d.ts +329 -0
- package/dist/primitives/systemProps.d.ts.map +1 -0
- package/dist/primitives/systemProps.js +45 -0
- package/dist/primitives/systemProps.js.map +1 -0
- package/dist/runtime/components/BaseElement.d.ts +6 -0
- package/dist/runtime/components/BaseElement.d.ts.map +1 -0
- package/dist/runtime/components/BaseElement.js +10 -0
- package/dist/runtime/components/BaseElement.js.map +1 -0
- package/dist/runtime/components/ColorRange.d.ts +2 -0
- package/dist/runtime/components/ColorRange.d.ts.map +1 -0
- package/dist/runtime/components/ColorRange.js +52 -0
- package/dist/runtime/components/ColorRange.js.map +1 -0
- package/dist/runtime/components/GlobalsEditor.d.ts +2 -0
- package/dist/runtime/components/GlobalsEditor.d.ts.map +1 -0
- package/dist/runtime/components/GlobalsEditor.js +63 -0
- package/dist/runtime/components/GlobalsEditor.js.map +1 -0
- package/dist/runtime/components/ModeSelector.d.ts +2 -0
- package/dist/runtime/components/ModeSelector.d.ts.map +1 -0
- package/dist/runtime/components/ModeSelector.js +34 -0
- package/dist/runtime/components/ModeSelector.js.map +1 -0
- package/dist/runtime/components/ModeTokenValues.d.ts +2 -0
- package/dist/runtime/components/ModeTokenValues.d.ts.map +1 -0
- package/dist/runtime/components/ModeTokenValues.js +2 -0
- package/dist/runtime/components/ModeTokenValues.js.map +1 -0
- package/dist/runtime/components/PrimitiveTokenValues.d.ts +2 -0
- package/dist/runtime/components/PrimitiveTokenValues.d.ts.map +1 -0
- package/dist/runtime/components/PrimitiveTokenValues.js +82 -0
- package/dist/runtime/components/PrimitiveTokenValues.js.map +1 -0
- package/dist/runtime/components/SchemeSelector.d.ts +2 -0
- package/dist/runtime/components/SchemeSelector.d.ts.map +1 -0
- package/dist/runtime/components/SchemeSelector.js +34 -0
- package/dist/runtime/components/SchemeSelector.js.map +1 -0
- package/dist/runtime/components/Shadows.d.ts +2 -0
- package/dist/runtime/components/Shadows.d.ts.map +1 -0
- package/dist/runtime/components/Shadows.js +27 -0
- package/dist/runtime/components/Shadows.js.map +1 -0
- package/dist/runtime/components/Spacing.d.ts +2 -0
- package/dist/runtime/components/Spacing.d.ts.map +1 -0
- package/dist/runtime/components/Spacing.js +27 -0
- package/dist/runtime/components/Spacing.js.map +1 -0
- package/dist/runtime/components/SystemDemo.d.ts +2 -0
- package/dist/runtime/components/SystemDemo.d.ts.map +1 -0
- package/dist/runtime/components/SystemDemo.js +45 -0
- package/dist/runtime/components/SystemDemo.js.map +1 -0
- package/dist/runtime/components/TokenColorValuePreview.d.ts +2 -0
- package/dist/runtime/components/TokenColorValuePreview.d.ts.map +1 -0
- package/dist/runtime/components/TokenColorValuePreview.js +12 -0
- package/dist/runtime/components/TokenColorValuePreview.js.map +1 -0
- package/dist/runtime/components/TokenFontValuesPreview.d.ts +2 -0
- package/dist/runtime/components/TokenFontValuesPreview.d.ts.map +1 -0
- package/dist/runtime/components/TokenFontValuesPreview.js +14 -0
- package/dist/runtime/components/TokenFontValuesPreview.js.map +1 -0
- package/dist/runtime/components/TokenShadowValuePreview.d.ts +2 -0
- package/dist/runtime/components/TokenShadowValuePreview.d.ts.map +1 -0
- package/dist/runtime/components/TokenShadowValuePreview.js +14 -0
- package/dist/runtime/components/TokenShadowValuePreview.js.map +1 -0
- package/dist/runtime/components/TokenSizeValuePreview.d.ts +2 -0
- package/dist/runtime/components/TokenSizeValuePreview.d.ts.map +1 -0
- package/dist/runtime/components/TokenSizeValuePreview.js +12 -0
- package/dist/runtime/components/TokenSizeValuePreview.js.map +1 -0
- package/dist/runtime/components/TokenValuePreview.d.ts +2 -0
- package/dist/runtime/components/TokenValuePreview.d.ts.map +1 -0
- package/dist/runtime/components/TokenValuePreview.js +25 -0
- package/dist/runtime/components/TokenValuePreview.js.map +1 -0
- package/dist/runtime/components/TokenValues.d.ts +2 -0
- package/dist/runtime/components/TokenValues.d.ts.map +1 -0
- package/dist/runtime/components/TokenValues.js +105 -0
- package/dist/runtime/components/TokenValues.js.map +1 -0
- package/dist/runtime/components/Typography.d.ts +2 -0
- package/dist/runtime/components/Typography.d.ts.map +1 -0
- package/dist/runtime/components/Typography.js +30 -0
- package/dist/runtime/components/Typography.js.map +1 -0
- package/dist/runtime/components/index.d.ts +11 -0
- package/dist/runtime/components/index.d.ts.map +1 -0
- package/dist/runtime/components/index.js +11 -0
- package/dist/runtime/components/index.js.map +1 -0
- package/dist/runtime/index.d.ts +3 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +3 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/readProperties.d.ts +3 -0
- package/dist/runtime/readProperties.d.ts.map +1 -0
- package/dist/runtime/readProperties.js +8 -0
- package/dist/runtime/readProperties.js.map +1 -0
- package/dist/runtime/registration.d.ts +5 -0
- package/dist/runtime/registration.d.ts.map +1 -0
- package/dist/runtime/registration.js +24 -0
- package/dist/runtime/registration.js.map +1 -0
- package/dist/runtime/tokenGroups.d.ts +24 -0
- package/dist/runtime/tokenGroups.d.ts.map +1 -0
- package/dist/runtime/tokenGroups.js +37 -0
- package/dist/runtime/tokenGroups.js.map +1 -0
- package/dist/stylesheet/generateStylesheet.d.ts +10 -0
- package/dist/stylesheet/generateStylesheet.d.ts.map +1 -0
- package/dist/stylesheet/generateStylesheet.js +109 -0
- package/dist/stylesheet/generateStylesheet.js.map +1 -0
- package/dist/util/convertStructure.d.ts +8 -0
- package/dist/util/convertStructure.d.ts.map +1 -0
- package/dist/util/convertStructure.js +30 -0
- package/dist/util/convertStructure.js.map +1 -0
- package/dist/util/flattenAndApplyTokenValues.d.ts +5 -0
- package/dist/util/flattenAndApplyTokenValues.d.ts.map +1 -0
- package/dist/util/flattenAndApplyTokenValues.js +32 -0
- package/dist/util/flattenAndApplyTokenValues.js.map +1 -0
- package/dist/util/formatObjectToCss.d.ts +2 -0
- package/dist/util/formatObjectToCss.d.ts.map +1 -0
- package/dist/util/formatObjectToCss.js +6 -0
- package/dist/util/formatObjectToCss.js.map +1 -0
- package/dist/util/printTokens.d.ts +5 -0
- package/dist/util/printTokens.d.ts.map +1 -0
- package/dist/util/printTokens.js +6 -0
- package/dist/util/printTokens.js.map +1 -0
- package/dist/util/tokenifyColors.d.ts +6 -0
- package/dist/util/tokenifyColors.d.ts.map +1 -0
- package/dist/util/tokenifyColors.js +10 -0
- package/dist/util/tokenifyColors.js.map +1 -0
- package/dist/util/tokenifyColors.test.d.ts +2 -0
- package/dist/util/tokenifyColors.test.d.ts.map +1 -0
- package/dist/util/tokenifyColors.test.js +25 -0
- package/dist/util/tokenifyColors.test.js.map +1 -0
- package/package.json +61 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from '@arbor-css/colors';
|
|
2
|
+
export { $systemProps, createGlobals, defaultGlobals, } from '@arbor-css/globals';
|
|
3
|
+
export * from '@arbor-css/modes';
|
|
4
|
+
export * from '@arbor-css/shadows';
|
|
5
|
+
export * from '@arbor-css/spacing';
|
|
6
|
+
export * from '@arbor-css/tokens';
|
|
7
|
+
export * from '@arbor-css/typography';
|
|
8
|
+
export * from './arborPreset.js';
|
|
9
|
+
export * from './config.js';
|
|
10
|
+
export * from './primitives/primitives.js';
|
|
11
|
+
export { generateStylesheet } from './stylesheet/generateStylesheet.js';
|
|
12
|
+
export { convertStructure } from './util/convertStructure.js';
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,OAAO,EACN,YAAY,EACZ,aAAa,EACb,cAAc,GAGd,MAAM,oBAAoB,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=labelProps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labelProps.d.ts","sourceRoot":"","sources":["../../src/primitives/labelProps.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labelProps.js","sourceRoot":"","sources":["../../src/primitives/labelProps.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=localProps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localProps.d.ts","sourceRoot":"","sources":["../../src/primitives/localProps.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localProps.js","sourceRoot":"","sources":["../../src/primitives/localProps.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ColorRangeItem, CompiledColors } from '@arbor-css/colors';
|
|
2
|
+
import { GlobalConfig } from '@arbor-css/globals';
|
|
3
|
+
import { CompiledShadows } from '@arbor-css/shadows';
|
|
4
|
+
import { CompiledSpacing } from '@arbor-css/spacing';
|
|
5
|
+
import { Token, TokenSchema } from '@arbor-css/tokens';
|
|
6
|
+
import { CompiledTypography } from '@arbor-css/typography';
|
|
7
|
+
export declare const defaultDefaultScheme = "light";
|
|
8
|
+
export interface PrimitivesConfig<TCompiledColors extends CompiledColors<any, any>, TCompiledTypography extends CompiledTypography<any>, TCompiledSpacing extends CompiledSpacing<any>, TCompiledShadows extends CompiledShadows<any>, TOtherTokens extends TokenSchema = TokenSchema> {
|
|
9
|
+
colors: TCompiledColors;
|
|
10
|
+
typography: TCompiledTypography;
|
|
11
|
+
spacing: TCompiledSpacing;
|
|
12
|
+
shadows: TCompiledShadows;
|
|
13
|
+
misc?: TOtherTokens;
|
|
14
|
+
defaultScheme?: keyof TCompiledColors;
|
|
15
|
+
schemeTags?: Record<string, string>;
|
|
16
|
+
globals?: Partial<GlobalConfig>;
|
|
17
|
+
}
|
|
18
|
+
type LiteralsToTokens<T extends Record<string, any>> = {
|
|
19
|
+
[K in keyof T]: T[K] extends string | number ? Token : T[K] extends Record<string, any> ? LiteralsToTokens<T[K]> : never;
|
|
20
|
+
};
|
|
21
|
+
export interface PrimitivesColorScheme {
|
|
22
|
+
[Color: string]: ColorRangeItem[];
|
|
23
|
+
}
|
|
24
|
+
export type Primitives<TCompiledColors extends CompiledColors<any, any> = CompiledColors<any, any>, TCompiledTypography extends CompiledTypography = CompiledTypography, TCompiledSpacing extends CompiledSpacing = CompiledSpacing, TCompiledShadows extends CompiledShadows = CompiledShadows, TOtherTokens extends TokenSchema = TokenSchema> = {
|
|
25
|
+
/**
|
|
26
|
+
* A map of color values, keyed by scheme name.
|
|
27
|
+
* Each entry is the same structure: a record of color name keys
|
|
28
|
+
* and string values which represent CSS colors.
|
|
29
|
+
*/
|
|
30
|
+
colors: TCompiledColors;
|
|
31
|
+
typography: TCompiledTypography;
|
|
32
|
+
spacing: TCompiledSpacing;
|
|
33
|
+
shadows: TCompiledShadows;
|
|
34
|
+
defaultScheme: keyof TCompiledColors;
|
|
35
|
+
schemeTags: Record<string, string>;
|
|
36
|
+
globals: GlobalConfig;
|
|
37
|
+
$tokens: {
|
|
38
|
+
colors: LiteralsToTokens<TCompiledColors[keyof TCompiledColors]['colors']>;
|
|
39
|
+
typography: LiteralsToTokens<TCompiledTypography['levels']>;
|
|
40
|
+
spacing: LiteralsToTokens<TCompiledSpacing['levels']>;
|
|
41
|
+
shadows: LiteralsToTokens<TCompiledShadows['levels']>;
|
|
42
|
+
} & TOtherTokens;
|
|
43
|
+
};
|
|
44
|
+
export declare function createPrimitives<TCompiledColors extends CompiledColors<any, any>, TCompiledTypography extends CompiledTypography, TCompiledSpacing extends CompiledSpacing, TCompiledShadows extends CompiledShadows, TOtherTokens extends TokenSchema>(config: PrimitivesConfig<TCompiledColors, TCompiledTypography, TCompiledSpacing, TCompiledShadows, TOtherTokens>): Primitives<TCompiledColors, TCompiledTypography, TCompiledSpacing, TCompiledShadows, TOtherTokens>;
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=primitives.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../src/primitives/primitives.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC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AAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,CACZ,GACC,UAAU,CACZ,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,CACZ,CAgGA"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { defaultGlobals } from '@arbor-css/globals';
|
|
2
|
+
import { createToken } from '@arbor-css/tokens';
|
|
3
|
+
import { isTypographyLevel } from '@arbor-css/typography';
|
|
4
|
+
import { convertStructure } from '../util/convertStructure.js';
|
|
5
|
+
export const defaultDefaultScheme = 'light';
|
|
6
|
+
export function createPrimitives(config) {
|
|
7
|
+
const { colors, defaultScheme, globals: userGlobals } = config;
|
|
8
|
+
const arbitraryScheme = Object.values(colors)[0];
|
|
9
|
+
if (!arbitraryScheme) {
|
|
10
|
+
throw new Error('At least one color scheme must be defined in primitives');
|
|
11
|
+
}
|
|
12
|
+
// TODO: validate all scheme shapes are the same...
|
|
13
|
+
const $colorProps = convertStructure(arbitraryScheme.colors, (item) => typeof item === 'string', (_, path) => createToken(path.join('-'), {
|
|
14
|
+
type: 'color',
|
|
15
|
+
purpose: 'color',
|
|
16
|
+
group: path.slice(0, -1).join('-'),
|
|
17
|
+
tag: '🎨',
|
|
18
|
+
}));
|
|
19
|
+
const $typographyProps = convertStructure(config.typography.levels, isTypographyLevel, (_, path) => ({
|
|
20
|
+
size: createToken(`typography-${path.join('-')}-size`, {
|
|
21
|
+
type: 'length',
|
|
22
|
+
purpose: 'font-size',
|
|
23
|
+
group: path.join('-'),
|
|
24
|
+
tag: '🅰️',
|
|
25
|
+
}),
|
|
26
|
+
weight: createToken(`typography-${path.join('-')}-weight`, {
|
|
27
|
+
type: '*',
|
|
28
|
+
purpose: 'font-weight',
|
|
29
|
+
group: path.join('-'),
|
|
30
|
+
tag: '🅰️',
|
|
31
|
+
}),
|
|
32
|
+
lineHeight: createToken(`typography-${path.join('-')}-line-height`, {
|
|
33
|
+
type: '*',
|
|
34
|
+
purpose: 'line-height',
|
|
35
|
+
group: path.join('-'),
|
|
36
|
+
tag: '🅰️',
|
|
37
|
+
}),
|
|
38
|
+
}));
|
|
39
|
+
const $spacingProps = convertStructure(config.spacing.levels, (value) => typeof value === 'string' || typeof value === 'number', (_, path) => createToken(`spacing-${path.join('-')}`, {
|
|
40
|
+
type: 'length',
|
|
41
|
+
purpose: 'spacing',
|
|
42
|
+
tag: 's',
|
|
43
|
+
}));
|
|
44
|
+
const $shadowProps = convertStructure(config.shadows.levels, (value) => typeof value === 'string' || typeof value === 'number', (_, path) => createToken(`shadow-${path.join('-')}`, {
|
|
45
|
+
type: '*',
|
|
46
|
+
purpose: 'shadow',
|
|
47
|
+
tag: '🌫️',
|
|
48
|
+
}));
|
|
49
|
+
const globals = {
|
|
50
|
+
...defaultGlobals,
|
|
51
|
+
...userGlobals,
|
|
52
|
+
};
|
|
53
|
+
const schemeTags = {
|
|
54
|
+
light: '☀️',
|
|
55
|
+
dark: '🌑',
|
|
56
|
+
...config.schemeTags,
|
|
57
|
+
};
|
|
58
|
+
return {
|
|
59
|
+
defaultScheme: defaultScheme ?? defaultDefaultScheme,
|
|
60
|
+
schemeTags,
|
|
61
|
+
globals,
|
|
62
|
+
colors,
|
|
63
|
+
typography: config.typography,
|
|
64
|
+
spacing: config.spacing,
|
|
65
|
+
shadows: config.shadows,
|
|
66
|
+
$tokens: {
|
|
67
|
+
...(config.misc ?? {}),
|
|
68
|
+
colors: $colorProps,
|
|
69
|
+
typography: $typographyProps,
|
|
70
|
+
spacing: $spacingProps,
|
|
71
|
+
shadows: $shadowProps,
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=primitives.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitives.js","sourceRoot":"","sources":["../../src/primitives/primitives.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAgB,MAAM,oBAAoB,CAAC;AAGlE,OAAO,EAAE,WAA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AK;KACV,CAAC,CACH,CAAC;IAEF,MAAM,OAAO,GAAiB;QAC7B,GAAG,cAAc;QACjB,GAAG,WAAW;KACd,CAAC;IAEF,MAAM,UAAU,GAAG;QAClB,KAAK,EAAE,IAAI;QACX,IAAI,EAAE,IAAI;QACV,GAAG,MAAM,CAAC,UAAU;KACpB,CAAC;IAEF,OAAO;QACN,aAAa,EAAE,aAAa,IAAI,oBAAoB;QACpD,UAAU;QACV,OAAO;QACP,MAAM;QACN,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,OAAO,EAAE;YACR,GAAG,CAAC,MAAM,CAAC,IAAI,IAAK,EAAmB,CAAC;YACxC,MAAM,EAAE,WAAW;YACnB,UAAU,EAAE,gBAAgB;YAC5B,OAAO,EAAE,aAAa;YACtB,OAAO,EAAE,YAAY;SACrB;KACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
export declare const $labelProps: {
|
|
2
|
+
mode: {
|
|
3
|
+
"@@TOKEN@@": true;
|
|
4
|
+
name: string;
|
|
5
|
+
type: import("@arbor-css/tokens").PropertyType;
|
|
6
|
+
fallback: string | number | undefined;
|
|
7
|
+
var: string;
|
|
8
|
+
varFallback: (fallbackOverride?: string | number) => string;
|
|
9
|
+
assign: (value?: string | number) => string;
|
|
10
|
+
definition: string;
|
|
11
|
+
suffixed: (suffix: string) => /*elided*/ any;
|
|
12
|
+
prefixed: (prefix: string) => /*elided*/ any;
|
|
13
|
+
};
|
|
14
|
+
scheme: {
|
|
15
|
+
"@@TOKEN@@": true;
|
|
16
|
+
name: string;
|
|
17
|
+
type: import("@arbor-css/tokens").PropertyType;
|
|
18
|
+
fallback: string | number | undefined;
|
|
19
|
+
var: string;
|
|
20
|
+
varFallback: (fallbackOverride?: string | number) => string;
|
|
21
|
+
assign: (value?: string | number) => string;
|
|
22
|
+
definition: string;
|
|
23
|
+
suffixed: (suffix: string) => /*elided*/ any;
|
|
24
|
+
prefixed: (prefix: string) => /*elided*/ any;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export declare const $systemProps: {
|
|
28
|
+
labels: {
|
|
29
|
+
mode: {
|
|
30
|
+
"@@TOKEN@@": true;
|
|
31
|
+
name: string;
|
|
32
|
+
type: import("@arbor-css/tokens").PropertyType;
|
|
33
|
+
fallback: string | number | undefined;
|
|
34
|
+
var: string;
|
|
35
|
+
varFallback: (fallbackOverride?: string | number) => string;
|
|
36
|
+
assign: (value?: string | number) => string;
|
|
37
|
+
definition: string;
|
|
38
|
+
suffixed: (suffix: string) => /*elided*/ any;
|
|
39
|
+
prefixed: (prefix: string) => /*elided*/ any;
|
|
40
|
+
};
|
|
41
|
+
scheme: {
|
|
42
|
+
"@@TOKEN@@": true;
|
|
43
|
+
name: string;
|
|
44
|
+
type: import("@arbor-css/tokens").PropertyType;
|
|
45
|
+
fallback: string | number | undefined;
|
|
46
|
+
var: string;
|
|
47
|
+
varFallback: (fallbackOverride?: string | number) => string;
|
|
48
|
+
assign: (value?: string | number) => string;
|
|
49
|
+
definition: string;
|
|
50
|
+
suffixed: (suffix: string) => /*elided*/ any;
|
|
51
|
+
prefixed: (prefix: string) => /*elided*/ any;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
fg: {
|
|
55
|
+
applied: {
|
|
56
|
+
"@@TOKEN@@": true;
|
|
57
|
+
name: string;
|
|
58
|
+
type: import("@arbor-css/tokens").PropertyType;
|
|
59
|
+
fallback: string | number | undefined;
|
|
60
|
+
var: string;
|
|
61
|
+
varFallback: (fallbackOverride?: string | number) => string;
|
|
62
|
+
assign: (value?: string | number) => string;
|
|
63
|
+
definition: string;
|
|
64
|
+
suffixed: (suffix: string) => /*elided*/ any;
|
|
65
|
+
prefixed: (prefix: string) => /*elided*/ any;
|
|
66
|
+
};
|
|
67
|
+
opacity: {
|
|
68
|
+
"@@TOKEN@@": true;
|
|
69
|
+
name: string;
|
|
70
|
+
type: import("@arbor-css/tokens").PropertyType;
|
|
71
|
+
fallback: string | number | undefined;
|
|
72
|
+
var: string;
|
|
73
|
+
varFallback: (fallbackOverride?: string | number) => string;
|
|
74
|
+
assign: (value?: string | number) => string;
|
|
75
|
+
definition: string;
|
|
76
|
+
suffixed: (suffix: string) => /*elided*/ any;
|
|
77
|
+
prefixed: (prefix: string) => /*elided*/ any;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
bg: {
|
|
81
|
+
applied: {
|
|
82
|
+
"@@TOKEN@@": true;
|
|
83
|
+
name: string;
|
|
84
|
+
type: import("@arbor-css/tokens").PropertyType;
|
|
85
|
+
fallback: string | number | undefined;
|
|
86
|
+
var: string;
|
|
87
|
+
varFallback: (fallbackOverride?: string | number) => string;
|
|
88
|
+
assign: (value?: string | number) => string;
|
|
89
|
+
definition: string;
|
|
90
|
+
suffixed: (suffix: string) => /*elided*/ any;
|
|
91
|
+
prefixed: (prefix: string) => /*elided*/ any;
|
|
92
|
+
};
|
|
93
|
+
opacity: {
|
|
94
|
+
"@@TOKEN@@": true;
|
|
95
|
+
name: string;
|
|
96
|
+
type: import("@arbor-css/tokens").PropertyType;
|
|
97
|
+
fallback: string | number | undefined;
|
|
98
|
+
var: string;
|
|
99
|
+
varFallback: (fallbackOverride?: string | number) => string;
|
|
100
|
+
assign: (value?: string | number) => string;
|
|
101
|
+
definition: string;
|
|
102
|
+
suffixed: (suffix: string) => /*elided*/ any;
|
|
103
|
+
prefixed: (prefix: string) => /*elided*/ any;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
borderColor: {
|
|
107
|
+
all: {
|
|
108
|
+
applied: {
|
|
109
|
+
"@@TOKEN@@": true;
|
|
110
|
+
name: string;
|
|
111
|
+
type: import("@arbor-css/tokens").PropertyType;
|
|
112
|
+
fallback: string | number | undefined;
|
|
113
|
+
var: string;
|
|
114
|
+
varFallback: (fallbackOverride?: string | number) => string;
|
|
115
|
+
assign: (value?: string | number) => string;
|
|
116
|
+
definition: string;
|
|
117
|
+
suffixed: (suffix: string) => /*elided*/ any;
|
|
118
|
+
prefixed: (prefix: string) => /*elided*/ any;
|
|
119
|
+
};
|
|
120
|
+
opacity: {
|
|
121
|
+
"@@TOKEN@@": true;
|
|
122
|
+
name: string;
|
|
123
|
+
type: import("@arbor-css/tokens").PropertyType;
|
|
124
|
+
fallback: string | number | undefined;
|
|
125
|
+
var: string;
|
|
126
|
+
varFallback: (fallbackOverride?: string | number) => string;
|
|
127
|
+
assign: (value?: string | number) => string;
|
|
128
|
+
definition: string;
|
|
129
|
+
suffixed: (suffix: string) => /*elided*/ any;
|
|
130
|
+
prefixed: (prefix: string) => /*elided*/ any;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
top: {
|
|
134
|
+
applied: {
|
|
135
|
+
"@@TOKEN@@": true;
|
|
136
|
+
name: string;
|
|
137
|
+
type: import("@arbor-css/tokens").PropertyType;
|
|
138
|
+
fallback: string | number | undefined;
|
|
139
|
+
var: string;
|
|
140
|
+
varFallback: (fallbackOverride?: string | number) => string;
|
|
141
|
+
assign: (value?: string | number) => string;
|
|
142
|
+
definition: string;
|
|
143
|
+
suffixed: (suffix: string) => /*elided*/ any;
|
|
144
|
+
prefixed: (prefix: string) => /*elided*/ any;
|
|
145
|
+
};
|
|
146
|
+
opacity: {
|
|
147
|
+
"@@TOKEN@@": true;
|
|
148
|
+
name: string;
|
|
149
|
+
type: import("@arbor-css/tokens").PropertyType;
|
|
150
|
+
fallback: string | number | undefined;
|
|
151
|
+
var: string;
|
|
152
|
+
varFallback: (fallbackOverride?: string | number) => string;
|
|
153
|
+
assign: (value?: string | number) => string;
|
|
154
|
+
definition: string;
|
|
155
|
+
suffixed: (suffix: string) => /*elided*/ any;
|
|
156
|
+
prefixed: (prefix: string) => /*elided*/ any;
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
right: {
|
|
160
|
+
applied: {
|
|
161
|
+
"@@TOKEN@@": true;
|
|
162
|
+
name: string;
|
|
163
|
+
type: import("@arbor-css/tokens").PropertyType;
|
|
164
|
+
fallback: string | number | undefined;
|
|
165
|
+
var: string;
|
|
166
|
+
varFallback: (fallbackOverride?: string | number) => string;
|
|
167
|
+
assign: (value?: string | number) => string;
|
|
168
|
+
definition: string;
|
|
169
|
+
suffixed: (suffix: string) => /*elided*/ any;
|
|
170
|
+
prefixed: (prefix: string) => /*elided*/ any;
|
|
171
|
+
};
|
|
172
|
+
opacity: {
|
|
173
|
+
"@@TOKEN@@": true;
|
|
174
|
+
name: string;
|
|
175
|
+
type: import("@arbor-css/tokens").PropertyType;
|
|
176
|
+
fallback: string | number | undefined;
|
|
177
|
+
var: string;
|
|
178
|
+
varFallback: (fallbackOverride?: string | number) => string;
|
|
179
|
+
assign: (value?: string | number) => string;
|
|
180
|
+
definition: string;
|
|
181
|
+
suffixed: (suffix: string) => /*elided*/ any;
|
|
182
|
+
prefixed: (prefix: string) => /*elided*/ any;
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
bottom: {
|
|
186
|
+
applied: {
|
|
187
|
+
"@@TOKEN@@": true;
|
|
188
|
+
name: string;
|
|
189
|
+
type: import("@arbor-css/tokens").PropertyType;
|
|
190
|
+
fallback: string | number | undefined;
|
|
191
|
+
var: string;
|
|
192
|
+
varFallback: (fallbackOverride?: string | number) => string;
|
|
193
|
+
assign: (value?: string | number) => string;
|
|
194
|
+
definition: string;
|
|
195
|
+
suffixed: (suffix: string) => /*elided*/ any;
|
|
196
|
+
prefixed: (prefix: string) => /*elided*/ any;
|
|
197
|
+
};
|
|
198
|
+
opacity: {
|
|
199
|
+
"@@TOKEN@@": true;
|
|
200
|
+
name: string;
|
|
201
|
+
type: import("@arbor-css/tokens").PropertyType;
|
|
202
|
+
fallback: string | number | undefined;
|
|
203
|
+
var: string;
|
|
204
|
+
varFallback: (fallbackOverride?: string | number) => string;
|
|
205
|
+
assign: (value?: string | number) => string;
|
|
206
|
+
definition: string;
|
|
207
|
+
suffixed: (suffix: string) => /*elided*/ any;
|
|
208
|
+
prefixed: (prefix: string) => /*elided*/ any;
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
left: {
|
|
212
|
+
applied: {
|
|
213
|
+
"@@TOKEN@@": true;
|
|
214
|
+
name: string;
|
|
215
|
+
type: import("@arbor-css/tokens").PropertyType;
|
|
216
|
+
fallback: string | number | undefined;
|
|
217
|
+
var: string;
|
|
218
|
+
varFallback: (fallbackOverride?: string | number) => string;
|
|
219
|
+
assign: (value?: string | number) => string;
|
|
220
|
+
definition: string;
|
|
221
|
+
suffixed: (suffix: string) => /*elided*/ any;
|
|
222
|
+
prefixed: (prefix: string) => /*elided*/ any;
|
|
223
|
+
};
|
|
224
|
+
opacity: {
|
|
225
|
+
"@@TOKEN@@": true;
|
|
226
|
+
name: string;
|
|
227
|
+
type: import("@arbor-css/tokens").PropertyType;
|
|
228
|
+
fallback: string | number | undefined;
|
|
229
|
+
var: string;
|
|
230
|
+
varFallback: (fallbackOverride?: string | number) => string;
|
|
231
|
+
assign: (value?: string | number) => string;
|
|
232
|
+
definition: string;
|
|
233
|
+
suffixed: (suffix: string) => /*elided*/ any;
|
|
234
|
+
prefixed: (prefix: string) => /*elided*/ any;
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
};
|
|
238
|
+
ring: {
|
|
239
|
+
target: {
|
|
240
|
+
"@@TOKEN@@": true;
|
|
241
|
+
name: string;
|
|
242
|
+
type: import("@arbor-css/tokens").PropertyType;
|
|
243
|
+
fallback: string | number | undefined;
|
|
244
|
+
var: string;
|
|
245
|
+
varFallback: (fallbackOverride?: string | number) => string;
|
|
246
|
+
assign: (value?: string | number) => string;
|
|
247
|
+
definition: string;
|
|
248
|
+
suffixed: (suffix: string) => /*elided*/ any;
|
|
249
|
+
prefixed: (prefix: string) => /*elided*/ any;
|
|
250
|
+
};
|
|
251
|
+
applied: {
|
|
252
|
+
"@@TOKEN@@": true;
|
|
253
|
+
name: string;
|
|
254
|
+
type: import("@arbor-css/tokens").PropertyType;
|
|
255
|
+
fallback: string | number | undefined;
|
|
256
|
+
var: string;
|
|
257
|
+
varFallback: (fallbackOverride?: string | number) => string;
|
|
258
|
+
assign: (value?: string | number) => string;
|
|
259
|
+
definition: string;
|
|
260
|
+
suffixed: (suffix: string) => /*elided*/ any;
|
|
261
|
+
prefixed: (prefix: string) => /*elided*/ any;
|
|
262
|
+
};
|
|
263
|
+
opacity: {
|
|
264
|
+
"@@TOKEN@@": true;
|
|
265
|
+
name: string;
|
|
266
|
+
type: import("@arbor-css/tokens").PropertyType;
|
|
267
|
+
fallback: string | number | undefined;
|
|
268
|
+
var: string;
|
|
269
|
+
varFallback: (fallbackOverride?: string | number) => string;
|
|
270
|
+
assign: (value?: string | number) => string;
|
|
271
|
+
definition: string;
|
|
272
|
+
suffixed: (suffix: string) => /*elided*/ any;
|
|
273
|
+
prefixed: (prefix: string) => /*elided*/ any;
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
placeholder: {
|
|
277
|
+
applied: {
|
|
278
|
+
"@@TOKEN@@": true;
|
|
279
|
+
name: string;
|
|
280
|
+
type: import("@arbor-css/tokens").PropertyType;
|
|
281
|
+
fallback: string | number | undefined;
|
|
282
|
+
var: string;
|
|
283
|
+
varFallback: (fallbackOverride?: string | number) => string;
|
|
284
|
+
assign: (value?: string | number) => string;
|
|
285
|
+
definition: string;
|
|
286
|
+
suffixed: (suffix: string) => /*elided*/ any;
|
|
287
|
+
prefixed: (prefix: string) => /*elided*/ any;
|
|
288
|
+
};
|
|
289
|
+
opacity: {
|
|
290
|
+
"@@TOKEN@@": true;
|
|
291
|
+
name: string;
|
|
292
|
+
type: import("@arbor-css/tokens").PropertyType;
|
|
293
|
+
fallback: string | number | undefined;
|
|
294
|
+
var: string;
|
|
295
|
+
varFallback: (fallbackOverride?: string | number) => string;
|
|
296
|
+
assign: (value?: string | number) => string;
|
|
297
|
+
definition: string;
|
|
298
|
+
suffixed: (suffix: string) => /*elided*/ any;
|
|
299
|
+
prefixed: (prefix: string) => /*elided*/ any;
|
|
300
|
+
};
|
|
301
|
+
};
|
|
302
|
+
accent: {
|
|
303
|
+
applied: {
|
|
304
|
+
"@@TOKEN@@": true;
|
|
305
|
+
name: string;
|
|
306
|
+
type: import("@arbor-css/tokens").PropertyType;
|
|
307
|
+
fallback: string | number | undefined;
|
|
308
|
+
var: string;
|
|
309
|
+
varFallback: (fallbackOverride?: string | number) => string;
|
|
310
|
+
assign: (value?: string | number) => string;
|
|
311
|
+
definition: string;
|
|
312
|
+
suffixed: (suffix: string) => /*elided*/ any;
|
|
313
|
+
prefixed: (prefix: string) => /*elided*/ any;
|
|
314
|
+
};
|
|
315
|
+
opacity: {
|
|
316
|
+
"@@TOKEN@@": true;
|
|
317
|
+
name: string;
|
|
318
|
+
type: import("@arbor-css/tokens").PropertyType;
|
|
319
|
+
fallback: string | number | undefined;
|
|
320
|
+
var: string;
|
|
321
|
+
varFallback: (fallbackOverride?: string | number) => string;
|
|
322
|
+
assign: (value?: string | number) => string;
|
|
323
|
+
definition: string;
|
|
324
|
+
suffixed: (suffix: string) => /*elided*/ any;
|
|
325
|
+
prefixed: (prefix: string) => /*elided*/ any;
|
|
326
|
+
};
|
|
327
|
+
};
|
|
328
|
+
};
|
|
329
|
+
//# sourceMappingURL=systemProps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"systemProps.d.ts","sourceRoot":"","sources":["../../src/primitives/systemProps.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;CAGvB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyBxB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { createToken } from '@arbor-css/tokens';
|
|
2
|
+
export const $labelProps = {
|
|
3
|
+
mode: createToken('ℹ️-mode', { type: 'string' }),
|
|
4
|
+
scheme: createToken('ℹ️-scheme', { type: 'string' }),
|
|
5
|
+
};
|
|
6
|
+
export const $systemProps = {
|
|
7
|
+
labels: $labelProps,
|
|
8
|
+
// System color tokens are well-known properties you can
|
|
9
|
+
// assign colors to which are used by util classes for
|
|
10
|
+
// color mixing and other things...
|
|
11
|
+
// TODO: move these to `classes`? Not sure they're relevant
|
|
12
|
+
// outside that package.
|
|
13
|
+
fg: makeSystemColorTokens('fg'),
|
|
14
|
+
bg: makeSystemColorTokens('bg'),
|
|
15
|
+
borderColor: {
|
|
16
|
+
all: makeSystemColorTokens('borderColor-all'),
|
|
17
|
+
top: makeSystemColorTokens('borderColor-top'),
|
|
18
|
+
right: makeSystemColorTokens('borderColor-right'),
|
|
19
|
+
bottom: makeSystemColorTokens('borderColor-bottom'),
|
|
20
|
+
left: makeSystemColorTokens('borderColor-left'),
|
|
21
|
+
},
|
|
22
|
+
ring: {
|
|
23
|
+
...makeSystemColorTokens('ring'),
|
|
24
|
+
target: createToken(`💲-ring-target`, {
|
|
25
|
+
type: 'color',
|
|
26
|
+
inherits: false,
|
|
27
|
+
}),
|
|
28
|
+
},
|
|
29
|
+
placeholder: makeSystemColorTokens('placeholder'),
|
|
30
|
+
accent: makeSystemColorTokens('accent'),
|
|
31
|
+
};
|
|
32
|
+
function makeSystemColorTokens(name) {
|
|
33
|
+
return {
|
|
34
|
+
applied: createToken(`💲-${name}`, {
|
|
35
|
+
type: 'color',
|
|
36
|
+
inherits: true,
|
|
37
|
+
}),
|
|
38
|
+
opacity: createToken(`💲-${name}-op`, {
|
|
39
|
+
type: 'number',
|
|
40
|
+
inherits: false,
|
|
41
|
+
fallback: '100%',
|
|
42
|
+
}),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=systemProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"systemProps.js","sourceRoot":"","sources":["../../src/primitives/systemProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,CAAC,MAAM,WAAW,GAAG;IAC1B,IAAI,EAAE,WAAW,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IAChD,MAAM,EAAE,WAAW,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;CACpD,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC3B,MAAM,EAAE,WAAW;IACnB,wDAAwD;IACxD,sDAAsD;IACtD,mCAAmC;IACnC,2DAA2D;IAC3D,wBAAwB;IACxB,EAAE,EAAE,qBAAqB,CAAC,IAAI,CAAC;IAC/B,EAAE,EAAE,qBAAqB,CAAC,IAAI,CAAC;IAC/B,WAAW,EAAE;QACZ,GAAG,EAAE,qBAAqB,CAAC,iBAAiB,CAAC;QAC7C,GAAG,EAAE,qBAAqB,CAAC,iBAAiB,CAAC;QAC7C,KAAK,EAAE,qBAAqB,CAAC,mBAAmB,CAAC;QACjD,MAAM,EAAE,qBAAqB,CAAC,oBAAoB,CAAC;QACnD,IAAI,EAAE,qBAAqB,CAAC,kBAAkB,CAAC;KAC/C;IACD,IAAI,EAAE;QACL,GAAG,qBAAqB,CAAC,MAAM,CAAC;QAChC,MAAM,EAAE,WAAW,CAAC,gBAAgB,EAAE;YACrC,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,KAAK;SACf,CAAC;KACF;IACD,WAAW,EAAE,qBAAqB,CAAC,aAAa,CAAC;IACjD,MAAM,EAAE,qBAAqB,CAAC,QAAQ,CAAC;CACvC,CAAC;AAEF,SAAS,qBAAqB,CAAC,IAAY;IAC1C,OAAO;QACN,OAAO,EAAE,WAAW,CAAC,MAAM,IAAI,EAAE,EAAE;YAClC,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,IAAI;SACd,CAAC;QACF,OAAO,EAAE,WAAW,CAAC,MAAM,IAAI,KAAK,EAAE;YACrC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,QAAQ,EAAE,MAAM;SAChB,CAAC;KACF,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare class ArborElement extends HTMLElement {
|
|
2
|
+
shadowRoot: ShadowRoot;
|
|
3
|
+
config: import("../../config.js").ArborConfig<any, import("@arbor-css/colors").CompiledColors<any, any>, import("@arbor-css/typography").CompiledTypography<any>, import("@arbor-css/spacing").CompiledSpacing<any>, import("@arbor-css/shadows").CompiledShadows<any>, import("@arbor-css/tokens").TokenSchema>;
|
|
4
|
+
constructor();
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=BaseElement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseElement.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/BaseElement.ts"],"names":[],"mappings":"AAEA,qBAAa,YAAa,SAAQ,WAAW;IAC5C,UAAU,EAAG,UAAU,CAAC;IACxB,MAAM,2SAAe;;CAMrB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { getConfig, getStyleSheet } from '../registration.js';
|
|
2
|
+
export class ArborElement extends HTMLElement {
|
|
3
|
+
constructor() {
|
|
4
|
+
super();
|
|
5
|
+
this.config = getConfig();
|
|
6
|
+
this.attachShadow({ mode: 'open' });
|
|
7
|
+
this.shadowRoot.adoptedStyleSheets.push(getStyleSheet());
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=BaseElement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseElement.js","sourceRoot":"","sources":["../../../src/runtime/components/BaseElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAE9D,MAAM,OAAO,YAAa,SAAQ,WAAW;IAG5C;QACC,KAAK,EAAE,CAAC;QAFT,WAAM,GAAG,SAAS,EAAE,CAAC;QAGpB,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;QACpC,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;IAC1D,CAAC;CACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorRange.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/ColorRange.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { getContrastColor } from '@arbor-css/colors';
|
|
2
|
+
import { isToken } from '@arbor-css/tokens';
|
|
3
|
+
import { getConfig } from '../registration.js';
|
|
4
|
+
class ColorRange extends HTMLElement {
|
|
5
|
+
constructor() {
|
|
6
|
+
super();
|
|
7
|
+
const colorName = this.getAttribute('color');
|
|
8
|
+
if (!colorName) {
|
|
9
|
+
throw new Error('ColorRange component requires a "color" attribute.');
|
|
10
|
+
}
|
|
11
|
+
const config = getConfig();
|
|
12
|
+
const colorRange = config.primitives.$tokens.colors[colorName];
|
|
13
|
+
if (!colorRange) {
|
|
14
|
+
throw new Error(`Color "${colorName}" not found in configuration.`);
|
|
15
|
+
}
|
|
16
|
+
if (isToken(colorRange)) {
|
|
17
|
+
throw new Error(`Color "${colorName}" is not a valid color range (it's an individual token)`);
|
|
18
|
+
}
|
|
19
|
+
this.attachShadow({ mode: 'closed' }).innerHTML = `
|
|
20
|
+
<div class="range-wrapper">
|
|
21
|
+
<h2>${colorName}</h2>
|
|
22
|
+
<div class="range">
|
|
23
|
+
${Object.keys(colorRange)
|
|
24
|
+
.map((key) => {
|
|
25
|
+
const color = colorRange[key];
|
|
26
|
+
if (!isToken(color)) {
|
|
27
|
+
// ignore
|
|
28
|
+
return '';
|
|
29
|
+
}
|
|
30
|
+
const value = color.var;
|
|
31
|
+
return `<div class="color" style="background-color: ${value}; color: ${getContrastColor(value)}">
|
|
32
|
+
<div>${key}</div>
|
|
33
|
+
</div>`;
|
|
34
|
+
})
|
|
35
|
+
.join('\n')}
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
<style>
|
|
39
|
+
.range {
|
|
40
|
+
display: flex;
|
|
41
|
+
}
|
|
42
|
+
.color {
|
|
43
|
+
flex: 1;
|
|
44
|
+
text-align: center;
|
|
45
|
+
padding: 1rem;
|
|
46
|
+
}
|
|
47
|
+
</style>
|
|
48
|
+
`;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
customElements.define('arbor-color-range', ColorRange);
|
|
52
|
+
//# sourceMappingURL=ColorRange.js.map
|