@travelallfly/ui 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +16 -10
- package/dist/{chunk-6FRP4Q2K.js → chunk-C6EI7GYY.js} +6 -3
- package/dist/{chunk-LGGVSGQF.cjs → chunk-HX7N52DB.cjs} +18 -15
- package/dist/{chunk-NRXCNNTQ.cjs → chunk-JH4ANRE2.cjs} +14 -11
- package/dist/{chunk-55LHKHCP.js → chunk-NSDKLLVT.js} +18 -15
- package/dist/index.cjs +5 -3
- package/dist/index.js +5 -3
- package/dist/tailwind-preset.cjs +12 -12
- package/dist/tailwind-preset.js +2 -2
- package/dist/tokens.cjs +3 -3
- package/dist/tokens.css +13 -2
- package/dist/tokens.d.cts +15 -5
- package/dist/tokens.d.ts +15 -5
- package/dist/tokens.js +2 -2
- package/dist/utils.cjs +5 -5
- package/dist/utils.js +1 -1
- package/package.json +2 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AllFly
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -50,23 +50,22 @@ The group stays in the class name (`text-text-primary`, not `text-primary`) beca
|
|
|
50
50
|
|
|
51
51
|
Every colour role has a light and a dark value. `tokens.css` sets the light values on `:root` and overrides the roles under a `dark` class, so an app switches theme by adding or removing `dark` on `<html>`. Components need no `dark:` classes. Primitives are the same in both themes.
|
|
52
52
|
|
|
53
|
-
Dark values live in `colorRolesDark` in `src/tokens/tokens.ts`. A value is either a primitive (`warm/900`), a primitive with an opacity (
|
|
53
|
+
Dark values live in `colorRolesDark` in `src/tokens/tokens.ts`. A value is either a primitive (`warm/900`), a primitive or hex with an opacity (`#0A0908@72`, the dark scrim) or a hex where Figma's dark mode uses a colour that has no swatch on the Foundations page.
|
|
54
54
|
|
|
55
55
|
"System" is not a third theme: the app resolves it to light or dark and applies that.
|
|
56
56
|
|
|
57
57
|
### Where the values came from
|
|
58
58
|
|
|
59
|
-
- **Light roles, primitives, type, spacing, radius**: read from the layer names on the Figma Foundations page, which carry each token's name and value.
|
|
60
|
-
- **Dark roles**:
|
|
61
|
-
- **Focus ring**: measured on the
|
|
59
|
+
- **Light roles, primitives, type, spacing, radius**: read from the layer names on the Figma Foundations page, which carry each token's name and value. `bg/image-dim` is transparent in light, written as its dark colour at 0%.
|
|
60
|
+
- **Dark roles**: the "Foundations / Dark colours" page in Figma, which lists each role with its dark and light value (spec v2.1).
|
|
61
|
+
- **Focus ring**: measured on the "Dark mode / Library check" page (4px, action blue at 30%).
|
|
62
|
+
- **Shadows, button sizing and the Eyebrow style**: given by design in writing. Raised has no shadow in dark, because the lighter surface does the lifting; `tokens.css` overrides the shadow variables under `dark` for this.
|
|
62
63
|
|
|
63
64
|
### Values to confirm with design
|
|
64
65
|
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
- The
|
|
68
|
-
- The letter spacing of the Eyebrow text style (currently 0.08em).
|
|
69
|
-
- Button padding and label weight.
|
|
66
|
+
- The dark value of `border/selected`. It is not on the dark colours page and currently reuses `border/focus`. It is listed in `darkRolesUnverified` and marked in Storybook. `border/ink` is not on that page either; its dark value was read from the library check page.
|
|
67
|
+
- The light values of `bg/raised`, `bg/image-dim`, `bg/art-cream` and `border/feature`. They are not on the light Foundations page; the values used are the Light column of the dark colours page, which marks them as having no light token in the spec.
|
|
68
|
+
- The `type/events/*` colours, marked PROPOSED in Figma. They are not in this package.
|
|
70
69
|
|
|
71
70
|
Replace all of the above with an export of the Figma variables when one is available.
|
|
72
71
|
|
|
@@ -152,7 +151,14 @@ There are no deploy, hotfix or promote workflows, because this package is not de
|
|
|
152
151
|
|
|
153
152
|
When a new component is added, render it in both fixture pages so it is covered.
|
|
154
153
|
|
|
154
|
+
## Icons
|
|
155
|
+
|
|
156
|
+
The icons are Lucide: 24 grid, 2px stroke, round ends, never filled, at sizes 16, 20 and 24. Design is checking the 46 icons in Figma against Lucide names and will export any that have no match.
|
|
157
|
+
|
|
158
|
+
## Licence
|
|
159
|
+
|
|
160
|
+
MIT, see [LICENSE](LICENSE). The package contains code and token values only. The Figma file and its assets are not part of it and stay private.
|
|
161
|
+
|
|
155
162
|
## Open decisions
|
|
156
163
|
|
|
157
164
|
- Where Storybook is hosted, and whether pull requests get preview builds. It is not hosted yet.
|
|
158
|
-
- Whether the 46 icons in Figma are Lucide or a custom set.
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
primitives,
|
|
7
7
|
radius,
|
|
8
8
|
spacing
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NSDKLLVT.js";
|
|
10
10
|
|
|
11
11
|
// src/tokens/css.ts
|
|
12
12
|
var prefix = "af";
|
|
@@ -32,7 +32,7 @@ function splitAlpha(ref) {
|
|
|
32
32
|
const [base, alpha] = ref.split("@");
|
|
33
33
|
if (alpha === void 0) return { base, alpha: null };
|
|
34
34
|
const percent = Number(alpha);
|
|
35
|
-
if (!Number.isInteger(percent) || percent <
|
|
35
|
+
if (!Number.isInteger(percent) || percent < 0 || percent > 99) throw new Error(`Bad opacity in "${ref}"`);
|
|
36
36
|
return { base, alpha: percent };
|
|
37
37
|
}
|
|
38
38
|
function resolveColor(ref) {
|
|
@@ -79,7 +79,10 @@ function renderTokensCss() {
|
|
|
79
79
|
const indent = (lines) => lines.map((line) => ` ${line}`).join("\n");
|
|
80
80
|
const body = [["color-scheme: light;"], ...groups].map(indent).join("\n\n");
|
|
81
81
|
const darkLines = roles.map((role) => ({ light: role, dark: darkRoleFor(role.name) })).filter(({ light, dark }) => light.ref !== dark.ref).map(({ dark }) => `${cssVarName(dark.name)}: ${colorValue(dark.ref)};`);
|
|
82
|
-
const
|
|
82
|
+
const darkElevation = Object.entries(elevation).flatMap(
|
|
83
|
+
([key, item]) => item.dark === void 0 ? [] : [`${cssVarName(`elevation-${key}`)}: ${item.dark};`]
|
|
84
|
+
);
|
|
85
|
+
const darkBody = [["color-scheme: dark;"], darkLines, darkElevation].map(indent).join("\n\n");
|
|
83
86
|
return `:root {
|
|
84
87
|
${body}
|
|
85
88
|
}
|
|
@@ -61,7 +61,10 @@ var colorRoles = {
|
|
|
61
61
|
"action-hover": "blue/600",
|
|
62
62
|
"action-pressed": "blue/700",
|
|
63
63
|
inverse: "warm/900",
|
|
64
|
-
scrim: "warm/900@60"
|
|
64
|
+
scrim: "warm/900@60",
|
|
65
|
+
raised: "warm/0",
|
|
66
|
+
"image-dim": "#151310@0",
|
|
67
|
+
"art-cream": "#FDEBD5"
|
|
65
68
|
},
|
|
66
69
|
text: {
|
|
67
70
|
primary: "warm/900",
|
|
@@ -80,7 +83,8 @@ var colorRoles = {
|
|
|
80
83
|
control: "warm/400",
|
|
81
84
|
focus: "blue/500",
|
|
82
85
|
selected: "blue/500",
|
|
83
|
-
ink: "warm/900"
|
|
86
|
+
ink: "warm/900",
|
|
87
|
+
feature: "blue/900"
|
|
84
88
|
},
|
|
85
89
|
status: {
|
|
86
90
|
success: { fill: "palm/50", text: "palm/700", border: "palm/500" },
|
|
@@ -108,7 +112,10 @@ var colorRolesDark = {
|
|
|
108
112
|
"action-hover": "blue/600",
|
|
109
113
|
"action-pressed": "blue/700",
|
|
110
114
|
inverse: "warm/100",
|
|
111
|
-
scrim: "
|
|
115
|
+
scrim: "#0A0908@72",
|
|
116
|
+
raised: "#2E2A26",
|
|
117
|
+
"image-dim": "#151310@10",
|
|
118
|
+
"art-cream": "#FDEBD5"
|
|
112
119
|
},
|
|
113
120
|
text: {
|
|
114
121
|
primary: "warm/100",
|
|
@@ -127,7 +134,8 @@ var colorRolesDark = {
|
|
|
127
134
|
control: "#857C70",
|
|
128
135
|
focus: "blue/300",
|
|
129
136
|
selected: "blue/300",
|
|
130
|
-
ink: "warm/100"
|
|
137
|
+
ink: "warm/100",
|
|
138
|
+
feature: "#1E3A70"
|
|
131
139
|
},
|
|
132
140
|
status: {
|
|
133
141
|
success: { fill: "#13291F", text: "#86D3B2", border: "#3DB489" },
|
|
@@ -143,14 +151,7 @@ var colorRolesDark = {
|
|
|
143
151
|
rail: { tint: "#13291F", ink: "#7CCCAD", accent: "palm/500" }
|
|
144
152
|
}
|
|
145
153
|
};
|
|
146
|
-
var darkRolesUnverified = [
|
|
147
|
-
"bg/scrim",
|
|
148
|
-
"border/selected",
|
|
149
|
-
"travel/flights/accent",
|
|
150
|
-
"travel/hotels/accent",
|
|
151
|
-
"travel/cars/accent",
|
|
152
|
-
"travel/rail/accent"
|
|
153
|
-
];
|
|
154
|
+
var darkRolesUnverified = ["border/selected"];
|
|
154
155
|
var spacing = {
|
|
155
156
|
xs: 4,
|
|
156
157
|
sm: 8,
|
|
@@ -172,11 +173,13 @@ var radius = {
|
|
|
172
173
|
};
|
|
173
174
|
var elevation = {
|
|
174
175
|
raised: {
|
|
175
|
-
value: "0
|
|
176
|
-
|
|
176
|
+
value: "0 6px 16px rgba(31, 29, 26, 0.06)",
|
|
177
|
+
dark: "none",
|
|
178
|
+
usage: "The booking card, popovers, the selected fare. No shadow in dark: the lighter surface does the lifting."
|
|
177
179
|
},
|
|
178
180
|
floating: {
|
|
179
|
-
value: "0
|
|
181
|
+
value: "0 12px 32px rgba(31, 29, 26, 0.12)",
|
|
182
|
+
dark: "0 12px 32px rgba(10, 9, 8, 0.5)",
|
|
180
183
|
usage: "Modals, menus and toasts, over the scrim."
|
|
181
184
|
},
|
|
182
185
|
focus: {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkHX7N52DBcjs = require('./chunk-HX7N52DB.cjs');
|
|
10
10
|
|
|
11
11
|
// src/tokens/css.ts
|
|
12
12
|
var prefix = "af";
|
|
@@ -17,8 +17,8 @@ function flattenRoles(tree, path = []) {
|
|
|
17
17
|
return [{ name: next.join("-"), figmaName: next.join("/"), group: next[0], ref: value }];
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
var roles = flattenRoles(
|
|
21
|
-
var darkRoles = flattenRoles(
|
|
20
|
+
var roles = flattenRoles(_chunkHX7N52DBcjs.colorRoles);
|
|
21
|
+
var darkRoles = flattenRoles(_chunkHX7N52DBcjs.colorRolesDark);
|
|
22
22
|
var darkClass = "dark";
|
|
23
23
|
function darkRoleFor(name) {
|
|
24
24
|
const role = darkRoles.find((item) => item.name === name);
|
|
@@ -32,7 +32,7 @@ function splitAlpha(ref) {
|
|
|
32
32
|
const [base, alpha] = ref.split("@");
|
|
33
33
|
if (alpha === void 0) return { base, alpha: null };
|
|
34
34
|
const percent = Number(alpha);
|
|
35
|
-
if (!Number.isInteger(percent) || percent <
|
|
35
|
+
if (!Number.isInteger(percent) || percent < 0 || percent > 99) throw new Error(`Bad opacity in "${ref}"`);
|
|
36
36
|
return { base, alpha: percent };
|
|
37
37
|
}
|
|
38
38
|
function resolveColor(ref) {
|
|
@@ -56,7 +56,7 @@ function primitiveName(ref) {
|
|
|
56
56
|
}
|
|
57
57
|
function resolvePrimitive(ref) {
|
|
58
58
|
const [scale, step] = ref.split("/");
|
|
59
|
-
const steps =
|
|
59
|
+
const steps = _chunkHX7N52DBcjs.primitives[scale];
|
|
60
60
|
const value = _optionalChain([steps, 'optionalAccess', _ => _[step]]);
|
|
61
61
|
if (!value) throw new Error(`Unknown primitive "${ref}"`);
|
|
62
62
|
return value;
|
|
@@ -67,19 +67,22 @@ function rem(px) {
|
|
|
67
67
|
function renderTokensCss() {
|
|
68
68
|
const groups = [];
|
|
69
69
|
groups.push(
|
|
70
|
-
Object.entries(
|
|
70
|
+
Object.entries(_chunkHX7N52DBcjs.primitives).flatMap(
|
|
71
71
|
([scale, steps]) => Object.entries(steps).map(([step, value]) => `${cssVarName(`${scale}-${step}`)}: ${value};`)
|
|
72
72
|
)
|
|
73
73
|
);
|
|
74
74
|
groups.push(roles.map((role) => `${cssVarName(role.name)}: ${colorValue(role.ref)};`));
|
|
75
|
-
groups.push(Object.entries(
|
|
76
|
-
groups.push(Object.entries(
|
|
77
|
-
groups.push(Object.entries(
|
|
78
|
-
groups.push(Object.entries(
|
|
75
|
+
groups.push(Object.entries(_chunkHX7N52DBcjs.spacing).map(([key, px]) => `${cssVarName(`spacing-${key}`)}: ${rem(px)};`));
|
|
76
|
+
groups.push(Object.entries(_chunkHX7N52DBcjs.radius).map(([key, item]) => `${cssVarName(`radius-${key}`)}: ${item.value}px;`));
|
|
77
|
+
groups.push(Object.entries(_chunkHX7N52DBcjs.elevation).map(([key, item]) => `${cssVarName(`elevation-${key}`)}: ${item.value};`));
|
|
78
|
+
groups.push(Object.entries(_chunkHX7N52DBcjs.fonts).map(([key, stack]) => `${cssVarName(`font-${key}`)}: ${stack.join(", ")};`));
|
|
79
79
|
const indent = (lines) => lines.map((line) => ` ${line}`).join("\n");
|
|
80
80
|
const body = [["color-scheme: light;"], ...groups].map(indent).join("\n\n");
|
|
81
81
|
const darkLines = roles.map((role) => ({ light: role, dark: darkRoleFor(role.name) })).filter(({ light, dark }) => light.ref !== dark.ref).map(({ dark }) => `${cssVarName(dark.name)}: ${colorValue(dark.ref)};`);
|
|
82
|
-
const
|
|
82
|
+
const darkElevation = Object.entries(_chunkHX7N52DBcjs.elevation).flatMap(
|
|
83
|
+
([key, item]) => item.dark === void 0 ? [] : [`${cssVarName(`elevation-${key}`)}: ${item.dark};`]
|
|
84
|
+
);
|
|
85
|
+
const darkBody = [["color-scheme: dark;"], darkLines, darkElevation].map(indent).join("\n\n");
|
|
83
86
|
return `:root {
|
|
84
87
|
${body}
|
|
85
88
|
}
|
|
@@ -61,7 +61,10 @@ var colorRoles = {
|
|
|
61
61
|
"action-hover": "blue/600",
|
|
62
62
|
"action-pressed": "blue/700",
|
|
63
63
|
inverse: "warm/900",
|
|
64
|
-
scrim: "warm/900@60"
|
|
64
|
+
scrim: "warm/900@60",
|
|
65
|
+
raised: "warm/0",
|
|
66
|
+
"image-dim": "#151310@0",
|
|
67
|
+
"art-cream": "#FDEBD5"
|
|
65
68
|
},
|
|
66
69
|
text: {
|
|
67
70
|
primary: "warm/900",
|
|
@@ -80,7 +83,8 @@ var colorRoles = {
|
|
|
80
83
|
control: "warm/400",
|
|
81
84
|
focus: "blue/500",
|
|
82
85
|
selected: "blue/500",
|
|
83
|
-
ink: "warm/900"
|
|
86
|
+
ink: "warm/900",
|
|
87
|
+
feature: "blue/900"
|
|
84
88
|
},
|
|
85
89
|
status: {
|
|
86
90
|
success: { fill: "palm/50", text: "palm/700", border: "palm/500" },
|
|
@@ -108,7 +112,10 @@ var colorRolesDark = {
|
|
|
108
112
|
"action-hover": "blue/600",
|
|
109
113
|
"action-pressed": "blue/700",
|
|
110
114
|
inverse: "warm/100",
|
|
111
|
-
scrim: "
|
|
115
|
+
scrim: "#0A0908@72",
|
|
116
|
+
raised: "#2E2A26",
|
|
117
|
+
"image-dim": "#151310@10",
|
|
118
|
+
"art-cream": "#FDEBD5"
|
|
112
119
|
},
|
|
113
120
|
text: {
|
|
114
121
|
primary: "warm/100",
|
|
@@ -127,7 +134,8 @@ var colorRolesDark = {
|
|
|
127
134
|
control: "#857C70",
|
|
128
135
|
focus: "blue/300",
|
|
129
136
|
selected: "blue/300",
|
|
130
|
-
ink: "warm/100"
|
|
137
|
+
ink: "warm/100",
|
|
138
|
+
feature: "#1E3A70"
|
|
131
139
|
},
|
|
132
140
|
status: {
|
|
133
141
|
success: { fill: "#13291F", text: "#86D3B2", border: "#3DB489" },
|
|
@@ -143,14 +151,7 @@ var colorRolesDark = {
|
|
|
143
151
|
rail: { tint: "#13291F", ink: "#7CCCAD", accent: "palm/500" }
|
|
144
152
|
}
|
|
145
153
|
};
|
|
146
|
-
var darkRolesUnverified = [
|
|
147
|
-
"bg/scrim",
|
|
148
|
-
"border/selected",
|
|
149
|
-
"travel/flights/accent",
|
|
150
|
-
"travel/hotels/accent",
|
|
151
|
-
"travel/cars/accent",
|
|
152
|
-
"travel/rail/accent"
|
|
153
|
-
];
|
|
154
|
+
var darkRolesUnverified = ["border/selected"];
|
|
154
155
|
var spacing = {
|
|
155
156
|
xs: 4,
|
|
156
157
|
sm: 8,
|
|
@@ -172,11 +173,13 @@ var radius = {
|
|
|
172
173
|
};
|
|
173
174
|
var elevation = {
|
|
174
175
|
raised: {
|
|
175
|
-
value: "0
|
|
176
|
-
|
|
176
|
+
value: "0 6px 16px rgba(31, 29, 26, 0.06)",
|
|
177
|
+
dark: "none",
|
|
178
|
+
usage: "The booking card, popovers, the selected fare. No shadow in dark: the lighter surface does the lifting."
|
|
177
179
|
},
|
|
178
180
|
floating: {
|
|
179
|
-
value: "0
|
|
181
|
+
value: "0 12px 32px rgba(31, 29, 26, 0.12)",
|
|
182
|
+
dark: "0 12px 32px rgba(10, 9, 8, 0.5)",
|
|
180
183
|
usage: "Modals, menus and toasts, over the scrim."
|
|
181
184
|
},
|
|
182
185
|
focus: {
|
package/dist/index.cjs
CHANGED
|
@@ -65,11 +65,13 @@ var radius = {
|
|
|
65
65
|
};
|
|
66
66
|
var elevation = {
|
|
67
67
|
raised: {
|
|
68
|
-
value: "0
|
|
69
|
-
|
|
68
|
+
value: "0 6px 16px rgba(31, 29, 26, 0.06)",
|
|
69
|
+
dark: "none",
|
|
70
|
+
usage: "The booking card, popovers, the selected fare. No shadow in dark: the lighter surface does the lifting."
|
|
70
71
|
},
|
|
71
72
|
floating: {
|
|
72
|
-
value: "0
|
|
73
|
+
value: "0 12px 32px rgba(31, 29, 26, 0.12)",
|
|
74
|
+
dark: "0 12px 32px rgba(10, 9, 8, 0.5)",
|
|
73
75
|
usage: "Modals, menus and toasts, over the scrim."
|
|
74
76
|
},
|
|
75
77
|
focus: {
|
package/dist/index.js
CHANGED
|
@@ -30,11 +30,13 @@ var radius = {
|
|
|
30
30
|
};
|
|
31
31
|
var elevation = {
|
|
32
32
|
raised: {
|
|
33
|
-
value: "0
|
|
34
|
-
|
|
33
|
+
value: "0 6px 16px rgba(31, 29, 26, 0.06)",
|
|
34
|
+
dark: "none",
|
|
35
|
+
usage: "The booking card, popovers, the selected fare. No shadow in dark: the lighter surface does the lifting."
|
|
35
36
|
},
|
|
36
37
|
floating: {
|
|
37
|
-
value: "0
|
|
38
|
+
value: "0 12px 32px rgba(31, 29, 26, 0.12)",
|
|
39
|
+
dark: "0 12px 32px rgba(10, 9, 8, 0.5)",
|
|
38
40
|
usage: "Modals, menus and toasts, over the scrim."
|
|
39
41
|
},
|
|
40
42
|
focus: {
|
package/dist/tailwind-preset.cjs
CHANGED
|
@@ -2,29 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkJH4ANRE2cjs = require('./chunk-JH4ANRE2.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkHX7N52DBcjs = require('./chunk-HX7N52DB.cjs');
|
|
13
13
|
|
|
14
14
|
// src/tokens/tailwind-preset.ts
|
|
15
15
|
function roleGroup(...groups) {
|
|
16
16
|
return Object.fromEntries(
|
|
17
|
-
|
|
17
|
+
_chunkJH4ANRE2cjs.roles.filter((role) => groups.includes(role.group)).map((role) => [role.name, _chunkJH4ANRE2cjs.cssVar.call(void 0, role.name)])
|
|
18
18
|
);
|
|
19
19
|
}
|
|
20
20
|
function scale(name, keys) {
|
|
21
|
-
return Object.fromEntries(keys.map((key) => [`${name}-${key}`,
|
|
21
|
+
return Object.fromEntries(keys.map((key) => [`${name}-${key}`, _chunkJH4ANRE2cjs.cssVar.call(void 0, `${name}-${key}`)]));
|
|
22
22
|
}
|
|
23
23
|
function typeClass(style) {
|
|
24
24
|
return {
|
|
25
|
-
fontFamily:
|
|
26
|
-
fontSize:
|
|
27
|
-
lineHeight:
|
|
25
|
+
fontFamily: _chunkJH4ANRE2cjs.cssVar.call(void 0, `font-${style.font}`),
|
|
26
|
+
fontSize: _chunkJH4ANRE2cjs.rem.call(void 0, style.size),
|
|
27
|
+
lineHeight: _chunkJH4ANRE2cjs.rem.call(void 0, style.lineHeight),
|
|
28
28
|
fontWeight: String(style.weight),
|
|
29
29
|
...style.italic ? { fontStyle: "italic" } : {},
|
|
30
30
|
...style.uppercase ? { textTransform: "uppercase" } : {},
|
|
@@ -32,7 +32,7 @@ function typeClass(style) {
|
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
var typeClasses = Object.fromEntries(
|
|
35
|
-
Object.entries(
|
|
35
|
+
Object.entries(_chunkHX7N52DBcjs.typeStyles).map(([name, style]) => [`.type-${name}`, typeClass(style)])
|
|
36
36
|
);
|
|
37
37
|
var typePlugin = ({ addComponents }) => {
|
|
38
38
|
addComponents(typeClasses);
|
|
@@ -46,10 +46,10 @@ var allflyPreset = {
|
|
|
46
46
|
borderColor: roleGroup("border"),
|
|
47
47
|
ringColor: roleGroup("border"),
|
|
48
48
|
outlineColor: roleGroup("border"),
|
|
49
|
-
spacing: scale("spacing", Object.keys(
|
|
50
|
-
borderRadius: scale("radius", Object.keys(
|
|
51
|
-
boxShadow: scale("elevation", Object.keys(
|
|
52
|
-
fontFamily: Object.fromEntries(Object.keys(
|
|
49
|
+
spacing: scale("spacing", Object.keys(_chunkHX7N52DBcjs.spacing)),
|
|
50
|
+
borderRadius: scale("radius", Object.keys(_chunkHX7N52DBcjs.radius)),
|
|
51
|
+
boxShadow: scale("elevation", Object.keys(_chunkHX7N52DBcjs.elevation)),
|
|
52
|
+
fontFamily: Object.fromEntries(Object.keys(_chunkHX7N52DBcjs.fonts).map((key) => [key, _chunkJH4ANRE2cjs.cssVar.call(void 0, `font-${key}`)]))
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
plugins: [typePlugin]
|
package/dist/tailwind-preset.js
CHANGED
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
cssVar,
|
|
3
3
|
rem,
|
|
4
4
|
roles
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-C6EI7GYY.js";
|
|
6
6
|
import {
|
|
7
7
|
elevation,
|
|
8
8
|
fonts,
|
|
9
9
|
radius,
|
|
10
10
|
spacing,
|
|
11
11
|
typeStyles
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-NSDKLLVT.js";
|
|
13
13
|
|
|
14
14
|
// src/tokens/tailwind-preset.ts
|
|
15
15
|
function roleGroup(...groups) {
|
package/dist/tokens.cjs
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkJH4ANRE2cjs = require('./chunk-JH4ANRE2.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
@@ -25,7 +25,7 @@ var _chunkNRXCNNTQcjs = require('./chunk-NRXCNNTQ.cjs');
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _chunkHX7N52DBcjs = require('./chunk-HX7N52DB.cjs');
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
@@ -51,4 +51,4 @@ var _chunkLGGVSGQFcjs = require('./chunk-LGGVSGQF.cjs');
|
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
|
|
54
|
-
exports.colorRoles =
|
|
54
|
+
exports.colorRoles = _chunkHX7N52DBcjs.colorRoles; exports.colorRolesDark = _chunkHX7N52DBcjs.colorRolesDark; exports.cssVar = _chunkJH4ANRE2cjs.cssVar; exports.cssVarName = _chunkJH4ANRE2cjs.cssVarName; exports.darkClass = _chunkJH4ANRE2cjs.darkClass; exports.darkRoleFor = _chunkJH4ANRE2cjs.darkRoleFor; exports.darkRoles = _chunkJH4ANRE2cjs.darkRoles; exports.darkRolesUnverified = _chunkHX7N52DBcjs.darkRolesUnverified; exports.elevation = _chunkHX7N52DBcjs.elevation; exports.flattenRoles = _chunkJH4ANRE2cjs.flattenRoles; exports.fonts = _chunkHX7N52DBcjs.fonts; exports.isHex = _chunkJH4ANRE2cjs.isHex; exports.prefix = _chunkJH4ANRE2cjs.prefix; exports.primitiveName = _chunkJH4ANRE2cjs.primitiveName; exports.primitives = _chunkHX7N52DBcjs.primitives; exports.radius = _chunkHX7N52DBcjs.radius; exports.rem = _chunkJH4ANRE2cjs.rem; exports.renderTokensCss = _chunkJH4ANRE2cjs.renderTokensCss; exports.resolveColor = _chunkJH4ANRE2cjs.resolveColor; exports.resolvePrimitive = _chunkJH4ANRE2cjs.resolvePrimitive; exports.roles = _chunkJH4ANRE2cjs.roles; exports.spacing = _chunkHX7N52DBcjs.spacing; exports.splitAlpha = _chunkJH4ANRE2cjs.splitAlpha; exports.typeStyles = _chunkHX7N52DBcjs.typeStyles;
|
package/dist/tokens.css
CHANGED
|
@@ -47,6 +47,9 @@
|
|
|
47
47
|
--af-bg-action-pressed: var(--af-blue-700);
|
|
48
48
|
--af-bg-inverse: var(--af-warm-900);
|
|
49
49
|
--af-bg-scrim: color-mix(in srgb, var(--af-warm-900) 60%, transparent);
|
|
50
|
+
--af-bg-raised: var(--af-warm-0);
|
|
51
|
+
--af-bg-image-dim: color-mix(in srgb, #151310 0%, transparent);
|
|
52
|
+
--af-bg-art-cream: #FDEBD5;
|
|
50
53
|
--af-text-primary: var(--af-warm-900);
|
|
51
54
|
--af-text-secondary: var(--af-warm-800);
|
|
52
55
|
--af-text-muted: var(--af-warm-600);
|
|
@@ -62,6 +65,7 @@
|
|
|
62
65
|
--af-border-focus: var(--af-blue-500);
|
|
63
66
|
--af-border-selected: var(--af-blue-500);
|
|
64
67
|
--af-border-ink: var(--af-warm-900);
|
|
68
|
+
--af-border-feature: var(--af-blue-900);
|
|
65
69
|
--af-status-success-fill: var(--af-palm-50);
|
|
66
70
|
--af-status-success-text: var(--af-palm-700);
|
|
67
71
|
--af-status-success-border: var(--af-palm-500);
|
|
@@ -109,8 +113,8 @@
|
|
|
109
113
|
--af-radius-2xl: 32px;
|
|
110
114
|
--af-radius-full: 9999px;
|
|
111
115
|
|
|
112
|
-
--af-elevation-raised: 0
|
|
113
|
-
--af-elevation-floating: 0
|
|
116
|
+
--af-elevation-raised: 0 6px 16px rgba(31, 29, 26, 0.06);
|
|
117
|
+
--af-elevation-floating: 0 12px 32px rgba(31, 29, 26, 0.12);
|
|
114
118
|
--af-elevation-focus: 0 0 0 4px color-mix(in srgb, var(--af-bg-action) 30%, transparent);
|
|
115
119
|
|
|
116
120
|
--af-font-ui: "Figtree Variable", Figtree, ui-sans-serif, system-ui, sans-serif;
|
|
@@ -127,6 +131,9 @@
|
|
|
127
131
|
--af-bg-hover: #26231F;
|
|
128
132
|
--af-bg-selected: #172A45;
|
|
129
133
|
--af-bg-inverse: var(--af-warm-100);
|
|
134
|
+
--af-bg-scrim: color-mix(in srgb, #0A0908 72%, transparent);
|
|
135
|
+
--af-bg-raised: #2E2A26;
|
|
136
|
+
--af-bg-image-dim: color-mix(in srgb, #151310 10%, transparent);
|
|
130
137
|
--af-text-primary: var(--af-warm-100);
|
|
131
138
|
--af-text-secondary: #D4CBBE;
|
|
132
139
|
--af-text-muted: #ABA294;
|
|
@@ -139,6 +146,7 @@
|
|
|
139
146
|
--af-border-focus: var(--af-blue-300);
|
|
140
147
|
--af-border-selected: var(--af-blue-300);
|
|
141
148
|
--af-border-ink: var(--af-warm-100);
|
|
149
|
+
--af-border-feature: #1E3A70;
|
|
142
150
|
--af-status-success-fill: #13291F;
|
|
143
151
|
--af-status-success-text: #86D3B2;
|
|
144
152
|
--af-status-success-border: #3DB489;
|
|
@@ -164,4 +172,7 @@
|
|
|
164
172
|
--af-travel-cars-ink: #F5C46A;
|
|
165
173
|
--af-travel-rail-tint: #13291F;
|
|
166
174
|
--af-travel-rail-ink: #7CCCAD;
|
|
175
|
+
|
|
176
|
+
--af-elevation-raised: none;
|
|
177
|
+
--af-elevation-floating: 0 12px 32px rgba(10, 9, 8, 0.5);
|
|
167
178
|
}
|
package/dist/tokens.d.cts
CHANGED
|
@@ -64,6 +64,9 @@ declare const colorRoles: {
|
|
|
64
64
|
readonly 'action-pressed': "blue/700";
|
|
65
65
|
readonly inverse: "warm/900";
|
|
66
66
|
readonly scrim: "warm/900@60";
|
|
67
|
+
readonly raised: "warm/0";
|
|
68
|
+
readonly 'image-dim': "#151310@0";
|
|
69
|
+
readonly 'art-cream': "#FDEBD5";
|
|
67
70
|
};
|
|
68
71
|
readonly text: {
|
|
69
72
|
readonly primary: "warm/900";
|
|
@@ -83,6 +86,7 @@ declare const colorRoles: {
|
|
|
83
86
|
readonly focus: "blue/500";
|
|
84
87
|
readonly selected: "blue/500";
|
|
85
88
|
readonly ink: "warm/900";
|
|
89
|
+
readonly feature: "blue/900";
|
|
86
90
|
};
|
|
87
91
|
readonly status: {
|
|
88
92
|
readonly success: {
|
|
@@ -148,7 +152,10 @@ declare const colorRolesDark: {
|
|
|
148
152
|
readonly 'action-hover': "blue/600";
|
|
149
153
|
readonly 'action-pressed': "blue/700";
|
|
150
154
|
readonly inverse: "warm/100";
|
|
151
|
-
readonly scrim: "
|
|
155
|
+
readonly scrim: "#0A0908@72";
|
|
156
|
+
readonly raised: "#2E2A26";
|
|
157
|
+
readonly 'image-dim': "#151310@10";
|
|
158
|
+
readonly 'art-cream': "#FDEBD5";
|
|
152
159
|
};
|
|
153
160
|
readonly text: {
|
|
154
161
|
readonly primary: "warm/100";
|
|
@@ -168,6 +175,7 @@ declare const colorRolesDark: {
|
|
|
168
175
|
readonly focus: "blue/300";
|
|
169
176
|
readonly selected: "blue/300";
|
|
170
177
|
readonly ink: "warm/100";
|
|
178
|
+
readonly feature: "#1E3A70";
|
|
171
179
|
};
|
|
172
180
|
readonly status: {
|
|
173
181
|
readonly success: {
|
|
@@ -221,7 +229,7 @@ declare const colorRolesDark: {
|
|
|
221
229
|
};
|
|
222
230
|
};
|
|
223
231
|
};
|
|
224
|
-
declare const darkRolesUnverified: readonly ["
|
|
232
|
+
declare const darkRolesUnverified: readonly ["border/selected"];
|
|
225
233
|
declare const spacing: {
|
|
226
234
|
readonly xs: 4;
|
|
227
235
|
readonly sm: 8;
|
|
@@ -264,11 +272,13 @@ declare const radius: {
|
|
|
264
272
|
};
|
|
265
273
|
declare const elevation: {
|
|
266
274
|
readonly raised: {
|
|
267
|
-
readonly value: "0
|
|
268
|
-
readonly
|
|
275
|
+
readonly value: "0 6px 16px rgba(31, 29, 26, 0.06)";
|
|
276
|
+
readonly dark: "none";
|
|
277
|
+
readonly usage: "The booking card, popovers, the selected fare. No shadow in dark: the lighter surface does the lifting.";
|
|
269
278
|
};
|
|
270
279
|
readonly floating: {
|
|
271
|
-
readonly value: "0
|
|
280
|
+
readonly value: "0 12px 32px rgba(31, 29, 26, 0.12)";
|
|
281
|
+
readonly dark: "0 12px 32px rgba(10, 9, 8, 0.5)";
|
|
272
282
|
readonly usage: "Modals, menus and toasts, over the scrim.";
|
|
273
283
|
};
|
|
274
284
|
readonly focus: {
|
package/dist/tokens.d.ts
CHANGED
|
@@ -64,6 +64,9 @@ declare const colorRoles: {
|
|
|
64
64
|
readonly 'action-pressed': "blue/700";
|
|
65
65
|
readonly inverse: "warm/900";
|
|
66
66
|
readonly scrim: "warm/900@60";
|
|
67
|
+
readonly raised: "warm/0";
|
|
68
|
+
readonly 'image-dim': "#151310@0";
|
|
69
|
+
readonly 'art-cream': "#FDEBD5";
|
|
67
70
|
};
|
|
68
71
|
readonly text: {
|
|
69
72
|
readonly primary: "warm/900";
|
|
@@ -83,6 +86,7 @@ declare const colorRoles: {
|
|
|
83
86
|
readonly focus: "blue/500";
|
|
84
87
|
readonly selected: "blue/500";
|
|
85
88
|
readonly ink: "warm/900";
|
|
89
|
+
readonly feature: "blue/900";
|
|
86
90
|
};
|
|
87
91
|
readonly status: {
|
|
88
92
|
readonly success: {
|
|
@@ -148,7 +152,10 @@ declare const colorRolesDark: {
|
|
|
148
152
|
readonly 'action-hover': "blue/600";
|
|
149
153
|
readonly 'action-pressed': "blue/700";
|
|
150
154
|
readonly inverse: "warm/100";
|
|
151
|
-
readonly scrim: "
|
|
155
|
+
readonly scrim: "#0A0908@72";
|
|
156
|
+
readonly raised: "#2E2A26";
|
|
157
|
+
readonly 'image-dim': "#151310@10";
|
|
158
|
+
readonly 'art-cream': "#FDEBD5";
|
|
152
159
|
};
|
|
153
160
|
readonly text: {
|
|
154
161
|
readonly primary: "warm/100";
|
|
@@ -168,6 +175,7 @@ declare const colorRolesDark: {
|
|
|
168
175
|
readonly focus: "blue/300";
|
|
169
176
|
readonly selected: "blue/300";
|
|
170
177
|
readonly ink: "warm/100";
|
|
178
|
+
readonly feature: "#1E3A70";
|
|
171
179
|
};
|
|
172
180
|
readonly status: {
|
|
173
181
|
readonly success: {
|
|
@@ -221,7 +229,7 @@ declare const colorRolesDark: {
|
|
|
221
229
|
};
|
|
222
230
|
};
|
|
223
231
|
};
|
|
224
|
-
declare const darkRolesUnverified: readonly ["
|
|
232
|
+
declare const darkRolesUnverified: readonly ["border/selected"];
|
|
225
233
|
declare const spacing: {
|
|
226
234
|
readonly xs: 4;
|
|
227
235
|
readonly sm: 8;
|
|
@@ -264,11 +272,13 @@ declare const radius: {
|
|
|
264
272
|
};
|
|
265
273
|
declare const elevation: {
|
|
266
274
|
readonly raised: {
|
|
267
|
-
readonly value: "0
|
|
268
|
-
readonly
|
|
275
|
+
readonly value: "0 6px 16px rgba(31, 29, 26, 0.06)";
|
|
276
|
+
readonly dark: "none";
|
|
277
|
+
readonly usage: "The booking card, popovers, the selected fare. No shadow in dark: the lighter surface does the lifting.";
|
|
269
278
|
};
|
|
270
279
|
readonly floating: {
|
|
271
|
-
readonly value: "0
|
|
280
|
+
readonly value: "0 12px 32px rgba(31, 29, 26, 0.12)";
|
|
281
|
+
readonly dark: "0 12px 32px rgba(10, 9, 8, 0.5)";
|
|
272
282
|
readonly usage: "Modals, menus and toasts, over the scrim.";
|
|
273
283
|
};
|
|
274
284
|
readonly focus: {
|
package/dist/tokens.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
resolvePrimitive,
|
|
15
15
|
roles,
|
|
16
16
|
splitAlpha
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-C6EI7GYY.js";
|
|
18
18
|
import {
|
|
19
19
|
colorRoles,
|
|
20
20
|
colorRolesDark,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
radius,
|
|
26
26
|
spacing,
|
|
27
27
|
typeStyles
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-NSDKLLVT.js";
|
|
29
29
|
export {
|
|
30
30
|
colorRoles,
|
|
31
31
|
colorRolesDark,
|
package/dist/utils.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkHX7N52DBcjs = require('./chunk-HX7N52DB.cjs');
|
|
7
7
|
|
|
8
8
|
// src/lib/cn.ts
|
|
9
9
|
var _clsx = require('clsx');
|
|
@@ -11,12 +11,12 @@ var _tailwindmerge = require('tailwind-merge');
|
|
|
11
11
|
var twMerge = _tailwindmerge.extendTailwindMerge.call(void 0, {
|
|
12
12
|
extend: {
|
|
13
13
|
theme: {
|
|
14
|
-
spacing: Object.keys(
|
|
15
|
-
radius: Object.keys(
|
|
16
|
-
shadow: Object.keys(
|
|
14
|
+
spacing: Object.keys(_chunkHX7N52DBcjs.spacing).map((key) => `spacing-${key}`),
|
|
15
|
+
radius: Object.keys(_chunkHX7N52DBcjs.radius).map((key) => `radius-${key}`),
|
|
16
|
+
shadow: Object.keys(_chunkHX7N52DBcjs.elevation).map((key) => `elevation-${key}`)
|
|
17
17
|
},
|
|
18
18
|
classGroups: {
|
|
19
|
-
"type-style": [{ type: Object.keys(
|
|
19
|
+
"type-style": [{ type: Object.keys(_chunkHX7N52DBcjs.typeStyles) }]
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
});
|
package/dist/utils.js
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travelallfly/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "AllFly design system: tokens, Tailwind preset and shared React components",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/travelallfly/allfly-ui.git"
|
|
8
8
|
},
|
|
9
|
+
"license": "MIT",
|
|
9
10
|
"publishConfig": {
|
|
10
11
|
"access": "public"
|
|
11
12
|
},
|