@tangible/ui 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/README.md +100 -0
- package/components/Accordion/Accordion.d.ts +22 -0
- package/components/Accordion/Accordion.js +192 -0
- package/components/Accordion/AccordionContext.d.ts +5 -0
- package/components/Accordion/AccordionContext.js +23 -0
- package/components/Accordion/index.d.ts +2 -0
- package/components/Accordion/index.js +1 -0
- package/components/Accordion/types.d.ts +61 -0
- package/components/Accordion/types.js +1 -0
- package/components/Avatar/Avatar.d.ts +11 -0
- package/components/Avatar/Avatar.js +67 -0
- package/components/Avatar/AvatarGroup.d.ts +11 -0
- package/components/Avatar/AvatarGroup.js +45 -0
- package/components/Avatar/index.d.ts +9 -0
- package/components/Avatar/index.js +7 -0
- package/components/Avatar/types.d.ts +44 -0
- package/components/Avatar/types.js +12 -0
- package/components/Button/Button.d.ts +4 -0
- package/components/Button/Button.js +33 -0
- package/components/Button/index.d.ts +2 -0
- package/components/Button/index.js +1 -0
- package/components/Button/types.d.ts +127 -0
- package/components/Button/types.js +1 -0
- package/components/Card/Card.d.ts +29 -0
- package/components/Card/Card.js +47 -0
- package/components/Card/index.d.ts +2 -0
- package/components/Card/index.js +1 -0
- package/components/Chip/Chip.d.ts +24 -0
- package/components/Chip/Chip.js +37 -0
- package/components/Chip/index.d.ts +2 -0
- package/components/Chip/index.js +1 -0
- package/components/Chips/Chips.d.ts +31 -0
- package/components/Chips/Chips.js +21 -0
- package/components/Chips/index.d.ts +2 -0
- package/components/Chips/index.js +1 -0
- package/components/ContentIndicator/ContentIndicator.d.ts +2 -0
- package/components/ContentIndicator/ContentIndicator.js +21 -0
- package/components/ContentIndicator/index.d.ts +2 -0
- package/components/ContentIndicator/index.js +1 -0
- package/components/ContentIndicator/types.d.ts +57 -0
- package/components/ContentIndicator/types.js +1 -0
- package/components/Dropdown/Dropdown.d.ts +31 -0
- package/components/Dropdown/Dropdown.js +219 -0
- package/components/Dropdown/DropdownContext.d.ts +3 -0
- package/components/Dropdown/DropdownContext.js +9 -0
- package/components/Dropdown/index.d.ts +2 -0
- package/components/Dropdown/index.js +1 -0
- package/components/Dropdown/types.d.ts +102 -0
- package/components/Dropdown/types.js +8 -0
- package/components/Icon/Icon.d.ts +22 -0
- package/components/Icon/Icon.js +24 -0
- package/components/Icon/index.d.ts +2 -0
- package/components/Icon/index.js +1 -0
- package/components/IconButton/IconButton.d.ts +2 -0
- package/components/IconButton/IconButton.js +50 -0
- package/components/IconButton/index.d.ts +2 -0
- package/components/IconButton/index.js +1 -0
- package/components/IconButton/types.d.ts +79 -0
- package/components/IconButton/types.js +1 -0
- package/components/Modal/Modal.d.ts +52 -0
- package/components/Modal/Modal.js +133 -0
- package/components/Modal/context.d.ts +6 -0
- package/components/Modal/context.js +9 -0
- package/components/Modal/index.d.ts +2 -0
- package/components/Modal/index.js +1 -0
- package/components/Notice/Notice.d.ts +93 -0
- package/components/Notice/Notice.js +144 -0
- package/components/Notice/index.d.ts +2 -0
- package/components/Notice/index.js +1 -0
- package/components/OverlapStack/OverlapStack.d.ts +44 -0
- package/components/OverlapStack/OverlapStack.js +41 -0
- package/components/OverlapStack/index.d.ts +2 -0
- package/components/OverlapStack/index.js +1 -0
- package/components/Pager/Pager.d.ts +26 -0
- package/components/Pager/Pager.js +151 -0
- package/components/Pager/index.d.ts +2 -0
- package/components/Pager/index.js +1 -0
- package/components/Progress/Progress.d.ts +2 -0
- package/components/Progress/Progress.js +100 -0
- package/components/Progress/index.d.ts +4 -0
- package/components/Progress/index.js +2 -0
- package/components/Progress/types.d.ts +251 -0
- package/components/Progress/types.js +1 -0
- package/components/Progress/useProgressSegments.d.ts +40 -0
- package/components/Progress/useProgressSegments.js +42 -0
- package/components/Rating/Rating.d.ts +32 -0
- package/components/Rating/Rating.js +74 -0
- package/components/Rating/index.d.ts +2 -0
- package/components/Rating/index.js +1 -0
- package/components/SegmentedControl/SegmentedControl.d.ts +10 -0
- package/components/SegmentedControl/SegmentedControl.js +183 -0
- package/components/SegmentedControl/SegmentedControlContext.d.ts +3 -0
- package/components/SegmentedControl/SegmentedControlContext.js +9 -0
- package/components/SegmentedControl/index.d.ts +2 -0
- package/components/SegmentedControl/index.js +1 -0
- package/components/SegmentedControl/types.d.ts +63 -0
- package/components/SegmentedControl/types.js +1 -0
- package/components/Sidebar/Sidebar.d.ts +17 -0
- package/components/Sidebar/Sidebar.js +107 -0
- package/components/Sidebar/index.d.ts +2 -0
- package/components/Sidebar/index.js +1 -0
- package/components/Sidebar/types.d.ts +65 -0
- package/components/Sidebar/types.js +4 -0
- package/components/StepIndicator/StepIndicator.d.ts +2 -0
- package/components/StepIndicator/StepIndicator.js +64 -0
- package/components/StepIndicator/index.d.ts +2 -0
- package/components/StepIndicator/index.js +1 -0
- package/components/StepIndicator/types.d.ts +68 -0
- package/components/StepIndicator/types.js +1 -0
- package/components/StepList/StepList.d.ts +12 -0
- package/components/StepList/StepList.js +59 -0
- package/components/StepList/StepListContext.d.ts +3 -0
- package/components/StepList/StepListContext.js +9 -0
- package/components/StepList/index.d.ts +2 -0
- package/components/StepList/index.js +1 -0
- package/components/StepList/types.d.ts +91 -0
- package/components/StepList/types.js +4 -0
- package/components/Table/BulkActionsBar.d.ts +12 -0
- package/components/Table/BulkActionsBar.js +9 -0
- package/components/Table/DataTable.d.ts +35 -0
- package/components/Table/DataTable.js +184 -0
- package/components/Table/Pagination.d.ts +13 -0
- package/components/Table/Pagination.js +13 -0
- package/components/Table/index.d.ts +2 -0
- package/components/Table/index.js +1 -0
- package/components/Tabs/Tabs.d.ts +23 -0
- package/components/Tabs/Tabs.js +309 -0
- package/components/Tabs/TabsContext.d.ts +3 -0
- package/components/Tabs/TabsContext.js +12 -0
- package/components/Tabs/index.d.ts +2 -0
- package/components/Tabs/index.js +1 -0
- package/components/Tabs/types.d.ts +75 -0
- package/components/Tabs/types.js +1 -0
- package/components/Toolbar/Toolbar.d.ts +18 -0
- package/components/Toolbar/Toolbar.js +241 -0
- package/components/Toolbar/index.d.ts +2 -0
- package/components/Toolbar/index.js +1 -0
- package/components/Toolbar/types.d.ts +28 -0
- package/components/Toolbar/types.js +1 -0
- package/components/Tooltip/Tooltip.d.ts +15 -0
- package/components/Tooltip/Tooltip.js +166 -0
- package/components/Tooltip/TooltipContext.d.ts +15 -0
- package/components/Tooltip/TooltipContext.js +25 -0
- package/components/Tooltip/index.d.ts +2 -0
- package/components/Tooltip/index.js +1 -0
- package/components/Tooltip/types.d.ts +85 -0
- package/components/Tooltip/types.js +8 -0
- package/components/index.d.ts +52 -0
- package/components/index.js +26 -0
- package/constants.d.ts +16 -0
- package/constants.js +16 -0
- package/icons/cred/index.d.ts +31 -0
- package/icons/cred/index.js +136 -0
- package/icons/icons.svg +155 -0
- package/icons/lms/index.d.ts +21 -0
- package/icons/lms/index.js +81 -0
- package/icons/manifest.json +1226 -0
- package/icons/player/index.d.ts +55 -0
- package/icons/player/index.js +268 -0
- package/icons/reaction/index.d.ts +79 -0
- package/icons/reaction/index.js +400 -0
- package/icons/registry.d.ts +316 -0
- package/icons/registry.js +163 -0
- package/icons/system/index.d.ts +155 -0
- package/icons/system/index.js +818 -0
- package/package.json +121 -0
- package/styles/all.css +1 -0
- package/styles/all.expanded.css +4137 -0
- package/styles/all.expanded.unlayered.css +4137 -0
- package/styles/all.unlayered.css +1 -0
- package/styles/components/_bundle.scss +51 -0
- package/styles/components/index.scss +1 -0
- package/styles/components/input/index.scss +248 -0
- package/styles/index.scss +71 -0
- package/styles/system/_constants.scss +12 -0
- package/styles/system/_motion.scss +47 -0
- package/styles/system/_palette-fns.scss +10 -0
- package/styles/system/_palettes.scss +80 -0
- package/styles/system/_tokens.scss +249 -0
- package/styles/system/index.scss +4 -0
- package/styles/utilities/_index.scss +373 -0
- package/tui-manifest.json +1858 -0
- package/types/index.d.ts +2 -0
- package/types/index.js +1 -0
- package/types/index.ts +2 -0
- package/types/sizes.d.ts +17 -0
- package/types/sizes.js +10 -0
- package/types/sizes.ts +21 -0
- package/types/svg.d.ts +5 -0
- package/types/themes.d.ts +14 -0
- package/types/themes.js +9 -0
- package/types/themes.ts +17 -0
- package/utils/color/contrast.d.ts +33 -0
- package/utils/color/contrast.js +88 -0
- package/utils/color-scheme.d.ts +25 -0
- package/utils/color-scheme.js +55 -0
- package/utils/compose-refs.d.ts +17 -0
- package/utils/compose-refs.js +38 -0
- package/utils/cx.d.ts +12 -0
- package/utils/cx.js +14 -0
- package/utils/focus-trap.d.ts +40 -0
- package/utils/focus-trap.js +93 -0
- package/utils/index.d.ts +10 -0
- package/utils/index.js +16 -0
- package/utils/math.d.ts +4 -0
- package/utils/math.js +19 -0
- package/utils/merge-props.d.ts +25 -0
- package/utils/merge-props.js +60 -0
- package/utils/polymorphic.d.ts +28 -0
- package/utils/polymorphic.js +44 -0
- package/utils/portal.d.ts +11 -0
- package/utils/portal.js +105 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
@use "./system" as sys with (
|
|
2
|
+
$prefix: tui-
|
|
3
|
+
);
|
|
4
|
+
@use "./components" as components;
|
|
5
|
+
@use "./utilities" as utilities;
|
|
6
|
+
|
|
7
|
+
@layer resets, defaults, components, utilities;
|
|
8
|
+
|
|
9
|
+
@include sys.emit-color-roles(sys.$prefix);
|
|
10
|
+
@include sys.emit-color-roles-dark(sys.$prefix);
|
|
11
|
+
@include sys.emit-color-roles-auto(sys.$prefix);
|
|
12
|
+
|
|
13
|
+
.#{sys.$prefix}interface {
|
|
14
|
+
--#{sys.$prefix}spacing-base: 4px;
|
|
15
|
+
@include sys.emit-spacing-primitives(#{sys.$prefix});
|
|
16
|
+
@include sys.emit-spacing-aliases(#{sys.$prefix});
|
|
17
|
+
|
|
18
|
+
--#{sys.$prefix}fontSize-multiplier: calc(1rem / 16);
|
|
19
|
+
@include sys.emit-fontsize-aliases(#{sys.$prefix});
|
|
20
|
+
|
|
21
|
+
--#{sys.$prefix}palette-color-white: #fff;
|
|
22
|
+
--#{sys.$prefix}palette-color-black: #000;
|
|
23
|
+
|
|
24
|
+
@include sys.emit-scale-vars(sys.$prefix, sys.$radius, sys.$font);
|
|
25
|
+
|
|
26
|
+
--#{sys.$prefix}typography-size: var(--#{sys.$prefix}font-size-base);
|
|
27
|
+
--#{sys.$prefix}typography-line-height: 1.4;
|
|
28
|
+
--#{sys.$prefix}typography-font-family: inherit;
|
|
29
|
+
--#{sys.$prefix}typography-color-base: currentColor;
|
|
30
|
+
--#{sys.$prefix}typography-color-contrast-high: var(--#{sys.$prefix}color-fg);
|
|
31
|
+
--#{sys.$prefix}typography-color-contrast-low: var(--#{sys.$prefix}color-fg-muted);
|
|
32
|
+
--#{sys.$prefix}typography-color-headings: var(--#{sys.$prefix}color-fg);
|
|
33
|
+
|
|
34
|
+
--#{sys.$prefix}shadow-color: 0, 0, 0;
|
|
35
|
+
--#{sys.$prefix}shadow-xs: 0 1px 2px rgba(var(--#{sys.$prefix}shadow-color), 0.05);
|
|
36
|
+
--#{sys.$prefix}shadow-sm: 0 1px 3px rgba(var(--#{sys.$prefix}shadow-color), 0.1),
|
|
37
|
+
0 1px 2px rgba(var(--#{sys.$prefix}shadow-color), 0.06);
|
|
38
|
+
--#{sys.$prefix}shadow-md: 0 4px 6px rgba(var(--#{sys.$prefix}shadow-color), 0.1),
|
|
39
|
+
0 2px 4px rgba(var(--#{sys.$prefix}shadow-color), 0.06);
|
|
40
|
+
--#{sys.$prefix}shadow-lg: 0 10px 15px rgba(var(--#{sys.$prefix}shadow-color), 0.1),
|
|
41
|
+
0 4px 6px rgba(var(--#{sys.$prefix}shadow-color), 0.05);
|
|
42
|
+
}
|
|
43
|
+
@layer resets {
|
|
44
|
+
.#{sys.$prefix}interface {
|
|
45
|
+
font-size: var(--#{sys.$prefix}typography-size);
|
|
46
|
+
line-height: var(--#{sys.$prefix}typography-line-height);
|
|
47
|
+
// Inherit host color by default for light mode integration.
|
|
48
|
+
// When data-theme is set, take over color scheme entirely.
|
|
49
|
+
color: inherit;
|
|
50
|
+
|
|
51
|
+
&[data-theme] {
|
|
52
|
+
color: var(--#{sys.$prefix}color-fg);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Button element reset — kill common theme button styling
|
|
56
|
+
button,
|
|
57
|
+
[type="button"],
|
|
58
|
+
[type="submit"],
|
|
59
|
+
[type="reset"] {
|
|
60
|
+
box-shadow: none;
|
|
61
|
+
text-transform: none;
|
|
62
|
+
letter-spacing: normal;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@layer components { @include components.bundle(); }
|
|
68
|
+
@layer utilities { @include utilities.bundle(); }
|
|
69
|
+
|
|
70
|
+
// Shared keyframes (must be outside layers for browser compatibility)
|
|
71
|
+
@include sys.keyframes();
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// SCSS Constants
|
|
3
|
+
//
|
|
4
|
+
// IMPORTANT: Keep in sync with src/constants.ts (TS source of truth).
|
|
5
|
+
// If you change $prefix here, update PREFIX in constants.ts.
|
|
6
|
+
// =============================================================================
|
|
7
|
+
|
|
8
|
+
$prefix: tui- !default;
|
|
9
|
+
$container-name: tuiContainer !default;
|
|
10
|
+
$radius: (xs: 2px, sm: 4px, md: 8px, lg: 12px) !default;
|
|
11
|
+
$space : (1: .25rem, 2: .5rem, 3: .75rem, 4: 1rem) !default;
|
|
12
|
+
$font : (base-size: 16px, line: 1.5) !default;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// Motion / Animation
|
|
3
|
+
// =============================================================================
|
|
4
|
+
//
|
|
5
|
+
// Shared keyframes and animation utilities.
|
|
6
|
+
// Components should @use this module to access animations.
|
|
7
|
+
//
|
|
8
|
+
// =============================================================================
|
|
9
|
+
|
|
10
|
+
@use "./constants" as c;
|
|
11
|
+
|
|
12
|
+
// -----------------------------------------------------------------------------
|
|
13
|
+
// Keyframes
|
|
14
|
+
// -----------------------------------------------------------------------------
|
|
15
|
+
|
|
16
|
+
/// Continuous rotation - used for loading spinners
|
|
17
|
+
@mixin keyframes() {
|
|
18
|
+
@keyframes #{c.$prefix}spin {
|
|
19
|
+
to {
|
|
20
|
+
transform: rotate(1turn);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@keyframes #{c.$prefix}fadeFromOpaque {
|
|
26
|
+
from {
|
|
27
|
+
opacity: 1;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@keyframes #{c.$prefix}fadeToOpaque {
|
|
32
|
+
to {
|
|
33
|
+
opacity: 1;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@keyframes #{c.$prefix}fadeFromTransparent {
|
|
38
|
+
from {
|
|
39
|
+
opacity: 0;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@keyframes #{c.$prefix}fadeToTransparent {
|
|
44
|
+
to {
|
|
45
|
+
opacity: 0;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@use "./_palettes.scss" as palettes;
|
|
3
|
+
|
|
4
|
+
@function tone($hue, $tier, $p: palettes.$palette) {
|
|
5
|
+
$scale: map.get($p, $hue);
|
|
6
|
+
@if $scale == null { @error "Unknown hue `#{$hue}`."; }
|
|
7
|
+
$value: map.get($scale, $tier);
|
|
8
|
+
@if $value == null { @error "Unknown tier `#{$tier}` for hue `#{$hue}`."; }
|
|
9
|
+
@return $value;
|
|
10
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
$palette: (
|
|
2
|
+
"gray": (
|
|
3
|
+
25: #fafafa,
|
|
4
|
+
50: #F9FAFB,
|
|
5
|
+
100: #F3F4F6,
|
|
6
|
+
200: #E5E7EB,
|
|
7
|
+
300: #D1D5DB,
|
|
8
|
+
400: #9CA3AF,
|
|
9
|
+
500: #6B7280,
|
|
10
|
+
600: #4B5563,
|
|
11
|
+
700: #374151,
|
|
12
|
+
800: #202836,
|
|
13
|
+
900: #111928,
|
|
14
|
+
),
|
|
15
|
+
"blue": (
|
|
16
|
+
25: #e2e9ff,
|
|
17
|
+
50: #c7d6ff,
|
|
18
|
+
100: #a0b5fe,
|
|
19
|
+
200: #7b93ff,
|
|
20
|
+
300: #5373f2,
|
|
21
|
+
400: #3858e9,
|
|
22
|
+
500: #2942d1,
|
|
23
|
+
600: #1d35b4,
|
|
24
|
+
700: #1b2398,
|
|
25
|
+
800: #101375,
|
|
26
|
+
900: #090949,
|
|
27
|
+
),
|
|
28
|
+
"green": (
|
|
29
|
+
25: #d8f3dc,
|
|
30
|
+
50: #b7e7be,
|
|
31
|
+
100: #68de7c,
|
|
32
|
+
200: #1ed14b,
|
|
33
|
+
300: #00ba37,
|
|
34
|
+
400: #00a32a,
|
|
35
|
+
500: #008a20,
|
|
36
|
+
600: #007017,
|
|
37
|
+
700: #005c12,
|
|
38
|
+
800: #00450c,
|
|
39
|
+
900: #003008,
|
|
40
|
+
),
|
|
41
|
+
"purple": (
|
|
42
|
+
25: #f9e6ff,
|
|
43
|
+
50: #eacaf3,
|
|
44
|
+
100: #dcb1e7,
|
|
45
|
+
200: #ce9adb,
|
|
46
|
+
300: #c184d0,
|
|
47
|
+
400: #a85fb8,
|
|
48
|
+
500: #9143a0,
|
|
49
|
+
600: #7a2f88,
|
|
50
|
+
700: #652071,
|
|
51
|
+
800: #4f1659,
|
|
52
|
+
900: #25082a,
|
|
53
|
+
),
|
|
54
|
+
"red": (
|
|
55
|
+
25: #fce3e5,
|
|
56
|
+
50: #facfd2,
|
|
57
|
+
100: #ffabaf,
|
|
58
|
+
200: #ff8085,
|
|
59
|
+
300: #f86368,
|
|
60
|
+
400: #e65054,
|
|
61
|
+
500: #d63638,
|
|
62
|
+
600: #b32d2e,
|
|
63
|
+
700: #8a2424,
|
|
64
|
+
800: #691c1c,
|
|
65
|
+
900: #451313,
|
|
66
|
+
),
|
|
67
|
+
"yellow": (
|
|
68
|
+
25: #f9f1d2,
|
|
69
|
+
50: #f5e6ab,
|
|
70
|
+
100: #f2d675,
|
|
71
|
+
200: #f0c33c,
|
|
72
|
+
300: #dba617,
|
|
73
|
+
400: #bd8600,
|
|
74
|
+
500: #996800,
|
|
75
|
+
600: #755100,
|
|
76
|
+
700: #614200,
|
|
77
|
+
800: #4a3200,
|
|
78
|
+
900: #362400,
|
|
79
|
+
),
|
|
80
|
+
) !default;
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
@use "sass:meta";
|
|
2
|
+
@use "sass:map";
|
|
3
|
+
@use "sass:math";
|
|
4
|
+
@use "sass:string";
|
|
5
|
+
@use "./_palette-fns" as pf;
|
|
6
|
+
|
|
7
|
+
// ----------------------
|
|
8
|
+
// Config
|
|
9
|
+
// ----------------------
|
|
10
|
+
$spacing-multiplier-default: 4 !default; // 1 step = 4px
|
|
11
|
+
$spacing-steps: 1 2 3 4 5 6 8 10 12 16 20 24 30 40 50 !default;
|
|
12
|
+
|
|
13
|
+
$font-multiplier-default: 16 !default; // baseline root px
|
|
14
|
+
$font-steps: 10 12 14 16 18 20 24 28 32 !default; // emitted primitives
|
|
15
|
+
$font-aliases: (xs:12, sm:14, md:16, lg:20, xl:24, xxl:32) !default;
|
|
16
|
+
$brand: 'blue';
|
|
17
|
+
|
|
18
|
+
// ----------------------
|
|
19
|
+
// Helpers
|
|
20
|
+
// ----------------------
|
|
21
|
+
@function _step($v) { @return if(math.is-unitless($v), $v, $v / 1px); }
|
|
22
|
+
|
|
23
|
+
@function _px-var($prefix, $ns, $px) {
|
|
24
|
+
$n: _step($px);
|
|
25
|
+
@return string.unquote('--' + $prefix + $ns + '-' + $n + 'px');
|
|
26
|
+
}
|
|
27
|
+
@mixin emit-color-roles($prefix:'#{$prefix}', $brand:'blue', $neutral:'gray') {
|
|
28
|
+
:where(.#{$prefix}interface) {
|
|
29
|
+
/* ========================
|
|
30
|
+
PRIMITIVES
|
|
31
|
+
======================== */
|
|
32
|
+
|
|
33
|
+
/* Motion */
|
|
34
|
+
--#{$prefix}motion-duration: 200ms;
|
|
35
|
+
--#{$prefix}motion-timing: ease-in-out;
|
|
36
|
+
|
|
37
|
+
/* Opacity */
|
|
38
|
+
--#{$prefix}opacity-disabled: 0.75;
|
|
39
|
+
--#{$prefix}opacity-backdrop: 0.5;
|
|
40
|
+
|
|
41
|
+
/* Focus Ring (a11y) */
|
|
42
|
+
--#{$prefix}focus-ring-width: 2px;
|
|
43
|
+
--#{$prefix}focus-ring-offset: 2px;
|
|
44
|
+
--#{$prefix}focus-ring-color: #2563eb;
|
|
45
|
+
|
|
46
|
+
/* Border */
|
|
47
|
+
--#{$prefix}border-width: 1px;
|
|
48
|
+
|
|
49
|
+
/* Z-Index Layers */
|
|
50
|
+
--#{$prefix}layer-surface: 0;
|
|
51
|
+
--#{$prefix}layer-elevated: 2;
|
|
52
|
+
--#{$prefix}layer-overlay: 100;
|
|
53
|
+
--#{$prefix}layer-modal: 1000;
|
|
54
|
+
--#{$prefix}layer-top: 9999;
|
|
55
|
+
|
|
56
|
+
/* ========================
|
|
57
|
+
COLORS
|
|
58
|
+
======================== */
|
|
59
|
+
|
|
60
|
+
/* Neutral: surfaces */
|
|
61
|
+
--#{$prefix}color-bg: #fff;
|
|
62
|
+
--#{$prefix}color-bg-surface: #{pf.tone($neutral, 25)};
|
|
63
|
+
--#{$prefix}color-bg-elevated: #fff;
|
|
64
|
+
--#{$prefix}color-bg-inverted: #{pf.tone($neutral, 900)};
|
|
65
|
+
--#{$prefix}color-bg-overlay: rgba(0, 0, 0, var(--#{$prefix}opacity-backdrop));
|
|
66
|
+
|
|
67
|
+
/* Neutral: text */
|
|
68
|
+
--#{$prefix}color-fg: #{pf.tone($neutral, 900)};
|
|
69
|
+
--#{$prefix}color-fg-muted: #{pf.tone($neutral, 500)};
|
|
70
|
+
--#{$prefix}color-fg-on-accent: #fff;
|
|
71
|
+
--#{$prefix}color-fg-inverted: #{pf.tone($neutral, 25)};
|
|
72
|
+
|
|
73
|
+
/* Neutral: borders/dividers */
|
|
74
|
+
--#{$prefix}color-border: #{pf.tone($neutral, 200)};
|
|
75
|
+
--#{$prefix}color-divider: #{pf.tone($neutral, 100)};
|
|
76
|
+
|
|
77
|
+
/* Primary */
|
|
78
|
+
--#{$prefix}theme-primary-strongest: #{pf.tone('blue', 900)};
|
|
79
|
+
--#{$prefix}theme-primary-stronger: #{pf.tone('blue', 700)};
|
|
80
|
+
--#{$prefix}theme-primary-strong: #{pf.tone('blue', 600)};
|
|
81
|
+
--#{$prefix}theme-primary-base: #{pf.tone('blue', 500)};
|
|
82
|
+
--#{$prefix}theme-primary-soft: #{pf.tone('blue', 200)};
|
|
83
|
+
--#{$prefix}theme-primary-subtle: #{pf.tone('blue', 50)};
|
|
84
|
+
--#{$prefix}theme-primary-subtlest: #{pf.tone('blue', 25)};
|
|
85
|
+
|
|
86
|
+
/* Secondary */
|
|
87
|
+
--#{$prefix}theme-secondary-strongest: #{pf.tone('gray', 900)};
|
|
88
|
+
--#{$prefix}theme-secondary-stronger: #{pf.tone('gray', 800)};
|
|
89
|
+
--#{$prefix}theme-secondary-strong: #{pf.tone('gray', 700)};
|
|
90
|
+
--#{$prefix}theme-secondary-base: #{pf.tone('gray', 500)};
|
|
91
|
+
--#{$prefix}theme-secondary-soft: #{pf.tone('gray', 400)};
|
|
92
|
+
--#{$prefix}theme-secondary-subtle: #{pf.tone('gray', 200)};
|
|
93
|
+
--#{$prefix}theme-secondary-subtlest: #{pf.tone('gray', 100)};
|
|
94
|
+
|
|
95
|
+
/* Success */
|
|
96
|
+
--#{$prefix}theme-success-strongest: #{pf.tone('green', 900)};
|
|
97
|
+
--#{$prefix}theme-success-stronger: #{pf.tone('green', 700)};
|
|
98
|
+
--#{$prefix}theme-success-strong: #{pf.tone('green', 600)};
|
|
99
|
+
--#{$prefix}theme-success-base: #{pf.tone('green', 500)};
|
|
100
|
+
--#{$prefix}theme-success-soft: #{pf.tone('green', 300)};
|
|
101
|
+
--#{$prefix}theme-success-subtle: #{pf.tone('green', 50)};
|
|
102
|
+
--#{$prefix}theme-success-subtlest: #{pf.tone('green', 25)};
|
|
103
|
+
|
|
104
|
+
/* Info */
|
|
105
|
+
--#{$prefix}theme-info-strongest: #{pf.tone('blue', 900)};
|
|
106
|
+
--#{$prefix}theme-info-stronger: #{pf.tone('blue', 700)};
|
|
107
|
+
--#{$prefix}theme-info-strong: #{pf.tone('blue', 600)};
|
|
108
|
+
--#{$prefix}theme-info-base: #{pf.tone('blue', 500)};
|
|
109
|
+
--#{$prefix}theme-info-soft: #{pf.tone('blue', 200)};
|
|
110
|
+
--#{$prefix}theme-info-subtle: #{pf.tone('blue', 50)};
|
|
111
|
+
--#{$prefix}theme-info-subtlest: #{pf.tone('blue', 25)};
|
|
112
|
+
|
|
113
|
+
/* Warning */
|
|
114
|
+
--#{$prefix}theme-warning-strongest: #{pf.tone('yellow', 900)};
|
|
115
|
+
--#{$prefix}theme-warning-stronger: #{pf.tone('yellow', 700)};
|
|
116
|
+
--#{$prefix}theme-warning-strong: #{pf.tone('yellow', 600)};
|
|
117
|
+
--#{$prefix}theme-warning-base: #{pf.tone('yellow', 500)};
|
|
118
|
+
--#{$prefix}theme-warning-soft: #{pf.tone('yellow', 300)};
|
|
119
|
+
--#{$prefix}theme-warning-subtle: #{pf.tone('yellow', 50)};
|
|
120
|
+
--#{$prefix}theme-warning-subtlest: #{pf.tone('yellow', 25)};
|
|
121
|
+
|
|
122
|
+
/* Danger */
|
|
123
|
+
--#{$prefix}theme-danger-strongest: #{pf.tone('red', 900)};
|
|
124
|
+
--#{$prefix}theme-danger-stronger: #{pf.tone('red', 700)};
|
|
125
|
+
--#{$prefix}theme-danger-strong: #{pf.tone('red', 600)};
|
|
126
|
+
--#{$prefix}theme-danger-base: #{pf.tone('red', 500)};
|
|
127
|
+
--#{$prefix}theme-danger-soft: #{pf.tone('red', 300)};
|
|
128
|
+
--#{$prefix}theme-danger-subtle: #{pf.tone('red', 50)};
|
|
129
|
+
--#{$prefix}theme-danger-subtlest: #{pf.tone('red', 25)};
|
|
130
|
+
|
|
131
|
+
/* A11y (legacy alias - prefer --focus-ring-color) */
|
|
132
|
+
--#{$prefix}color-focus-ring: var(--#{$prefix}focus-ring-color);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// ----------------------
|
|
137
|
+
// Dark Mode
|
|
138
|
+
// ----------------------
|
|
139
|
+
|
|
140
|
+
// Private: actual dark override declarations
|
|
141
|
+
@mixin _dark-overrides($prefix:'tui-', $brand:'blue', $neutral:'gray') {
|
|
142
|
+
/* Backgrounds */
|
|
143
|
+
--#{$prefix}color-bg: #{pf.tone($neutral, 900)};
|
|
144
|
+
--#{$prefix}color-bg-surface: #{pf.tone($neutral, 800)};
|
|
145
|
+
--#{$prefix}color-bg-elevated: #{pf.tone($neutral, 700)};
|
|
146
|
+
--#{$prefix}color-bg-inverted: #{pf.tone($neutral, 50)};
|
|
147
|
+
--#{$prefix}color-bg-overlay: rgba(0, 0, 0, 0.7);
|
|
148
|
+
|
|
149
|
+
/* Text */
|
|
150
|
+
--#{$prefix}color-fg: #{pf.tone($neutral, 50)};
|
|
151
|
+
--#{$prefix}color-fg-muted: #{pf.tone($neutral, 400)};
|
|
152
|
+
--#{$prefix}color-fg-on-accent: #fff;
|
|
153
|
+
--#{$prefix}color-fg-inverted: #{pf.tone($neutral, 900)};
|
|
154
|
+
|
|
155
|
+
/* Borders */
|
|
156
|
+
--#{$prefix}color-border: #{pf.tone($neutral, 700)};
|
|
157
|
+
--#{$prefix}color-divider: #{pf.tone($neutral, 800)};
|
|
158
|
+
|
|
159
|
+
/* Theme colors - adjust for dark mode contrast */
|
|
160
|
+
--#{$prefix}theme-primary-base: #{pf.tone($brand, 400)};
|
|
161
|
+
--#{$prefix}theme-primary-soft: #{pf.tone($brand, 500)};
|
|
162
|
+
--#{$prefix}theme-primary-strong: #{pf.tone($brand, 300)};
|
|
163
|
+
--#{$prefix}theme-primary-stronger: #{pf.tone($brand, 200)};
|
|
164
|
+
--#{$prefix}theme-primary-strongest: #{pf.tone($brand, 100)};
|
|
165
|
+
--#{$prefix}theme-primary-subtlest: #{pf.tone($brand, 900)};
|
|
166
|
+
--#{$prefix}theme-primary-subtle: #{pf.tone($brand, 800)};
|
|
167
|
+
|
|
168
|
+
/* Secondary */
|
|
169
|
+
--#{$prefix}theme-secondary-subtlest: #{pf.tone($neutral, 800)};
|
|
170
|
+
--#{$prefix}theme-secondary-subtle: #{pf.tone($neutral, 700)};
|
|
171
|
+
--#{$prefix}theme-secondary-soft: #{pf.tone($neutral, 600)};
|
|
172
|
+
--#{$prefix}theme-secondary-strong: #{pf.tone($neutral, 300)};
|
|
173
|
+
--#{$prefix}theme-secondary-stronger: #{pf.tone($neutral, 200)};
|
|
174
|
+
--#{$prefix}theme-secondary-strongest: #{pf.tone($neutral, 100)};
|
|
175
|
+
|
|
176
|
+
--#{$prefix}theme-success-base: #{pf.tone('green', 400)};
|
|
177
|
+
--#{$prefix}theme-success-strong: #{pf.tone('green', 300)};
|
|
178
|
+
--#{$prefix}theme-success-stronger: #{pf.tone('green', 200)};
|
|
179
|
+
--#{$prefix}theme-success-strongest: #{pf.tone('green', 100)};
|
|
180
|
+
--#{$prefix}theme-success-subtlest: #{pf.tone('green', 900)};
|
|
181
|
+
|
|
182
|
+
--#{$prefix}theme-warning-base: #{pf.tone('yellow', 400)};
|
|
183
|
+
--#{$prefix}theme-warning-strong: #{pf.tone('yellow', 300)};
|
|
184
|
+
--#{$prefix}theme-warning-stronger: #{pf.tone('yellow', 200)};
|
|
185
|
+
--#{$prefix}theme-warning-subtlest: #{pf.tone('yellow', 900)};
|
|
186
|
+
|
|
187
|
+
--#{$prefix}theme-danger-base: #{pf.tone('red', 400)};
|
|
188
|
+
--#{$prefix}theme-danger-strong: #{pf.tone('red', 300)};
|
|
189
|
+
--#{$prefix}theme-danger-stronger: #{pf.tone('red', 200)};
|
|
190
|
+
--#{$prefix}theme-danger-strongest: #{pf.tone('red', 100)};
|
|
191
|
+
--#{$prefix}theme-danger-subtlest: #{pf.tone('red', 900)};
|
|
192
|
+
|
|
193
|
+
/* Focus ring - brighter for dark backgrounds */
|
|
194
|
+
--#{$prefix}focus-ring-color: #{pf.tone($brand, 400)};
|
|
195
|
+
|
|
196
|
+
/* Shadows - more pronounced in dark mode */
|
|
197
|
+
--#{$prefix}shadow-color: 0, 0, 0;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// Public: explicit dark mode (data-theme="dark")
|
|
201
|
+
@mixin emit-color-roles-dark($prefix:'#{$prefix}', $brand:'blue', $neutral:'gray') {
|
|
202
|
+
:where(.#{$prefix}interface)[data-theme="dark"] {
|
|
203
|
+
@include _dark-overrides($prefix, $brand, $neutral);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// Public: auto mode - respects system preference (data-theme="auto")
|
|
208
|
+
@mixin emit-color-roles-auto($prefix:'#{$prefix}', $brand:'blue', $neutral:'gray') {
|
|
209
|
+
@media (prefers-color-scheme: dark) {
|
|
210
|
+
:where(.#{$prefix}interface)[data-theme="auto"] {
|
|
211
|
+
@include _dark-overrides($prefix, $brand, $neutral);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
@mixin emit-spacing-primitives($prefix, $steps: $spacing-steps) {
|
|
217
|
+
@each $n in $steps {
|
|
218
|
+
--#{$prefix}palette-spacing-#{$n}: calc(var(--#{$prefix}spacing-base) * #{$n});
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// Aliases → reference primitives (keeps one source of truth)
|
|
223
|
+
@mixin emit-spacing-aliases(
|
|
224
|
+
$prefix,
|
|
225
|
+
$aliases: (xxs:1, xs:2, sm:3, md:4, lg:6, xl:8, xxl:16)
|
|
226
|
+
) {
|
|
227
|
+
@each $name, $n in $aliases {
|
|
228
|
+
--#{$prefix}spacing-#{$name}: var(--#{$prefix}palette-spacing-#{$n});
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// ----------------------
|
|
233
|
+
// Font-size primitives
|
|
234
|
+
// --<prefix>palette-fontSize-16px: calc(16 * multiplier)
|
|
235
|
+
// ----------------------
|
|
236
|
+
@mixin emit-fontsize-aliases($prefix, $aliases: $font-aliases) {
|
|
237
|
+
@each $name, $px in $aliases {
|
|
238
|
+
--#{$prefix}typography-size-#{$name}: calc(#{$px} * var(--#{$prefix}fontSize-multiplier, calc(1rem / #{$font-multiplier-default})));
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// ----------------------
|
|
243
|
+
// Scale vars (optional convenience block)
|
|
244
|
+
// ----------------------
|
|
245
|
+
@mixin emit-scale-vars($prefix, $radius, $font) {
|
|
246
|
+
@each $k, $v in $radius { --#{$prefix}radius-#{$k}: #{$v}; }
|
|
247
|
+
--#{$prefix}font-size-base: #{map.get($font, base-size)};
|
|
248
|
+
--#{$prefix}line: #{map.get($font, line)};
|
|
249
|
+
}
|