@mrpelz/uikit-ish 7.8.0 → 7.10.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/dist/components/accordion/main.d.ts +12 -0
- package/dist/components/accordion/main.d.ts.map +1 -0
- package/dist/components/accordion/main.js +20 -0
- package/dist/components/accordion/main.js.map +1 -0
- package/dist/components/accordion/style.css +23 -0
- package/dist/components/action-sheet/main.d.ts +22 -16
- package/dist/components/action-sheet/main.d.ts.map +1 -1
- package/dist/components/action-sheet/main.js +89 -19
- package/dist/components/action-sheet/main.js.map +1 -1
- package/dist/components/action-sheet/props.d.ts +17 -5
- package/dist/components/action-sheet/props.d.ts.map +1 -1
- package/dist/components/action-sheet/style.css +24 -0
- package/dist/components/activity-view/main.d.ts +15 -4
- package/dist/components/activity-view/main.d.ts.map +1 -1
- package/dist/components/activity-view/main.js +27 -14
- package/dist/components/activity-view/main.js.map +1 -1
- package/dist/components/activity-view/props.d.ts +2 -10
- package/dist/components/activity-view/props.d.ts.map +1 -1
- package/dist/components/activity-view/style.css +29 -67
- package/dist/components/alert/main.d.ts +8 -7
- package/dist/components/alert/main.d.ts.map +1 -1
- package/dist/components/alert/main.js +32 -19
- package/dist/components/alert/main.js.map +1 -1
- package/dist/components/alert/props.d.ts +13 -2
- package/dist/components/alert/props.d.ts.map +1 -1
- package/dist/components/alert/style.css +36 -50
- package/dist/components/avatar/main.d.ts +5 -3
- package/dist/components/avatar/main.d.ts.map +1 -1
- package/dist/components/avatar/main.js +10 -8
- package/dist/components/avatar/main.js.map +1 -1
- package/dist/components/avatar/props.d.ts +4 -0
- package/dist/components/avatar/props.d.ts.map +1 -1
- package/dist/components/avatar/style.css +1 -7
- package/dist/components/badge/main.d.ts +3 -3
- package/dist/components/badge/main.d.ts.map +1 -1
- package/dist/components/badge/main.js +9 -9
- package/dist/components/badge/main.js.map +1 -1
- package/dist/components/badge/props.d.ts +4 -3
- package/dist/components/badge/props.d.ts.map +1 -1
- package/dist/components/badge/style.css +10 -4
- package/dist/components/button/main.d.ts.map +1 -1
- package/dist/components/button/main.js +15 -15
- package/dist/components/button/main.js.map +1 -1
- package/dist/components/button/props.d.ts +8 -8
- package/dist/components/button/props.d.ts.map +1 -1
- package/dist/components/button/style.css +37 -55
- package/dist/components/checkbox/main.d.ts.map +1 -1
- package/dist/components/checkbox/main.js +5 -7
- package/dist/components/checkbox/main.js.map +1 -1
- package/dist/components/checkbox/style.css +5 -8
- package/dist/components/collapsible/main.d.ts +9 -0
- package/dist/components/collapsible/main.d.ts.map +1 -0
- package/dist/components/collapsible/main.js +19 -0
- package/dist/components/collapsible/main.js.map +1 -0
- package/dist/components/collapsible/style.css +23 -0
- package/dist/components/color-picker/main.d.ts +27 -4
- package/dist/components/color-picker/main.d.ts.map +1 -1
- package/dist/components/color-picker/main.js +292 -110
- package/dist/components/color-picker/main.js.map +1 -1
- package/dist/components/color-picker/props.d.ts +64 -15
- package/dist/components/color-picker/props.d.ts.map +1 -1
- package/dist/components/color-picker/style.css +133 -65
- package/dist/components/contextual-menu/main.d.ts +11 -7
- package/dist/components/contextual-menu/main.d.ts.map +1 -1
- package/dist/components/contextual-menu/main.js +207 -202
- package/dist/components/contextual-menu/main.js.map +1 -1
- package/dist/components/contextual-menu/props.d.ts +21 -34
- package/dist/components/contextual-menu/props.d.ts.map +1 -1
- package/dist/components/contextual-menu/style.css +63 -34
- package/dist/components/date-picker/handle.d.ts +41 -0
- package/dist/components/date-picker/handle.d.ts.map +1 -0
- package/dist/components/date-picker/handle.js +47 -0
- package/dist/components/date-picker/handle.js.map +1 -0
- package/dist/components/date-picker/main.d.ts +31 -49
- package/dist/components/date-picker/main.d.ts.map +1 -1
- package/dist/components/date-picker/main.js +373 -178
- package/dist/components/date-picker/main.js.map +1 -1
- package/dist/components/date-picker/pager.d.ts +24 -0
- package/dist/components/date-picker/pager.d.ts.map +1 -0
- package/dist/components/date-picker/pager.js +307 -0
- package/dist/components/date-picker/pager.js.map +1 -0
- package/dist/components/date-picker/props.d.ts +98 -27
- package/dist/components/date-picker/props.d.ts.map +1 -1
- package/dist/components/date-picker/style.css +110 -118
- package/dist/components/drawer/main.d.ts +31 -0
- package/dist/components/drawer/main.d.ts.map +1 -0
- package/dist/components/drawer/main.js +119 -0
- package/dist/components/drawer/main.js.map +1 -0
- package/dist/components/drawer/props.d.ts +39 -0
- package/dist/components/drawer/props.d.ts.map +1 -0
- package/dist/components/drawer/props.js +2 -0
- package/dist/components/drawer/props.js.map +1 -0
- package/dist/components/drawer/style.css +135 -0
- package/dist/components/edit-menu/main.d.ts +7 -7
- package/dist/components/edit-menu/main.d.ts.map +1 -1
- package/dist/components/edit-menu/main.js +57 -40
- package/dist/components/edit-menu/main.js.map +1 -1
- package/dist/components/edit-menu/props.d.ts +14 -1
- package/dist/components/edit-menu/props.d.ts.map +1 -1
- package/dist/components/edit-menu/style.css +15 -8
- package/dist/components/form/main.d.ts +8 -0
- package/dist/components/form/main.d.ts.map +1 -1
- package/dist/components/form/main.js +18 -5
- package/dist/components/form/main.js.map +1 -1
- package/dist/components/form/props.d.ts +1 -2
- package/dist/components/form/props.d.ts.map +1 -1
- package/dist/components/glass/main.d.ts +1 -1
- package/dist/components/glass/main.js +4 -4
- package/dist/components/glass/main.js.map +1 -1
- package/dist/components/glass/props.d.ts +5 -5
- package/dist/components/glass/props.d.ts.map +1 -1
- package/dist/components/glass/style.css +176 -161
- package/dist/components/header/main.d.ts +5 -4
- package/dist/components/header/main.d.ts.map +1 -1
- package/dist/components/header/main.js +64 -34
- package/dist/components/header/main.js.map +1 -1
- package/dist/components/header/props.d.ts +2 -3
- package/dist/components/header/props.d.ts.map +1 -1
- package/dist/components/header/style.css +46 -65
- package/dist/components/index.d.ts +27 -23
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +17 -13
- package/dist/components/index.js.map +1 -1
- package/dist/components/layout/main.d.ts +2 -2
- package/dist/components/layout/main.d.ts.map +1 -1
- package/dist/components/layout/main.js +63 -167
- package/dist/components/layout/main.js.map +1 -1
- package/dist/components/layout/props.d.ts +2 -20
- package/dist/components/layout/props.d.ts.map +1 -1
- package/dist/components/layout/style.css +20 -91
- package/dist/components/list/main.d.ts +58 -10
- package/dist/components/list/main.d.ts.map +1 -1
- package/dist/components/list/main.js +1022 -465
- package/dist/components/list/main.js.map +1 -1
- package/dist/components/list/props.d.ts +211 -21
- package/dist/components/list/props.d.ts.map +1 -1
- package/dist/components/list/reorder.d.ts +146 -0
- package/dist/components/list/reorder.d.ts.map +1 -0
- package/dist/components/list/reorder.js +819 -0
- package/dist/components/list/reorder.js.map +1 -0
- package/dist/components/list/select.d.ts +6 -0
- package/dist/components/list/select.d.ts.map +1 -0
- package/dist/components/list/select.js +141 -0
- package/dist/components/list/select.js.map +1 -0
- package/dist/components/list/style.css +492 -507
- package/dist/components/list/swipe-actions-handle.d.ts +40 -0
- package/dist/components/list/swipe-actions-handle.d.ts.map +1 -0
- package/dist/components/list/swipe-actions-handle.js +51 -0
- package/dist/components/list/swipe-actions-handle.js.map +1 -0
- package/dist/components/menu/main.d.ts +102 -32
- package/dist/components/menu/main.d.ts.map +1 -1
- package/dist/components/menu/main.js +510 -99
- package/dist/components/menu/main.js.map +1 -1
- package/dist/components/menu/props.d.ts +5 -5
- package/dist/components/menu/props.d.ts.map +1 -1
- package/dist/components/menu/style.css +35 -43
- package/dist/components/navigation/main.d.ts +14 -2
- package/dist/components/navigation/main.d.ts.map +1 -1
- package/dist/components/navigation/main.js +437 -119
- package/dist/components/navigation/main.js.map +1 -1
- package/dist/components/navigation/props.d.ts +53 -3
- package/dist/components/navigation/props.d.ts.map +1 -1
- package/dist/components/navigation/style.css +56 -9
- package/dist/components/page/main.d.ts.map +1 -1
- package/dist/components/page/main.js +13 -8
- package/dist/components/page/main.js.map +1 -1
- package/dist/components/page/props.d.ts +8 -0
- package/dist/components/page/props.d.ts.map +1 -1
- package/dist/components/page/style.css +39 -4
- package/dist/components/page-control/main.d.ts +2 -2
- package/dist/components/page-control/main.d.ts.map +1 -1
- package/dist/components/page-control/main.js +66 -32
- package/dist/components/page-control/main.js.map +1 -1
- package/dist/components/page-control/props.d.ts +10 -2
- package/dist/components/page-control/props.d.ts.map +1 -1
- package/dist/components/page-control/style.css +7 -2
- package/dist/components/popover/main.d.ts +11 -6
- package/dist/components/popover/main.d.ts.map +1 -1
- package/dist/components/popover/main.js +63 -38
- package/dist/components/popover/main.js.map +1 -1
- package/dist/components/popover/props.d.ts +7 -6
- package/dist/components/popover/props.d.ts.map +1 -1
- package/dist/components/popover/style.css +54 -4
- package/dist/components/progress/main.d.ts +2 -3
- package/dist/components/progress/main.d.ts.map +1 -1
- package/dist/components/progress/main.js +148 -29
- package/dist/components/progress/main.js.map +1 -1
- package/dist/components/progress/props.d.ts +43 -9
- package/dist/components/progress/props.d.ts.map +1 -1
- package/dist/components/progress/style.css +82 -50
- package/dist/components/roll/main.d.ts +1 -1
- package/dist/components/roll/main.d.ts.map +1 -1
- package/dist/components/roll/main.js +90 -34
- package/dist/components/roll/main.js.map +1 -1
- package/dist/components/roll/props.d.ts +25 -8
- package/dist/components/roll/props.d.ts.map +1 -1
- package/dist/components/roll/style.css +12 -24
- package/dist/components/segmented/main.d.ts.map +1 -1
- package/dist/components/segmented/main.js +47 -30
- package/dist/components/segmented/main.js.map +1 -1
- package/dist/components/segmented/style.css +16 -23
- package/dist/components/sheet/main.d.ts +25 -15
- package/dist/components/sheet/main.d.ts.map +1 -1
- package/dist/components/sheet/main.js +66 -78
- package/dist/components/sheet/main.js.map +1 -1
- package/dist/components/sheet/props.d.ts +37 -3
- package/dist/components/sheet/props.d.ts.map +1 -1
- package/dist/components/sheet/style.css +183 -45
- package/dist/components/sidebar/main.d.ts.map +1 -1
- package/dist/components/sidebar/main.js +9 -13
- package/dist/components/sidebar/main.js.map +1 -1
- package/dist/components/sidebar/style.css +20 -14
- package/dist/components/slider/main.d.ts.map +1 -1
- package/dist/components/slider/main.js +23 -22
- package/dist/components/slider/main.js.map +1 -1
- package/dist/components/slider/props.d.ts +1 -2
- package/dist/components/slider/props.d.ts.map +1 -1
- package/dist/components/slider/style.css +27 -53
- package/dist/components/stepper/main.d.ts +4 -6
- package/dist/components/stepper/main.d.ts.map +1 -1
- package/dist/components/stepper/main.js +29 -25
- package/dist/components/stepper/main.js.map +1 -1
- package/dist/components/stepper/style.css +12 -16
- package/dist/components/switch/main.d.ts.map +1 -1
- package/dist/components/switch/main.js +40 -28
- package/dist/components/switch/main.js.map +1 -1
- package/dist/components/switch/props.d.ts +7 -5
- package/dist/components/switch/props.d.ts.map +1 -1
- package/dist/components/switch/style.css +40 -17
- package/dist/components/symbol/main.d.ts +2 -2
- package/dist/components/symbol/main.d.ts.map +1 -1
- package/dist/components/symbol/main.js +36 -28
- package/dist/components/symbol/main.js.map +1 -1
- package/dist/components/symbol/props.d.ts +39 -4
- package/dist/components/symbol/props.d.ts.map +1 -1
- package/dist/components/symbol/style.css +26 -5
- package/dist/components/tab-bar/main.d.ts +2 -2
- package/dist/components/tab-bar/main.d.ts.map +1 -1
- package/dist/components/tab-bar/main.js +133 -101
- package/dist/components/tab-bar/main.js.map +1 -1
- package/dist/components/tab-bar/props.d.ts +6 -6
- package/dist/components/tab-bar/props.d.ts.map +1 -1
- package/dist/components/tab-bar/style.css +113 -99
- package/dist/components/text-field/main.d.ts +3 -2
- package/dist/components/text-field/main.d.ts.map +1 -1
- package/dist/components/text-field/main.js +29 -30
- package/dist/components/text-field/main.js.map +1 -1
- package/dist/components/text-field/props.d.ts +23 -1
- package/dist/components/text-field/props.d.ts.map +1 -1
- package/dist/components/text-field/style.css +122 -82
- package/dist/components/toolbar/main.js +27 -27
- package/dist/components/toolbar/main.js.map +1 -1
- package/dist/components/toolbar/props.d.ts +10 -4
- package/dist/components/toolbar/props.d.ts.map +1 -1
- package/dist/components/toolbar/style.css +39 -33
- package/dist/components/tooltip/main.d.ts +10 -9
- package/dist/components/tooltip/main.d.ts.map +1 -1
- package/dist/components/tooltip/main.js +39 -10
- package/dist/components/tooltip/main.js.map +1 -1
- package/dist/components/tooltip/props.d.ts +2 -0
- package/dist/components/tooltip/props.d.ts.map +1 -1
- package/dist/components/tooltip/style.css +16 -16
- package/dist/components/typography/main.d.ts +2 -2
- package/dist/components/typography/main.d.ts.map +1 -1
- package/dist/components/typography/main.js +24 -16
- package/dist/components/typography/main.js.map +1 -1
- package/dist/components/typography/props.d.ts +11 -18
- package/dist/components/typography/props.d.ts.map +1 -1
- package/dist/components/typography/style.css +503 -623
- package/dist/components/utils/main.d.ts +78 -8
- package/dist/components/utils/main.d.ts.map +1 -1
- package/dist/components/utils/main.js +235 -16
- package/dist/components/utils/main.js.map +1 -1
- package/dist/components/utils/props.d.ts +27 -4
- package/dist/components/utils/props.d.ts.map +1 -1
- package/dist/components/utils/style.css +31 -18
- package/dist/components/viewport/edge-effect.d.ts +10 -0
- package/dist/components/viewport/edge-effect.d.ts.map +1 -0
- package/dist/components/viewport/edge-effect.js +100 -0
- package/dist/components/viewport/edge-effect.js.map +1 -0
- package/dist/components/viewport/edge.d.ts +39 -0
- package/dist/components/viewport/edge.d.ts.map +1 -0
- package/dist/components/viewport/edge.js +151 -0
- package/dist/components/viewport/edge.js.map +1 -0
- package/dist/components/viewport/input.d.ts +39 -0
- package/dist/components/viewport/input.d.ts.map +1 -0
- package/dist/components/viewport/input.js +280 -0
- package/dist/components/viewport/input.js.map +1 -0
- package/dist/components/viewport/main.d.ts +47 -9
- package/dist/components/viewport/main.d.ts.map +1 -1
- package/dist/components/viewport/main.js +745 -86
- package/dist/components/viewport/main.js.map +1 -1
- package/dist/components/viewport/padding.d.ts +78 -0
- package/dist/components/viewport/padding.d.ts.map +1 -0
- package/dist/components/viewport/padding.js +321 -0
- package/dist/components/viewport/padding.js.map +1 -0
- package/dist/components/viewport/props.d.ts +220 -11
- package/dist/components/viewport/props.d.ts.map +1 -1
- package/dist/components/viewport/style.css +377 -6
- package/dist/main.d.ts +0 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js.map +1 -1
- package/dist/styles.css +318 -302
- package/dist/styles.d.ts +2 -1
- package/dist/styles.d.ts.map +1 -1
- package/dist/styles.js +2 -1
- package/dist/styles.js.map +1 -1
- package/package.json +8 -16
|
@@ -2,13 +2,19 @@
|
|
|
2
2
|
/* stylelint-disable no-descending-specificity -- (Overrides by repeated
|
|
3
3
|
classes: see the collapsed styles.) */
|
|
4
4
|
@layer uikit-ish {
|
|
5
|
+
/* Its own formatting context: containing its list's margin (the room for
|
|
6
|
+
an accessory above the groups, see List) in any container, not only as
|
|
7
|
+
a flex or grid item. */
|
|
8
|
+
.uikit-tab-bar-root {
|
|
9
|
+
display: flow-root;
|
|
10
|
+
}
|
|
11
|
+
|
|
5
12
|
.uikit-tab-bar-tabs {
|
|
6
13
|
position: relative;
|
|
7
14
|
display: flex;
|
|
8
15
|
align-items: center;
|
|
9
16
|
border-radius: 100px;
|
|
10
17
|
overscroll-behavior-x: contain;
|
|
11
|
-
scrollbar-width: none;
|
|
12
18
|
touch-action: none;
|
|
13
19
|
|
|
14
20
|
&[data-overflowing] {
|
|
@@ -44,18 +50,7 @@
|
|
|
44
50
|
);
|
|
45
51
|
mix-blend-mode: var(--uikit-symbol-blend);
|
|
46
52
|
scale: var(--uikit-symbol-scale);
|
|
47
|
-
|
|
48
|
-
stroke-linejoin: round;
|
|
49
|
-
stroke-width: max(
|
|
50
|
-
0px,
|
|
51
|
-
(var(--uikit-tab-bar-icon-weight) - 400) / 326 * 1px
|
|
52
|
-
);
|
|
53
|
-
transition: scale var(--glass-ios-lens-duration);
|
|
54
|
-
|
|
55
|
-
--uikit-symbol-thinning: max(
|
|
56
|
-
0px,
|
|
57
|
-
(400 - var(--uikit-tab-bar-icon-weight)) / 326 * 1px
|
|
58
|
-
);
|
|
53
|
+
transition: scale var(--glass-ui-lens-duration);
|
|
59
54
|
|
|
60
55
|
&:has(> .uikit-symbol) {
|
|
61
56
|
mix-blend-mode: normal;
|
|
@@ -69,26 +64,16 @@
|
|
|
69
64
|
opacity: calc(
|
|
70
65
|
var(--uikit-glass-fade, 1) * var(--uikit-tab-bar-tab-fade, 1)
|
|
71
66
|
);
|
|
72
|
-
transition-duration: var(--glass-
|
|
67
|
+
transition-duration: var(--glass-ui-lens-duration);
|
|
73
68
|
transition-property: opacity, scale;
|
|
74
69
|
}
|
|
75
70
|
|
|
76
71
|
[data-active] > & {
|
|
77
72
|
--uikit-symbol-blend: normal;
|
|
73
|
+
--uikit-symbol-emphasis: 1;
|
|
78
74
|
|
|
79
75
|
font-variation-settings: 'wght' var(--uikit-tab-bar-icon-active-weight);
|
|
80
76
|
font-weight: round(down, var(--uikit-tab-bar-icon-active-weight), 100);
|
|
81
|
-
stroke: currentcolor;
|
|
82
|
-
stroke-linejoin: round;
|
|
83
|
-
stroke-width: max(
|
|
84
|
-
0px,
|
|
85
|
-
(var(--uikit-tab-bar-icon-active-weight) - 400) / 326 * 1px
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
--uikit-symbol-thinning: max(
|
|
89
|
-
0px,
|
|
90
|
-
(400 - var(--uikit-tab-bar-icon-active-weight)) / 326 * 1px
|
|
91
|
-
);
|
|
92
77
|
}
|
|
93
78
|
}
|
|
94
79
|
|
|
@@ -105,14 +90,14 @@
|
|
|
105
90
|
mix-blend-mode: var(--uikit-glass-content-blend);
|
|
106
91
|
scale: var(--uikit-tab-bar-content-scale, none);
|
|
107
92
|
text-align: center;
|
|
108
|
-
transition-duration: var(--glass-
|
|
93
|
+
transition-duration: var(--glass-ui-lens-duration);
|
|
109
94
|
transition-property: scale, width, height, opacity;
|
|
110
95
|
|
|
111
96
|
& > * {
|
|
112
97
|
opacity: calc(
|
|
113
98
|
var(--uikit-glass-fade, 1) * var(--uikit-tab-bar-tab-fade, 1)
|
|
114
99
|
);
|
|
115
|
-
transition: opacity var(--glass-
|
|
100
|
+
transition: opacity var(--glass-ui-lens-duration);
|
|
116
101
|
}
|
|
117
102
|
|
|
118
103
|
[data-active] > & {
|
|
@@ -125,23 +110,13 @@
|
|
|
125
110
|
font-variation-settings: 'wght' 510;
|
|
126
111
|
font-weight: round(down, 510, 100);
|
|
127
112
|
grid-area: 1 / 1;
|
|
128
|
-
stroke: currentcolor;
|
|
129
|
-
stroke-linejoin: round;
|
|
130
|
-
stroke-width: max(0px, (510 - 400) / 326 * 1px);
|
|
131
113
|
text-overflow: var(--uikit-tab-bar-label-overflow, ellipsis);
|
|
132
114
|
white-space: nowrap;
|
|
133
115
|
|
|
134
|
-
--uikit-symbol-thinning: max(0px, (400 - 510) / 326 * 1px);
|
|
135
|
-
|
|
136
116
|
[data-active] > * > & {
|
|
137
117
|
font-size: var(--uikit-tab-bar-label-active-size);
|
|
138
118
|
font-variation-settings: 'wght' 700;
|
|
139
119
|
font-weight: round(down, 700, 100);
|
|
140
|
-
stroke: currentcolor;
|
|
141
|
-
stroke-linejoin: round;
|
|
142
|
-
stroke-width: max(0px, (700 - 400) / 326 * 1px);
|
|
143
|
-
|
|
144
|
-
--uikit-symbol-thinning: max(0px, (400 - 700) / 326 * 1px);
|
|
145
120
|
}
|
|
146
121
|
}
|
|
147
122
|
|
|
@@ -151,14 +126,9 @@
|
|
|
151
126
|
font-variation-settings: 'wght' 700;
|
|
152
127
|
font-weight: round(down, 700, 100);
|
|
153
128
|
grid-area: 1 / 1;
|
|
154
|
-
stroke: currentcolor;
|
|
155
|
-
stroke-linejoin: round;
|
|
156
|
-
stroke-width: max(0px, (700 - 400) / 326 * 1px);
|
|
157
129
|
text-overflow: var(--uikit-tab-bar-label-overflow, ellipsis);
|
|
158
130
|
visibility: hidden;
|
|
159
131
|
white-space: nowrap;
|
|
160
|
-
|
|
161
|
-
--uikit-symbol-thinning: max(0px, (400 - 700) / 326 * 1px);
|
|
162
132
|
}
|
|
163
133
|
|
|
164
134
|
.uikit-tab-bar-accessory-content {
|
|
@@ -171,12 +141,15 @@
|
|
|
171
141
|
align-self: stretch;
|
|
172
142
|
border-radius: inherit;
|
|
173
143
|
gap: 12px;
|
|
174
|
-
|
|
144
|
+
|
|
145
|
+
/* (Shrinking with the accessory: hidden, 0px wide, it overflows nothing,
|
|
146
|
+
e.g. a page on a phone.) */
|
|
147
|
+
padding-inline: min(16px, 50%);
|
|
175
148
|
white-space: nowrap;
|
|
176
149
|
|
|
177
150
|
& > * {
|
|
178
151
|
opacity: var(--uikit-glass-fade, 1);
|
|
179
|
-
transition: opacity var(--glass-
|
|
152
|
+
transition: opacity var(--glass-ui-lens-duration);
|
|
180
153
|
}
|
|
181
154
|
}
|
|
182
155
|
|
|
@@ -192,14 +165,14 @@
|
|
|
192
165
|
opacity: var(--uikit-tab-bar-pressed, 0);
|
|
193
166
|
pointer-events: none;
|
|
194
167
|
scale: calc(
|
|
195
|
-
1 + (var(--glass-
|
|
168
|
+
1 + (var(--glass-ui-lens-scale) - 1) * var(--uikit-tab-bar-pressed, 0)
|
|
196
169
|
);
|
|
197
170
|
transition-duration:
|
|
198
|
-
var(--uikit-tab-bar-lens-move-duration, var(--glass-
|
|
199
|
-
var(--uikit-tab-bar-lens-move-duration, var(--glass-
|
|
200
|
-
var(--uikit-tab-bar-lens-size-duration, var(--glass-
|
|
201
|
-
var(--uikit-tab-bar-lens-size-duration, var(--glass-
|
|
202
|
-
var(--glass-
|
|
171
|
+
var(--uikit-tab-bar-lens-move-duration, var(--glass-ui-lens-duration)),
|
|
172
|
+
var(--uikit-tab-bar-lens-move-duration, var(--glass-ui-lens-duration)),
|
|
173
|
+
var(--uikit-tab-bar-lens-size-duration, var(--glass-ui-lens-duration)),
|
|
174
|
+
var(--uikit-tab-bar-lens-size-duration, var(--glass-ui-lens-duration)),
|
|
175
|
+
var(--glass-ui-lens-duration), var(--glass-ui-lens-duration);
|
|
203
176
|
transition-property:
|
|
204
177
|
--uikit-tab-bar-lens-x, --uikit-tab-bar-lens-y,
|
|
205
178
|
--uikit-tab-bar-lens-width, --uikit-tab-bar-lens-height, opacity, scale;
|
|
@@ -244,11 +217,11 @@
|
|
|
244
217
|
);
|
|
245
218
|
transform: scale(
|
|
246
219
|
calc(
|
|
247
|
-
1 + (var(--glass-
|
|
220
|
+
1 + (var(--glass-ui-lens-scale) - 1) *
|
|
248
221
|
var(--uikit-tab-bar-pressed, 0)
|
|
249
222
|
)
|
|
250
223
|
);
|
|
251
|
-
transition-duration: var(--glass-
|
|
224
|
+
transition-duration: var(--glass-ui-lens-duration);
|
|
252
225
|
}
|
|
253
226
|
}
|
|
254
227
|
|
|
@@ -278,9 +251,10 @@
|
|
|
278
251
|
gap: var(--uikit-tab-bar-tab-gap);
|
|
279
252
|
margin-inline-end: var(--uikit-tab-bar-tab-overlap);
|
|
280
253
|
text-align: center;
|
|
281
|
-
transition-duration: var(--glass-
|
|
254
|
+
transition-duration: var(--glass-ui-lens-duration);
|
|
282
255
|
transition-property:
|
|
283
256
|
width, min-width, min-height, padding, margin, gap, visibility;
|
|
257
|
+
-webkit-user-select: none;
|
|
284
258
|
user-select: none;
|
|
285
259
|
|
|
286
260
|
@media (hover: hover) {
|
|
@@ -293,10 +267,10 @@
|
|
|
293
267
|
opacity: calc(
|
|
294
268
|
var(--uikit-glass-fade, 1) * var(--uikit-tab-bar-tab-fade, 1)
|
|
295
269
|
);
|
|
296
|
-
transition: opacity var(--glass-
|
|
270
|
+
transition: opacity var(--glass-ui-lens-duration);
|
|
297
271
|
}
|
|
298
272
|
|
|
299
|
-
/* Symbol only: a circle (
|
|
273
|
+
/* Symbol only: a circle (compact) or a capsule hugging it (regular) */
|
|
300
274
|
&:not(:has(> [data-tab-bar-part='label'])) {
|
|
301
275
|
width: auto;
|
|
302
276
|
flex-shrink: 0;
|
|
@@ -318,7 +292,7 @@
|
|
|
318
292
|
margin-inline-end: 0;
|
|
319
293
|
}
|
|
320
294
|
|
|
321
|
-
/* Symbol only (
|
|
295
|
+
/* Symbol only (regular: 50×36) */
|
|
322
296
|
&&&:where([data-shape='capsule']):not(:has(> [data-tab-bar-part='label'])) {
|
|
323
297
|
padding: var(--uikit-tab-bar-symbol-padding);
|
|
324
298
|
}
|
|
@@ -344,7 +318,7 @@
|
|
|
344
318
|
}
|
|
345
319
|
|
|
346
320
|
&[data-active] {
|
|
347
|
-
color: var(--uikit-tab-bar-active-color, var(--color-
|
|
321
|
+
color: var(--uikit-tab-bar-active-color, var(--color-ui-primary));
|
|
348
322
|
}
|
|
349
323
|
|
|
350
324
|
&[data-disabled] {
|
|
@@ -416,12 +390,12 @@
|
|
|
416
390
|
--uikit-tab-bar-collapsed-label-extent: auto;
|
|
417
391
|
--uikit-tab-bar-collapsed-label-opacity: 1;
|
|
418
392
|
--uikit-tab-bar-collapsed-symbol: flex;
|
|
419
|
-
--uikit-tab-bar-collapsed-icon-size: var(--font-
|
|
393
|
+
--uikit-tab-bar-collapsed-icon-size: var(--font-ui-subheadline-size);
|
|
420
394
|
--uikit-tab-bar-collapsed-icon-line-height: var(
|
|
421
|
-
--font-
|
|
395
|
+
--font-ui-subheadline-line-height
|
|
422
396
|
);
|
|
423
397
|
--uikit-tab-bar-collapsed-icon-letter-spacing: var(
|
|
424
|
-
--font-
|
|
398
|
+
--font-ui-subheadline-tracking
|
|
425
399
|
);
|
|
426
400
|
}
|
|
427
401
|
|
|
@@ -464,20 +438,27 @@
|
|
|
464
438
|
box-sizing: border-box;
|
|
465
439
|
border-radius: 100px;
|
|
466
440
|
color: var(--uikit-glass-content);
|
|
467
|
-
font-size: var(--font-
|
|
468
|
-
letter-spacing: var(--font-
|
|
469
|
-
line-height: var(--font-
|
|
470
|
-
transition-duration: var(--glass-ios-lens-duration);
|
|
471
|
-
transition-property: visibility;
|
|
441
|
+
font-size: var(--font-ui-subheadline-size);
|
|
442
|
+
letter-spacing: var(--font-ui-subheadline-tracking);
|
|
443
|
+
line-height: var(--font-ui-subheadline-line-height);
|
|
472
444
|
|
|
473
|
-
/* Hidden in the state it isn't shown in (see visibleIn), fading
|
|
445
|
+
/* Hidden in the state it isn't shown in (see visibleIn), fading (shown
|
|
446
|
+
at once: e.g. its field focused right away). */
|
|
474
447
|
&[data-visible-in='expanded'][data-collapsed],
|
|
475
448
|
&[data-visible-in='collapsed']:not([data-collapsed]) {
|
|
476
449
|
--uikit-glass-fade: 0;
|
|
477
450
|
|
|
478
451
|
pointer-events: none;
|
|
452
|
+
transition-duration: var(--glass-ui-lens-duration);
|
|
453
|
+
transition-property: visibility;
|
|
479
454
|
visibility: hidden;
|
|
480
455
|
}
|
|
456
|
+
|
|
457
|
+
/* A text field in it (e.g. a search field): its whole width. */
|
|
458
|
+
& > [data-text-field-part='root'] {
|
|
459
|
+
min-width: 0;
|
|
460
|
+
flex: 1 1 0;
|
|
461
|
+
}
|
|
481
462
|
}
|
|
482
463
|
|
|
483
464
|
.uikit-tab-bar-list {
|
|
@@ -486,13 +467,45 @@
|
|
|
486
467
|
box-sizing: border-box;
|
|
487
468
|
align-items: center;
|
|
488
469
|
justify-content: flex-start;
|
|
489
|
-
|
|
470
|
+
|
|
471
|
+
/* Its sides clear of the screen's rounded corners (32px); pushed up by
|
|
472
|
+
the keyboard (see Viewport.BlockEnd's `keyboard`), away from them, its
|
|
473
|
+
groups' glass as wide as a toolbar's (16px from the sides, as the
|
|
474
|
+
keyboard's own bar: the glass extends 4px beyond), collapsed too. */
|
|
475
|
+
--uikit-tab-bar-side: 32px;
|
|
476
|
+
|
|
477
|
+
/* (None below: the safe area, kept clear by its anchor, see Viewport.) */
|
|
478
|
+
padding: 16px var(--uikit-tab-bar-side) 0;
|
|
490
479
|
gap: var(--uikit-tab-bar-group-gap, 16px);
|
|
491
480
|
interpolate-size: allow-keywords;
|
|
492
481
|
touch-action: none;
|
|
493
|
-
transition-duration: var(--glass-
|
|
482
|
+
transition-duration: var(--glass-ui-lens-duration);
|
|
494
483
|
transition-property: padding, gap;
|
|
495
484
|
|
|
485
|
+
/* (Any keyboard height: 20px, collapsed without its inset; as the
|
|
486
|
+
padding transitions.) */
|
|
487
|
+
[data-keyboard='push'] > & {
|
|
488
|
+
--uikit-tab-bar-side: calc(
|
|
489
|
+
32px -
|
|
490
|
+
clamp(0px, var(--uikit-viewport-keyboard-inset, 0px) * 1000, 12px)
|
|
491
|
+
);
|
|
492
|
+
--uikit-tab-bar-collapsed-side-inset: calc(
|
|
493
|
+
var(--uikit-tab-bar-collapsed-inset) -
|
|
494
|
+
clamp(
|
|
495
|
+
0px,
|
|
496
|
+
var(--uikit-viewport-keyboard-inset, 0px) * 1000,
|
|
497
|
+
var(--uikit-tab-bar-collapsed-inset)
|
|
498
|
+
)
|
|
499
|
+
);
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
/* A single tab: nothing to choose, no selection (nor the active
|
|
503
|
+
tab's tint; pressed, its lens all the same). */
|
|
504
|
+
&[data-single-tab] {
|
|
505
|
+
--uikit-tab-bar-selection-shown: 0;
|
|
506
|
+
--uikit-tab-bar-active-color: currentcolor;
|
|
507
|
+
}
|
|
508
|
+
|
|
496
509
|
/* Room for its accessory above the groups (see placeAccessory), in the
|
|
497
510
|
bar's layout: its height and gap above the groups (at the padding),
|
|
498
511
|
also while collapsed (nothing moves): 40px high, 16px above. */
|
|
@@ -513,14 +526,14 @@
|
|
|
513
526
|
)
|
|
514
527
|
1 0;
|
|
515
528
|
content: '';
|
|
516
|
-
transition: margin var(--glass-
|
|
529
|
+
transition: margin var(--glass-ui-lens-duration);
|
|
517
530
|
}
|
|
518
531
|
|
|
519
532
|
&[data-wide]::before,
|
|
520
533
|
&[data-wide]::after {
|
|
521
534
|
transition:
|
|
522
|
-
margin var(--glass-
|
|
523
|
-
flex-grow var(--glass-
|
|
535
|
+
margin var(--glass-ui-lens-duration),
|
|
536
|
+
flex-grow var(--glass-ui-lens-duration);
|
|
524
537
|
}
|
|
525
538
|
|
|
526
539
|
&::before {
|
|
@@ -588,30 +601,30 @@
|
|
|
588
601
|
--uikit-tab-bar-pressed-group-scale: 1.065;
|
|
589
602
|
--uikit-tab-bar-collapsed-tab-height: 36px;
|
|
590
603
|
--uikit-tab-bar-collapsed-inset: 0px;
|
|
591
|
-
--uikit-tab-bar-icon-size: var(--font-
|
|
592
|
-
--uikit-tab-bar-icon-line-height: var(--font-
|
|
593
|
-
--uikit-tab-bar-icon-letter-spacing: var(--font-
|
|
604
|
+
--uikit-tab-bar-icon-size: var(--font-ui-subheadline-size);
|
|
605
|
+
--uikit-tab-bar-icon-line-height: var(--font-ui-subheadline-line-height);
|
|
606
|
+
--uikit-tab-bar-icon-letter-spacing: var(--font-ui-subheadline-tracking);
|
|
594
607
|
--uikit-tab-bar-icon-weight: 510;
|
|
595
608
|
--uikit-tab-bar-icon-active-weight: 700;
|
|
596
|
-
--uikit-tab-bar-label-size: var(--font-
|
|
609
|
+
--uikit-tab-bar-label-size: var(--font-ui-subheadline-size);
|
|
597
610
|
--uikit-tab-bar-label-active-size: 17px;
|
|
598
611
|
--uikit-tab-bar-label-line-height: var(
|
|
599
|
-
--font-
|
|
612
|
+
--font-ui-subheadline-line-height
|
|
600
613
|
);
|
|
601
614
|
--uikit-tab-bar-label-letter-spacing: var(
|
|
602
|
-
--font-
|
|
615
|
+
--font-ui-subheadline-tracking
|
|
603
616
|
);
|
|
604
617
|
|
|
605
618
|
/* Selected content in the regular size: the tint, or white on dim
|
|
606
619
|
glass. */
|
|
607
|
-
--uikit-tab-bar-active-color: light-dark(var(--color-
|
|
620
|
+
--uikit-tab-bar-active-color: light-dark(var(--color-ui-primary), #fff);
|
|
608
621
|
}
|
|
609
622
|
|
|
610
623
|
&:where([data-size='regular']):where(
|
|
611
624
|
[data-glass-context='bright'],
|
|
612
625
|
[data-glass-context='background-bright']
|
|
613
626
|
) {
|
|
614
|
-
--uikit-tab-bar-active-color: var(--color-
|
|
627
|
+
--uikit-tab-bar-active-color: var(--color-ui-primary);
|
|
615
628
|
}
|
|
616
629
|
|
|
617
630
|
&:where([data-size='regular']):where(
|
|
@@ -633,17 +646,23 @@
|
|
|
633
646
|
--uikit-tab-bar-label-min-width: 0;
|
|
634
647
|
|
|
635
648
|
padding: calc(16px + var(--uikit-tab-bar-collapsed-inset))
|
|
636
|
-
calc(
|
|
637
|
-
|
|
649
|
+
calc(
|
|
650
|
+
var(--uikit-tab-bar-side) +
|
|
651
|
+
var(
|
|
652
|
+
--uikit-tab-bar-collapsed-side-inset,
|
|
653
|
+
var(--uikit-tab-bar-collapsed-inset)
|
|
654
|
+
)
|
|
655
|
+
)
|
|
656
|
+
var(--uikit-tab-bar-collapsed-inset);
|
|
638
657
|
|
|
639
658
|
&& > div > [data-tab-bar-part='tabs'] > [role='tab'] {
|
|
640
|
-
--uikit-tab-bar-label-size: var(--font-
|
|
641
|
-
--uikit-tab-bar-label-active-size: var(--font-
|
|
659
|
+
--uikit-tab-bar-label-size: var(--font-ui-subheadline-size);
|
|
660
|
+
--uikit-tab-bar-label-active-size: var(--font-ui-subheadline-size);
|
|
642
661
|
--uikit-tab-bar-label-line-height: var(
|
|
643
|
-
--font-
|
|
662
|
+
--font-ui-subheadline-line-height
|
|
644
663
|
);
|
|
645
664
|
--uikit-tab-bar-label-letter-spacing: var(
|
|
646
|
-
--font-
|
|
665
|
+
--font-ui-subheadline-tracking
|
|
647
666
|
);
|
|
648
667
|
|
|
649
668
|
width: var(--uikit-tab-bar-collapsed-width);
|
|
@@ -684,11 +703,6 @@
|
|
|
684
703
|
> * {
|
|
685
704
|
font-variation-settings: 'wght' 510;
|
|
686
705
|
font-weight: round(down, 510, 100);
|
|
687
|
-
stroke: currentcolor;
|
|
688
|
-
stroke-linejoin: round;
|
|
689
|
-
stroke-width: max(0px, (510 - 400) / 326 * 1px);
|
|
690
|
-
|
|
691
|
-
--uikit-symbol-thinning: max(0px, (400 - 510) / 326 * 1px);
|
|
692
706
|
}
|
|
693
707
|
|
|
694
708
|
&&:where(:not([data-collapsed-content]))
|
|
@@ -764,12 +778,12 @@
|
|
|
764
778
|
--uikit-tab-bar-collapsed-label-extent: auto;
|
|
765
779
|
--uikit-tab-bar-collapsed-label-opacity: 1;
|
|
766
780
|
--uikit-tab-bar-collapsed-symbol: flex;
|
|
767
|
-
--uikit-tab-bar-collapsed-icon-size: var(--font-
|
|
781
|
+
--uikit-tab-bar-collapsed-icon-size: var(--font-ui-subheadline-size);
|
|
768
782
|
--uikit-tab-bar-collapsed-icon-line-height: var(
|
|
769
|
-
--font-
|
|
783
|
+
--font-ui-subheadline-line-height
|
|
770
784
|
);
|
|
771
785
|
--uikit-tab-bar-collapsed-icon-letter-spacing: var(
|
|
772
|
-
--font-
|
|
786
|
+
--font-ui-subheadline-tracking
|
|
773
787
|
);
|
|
774
788
|
}
|
|
775
789
|
}
|
|
@@ -790,7 +804,7 @@
|
|
|
790
804
|
border: 0 solid transparent;
|
|
791
805
|
grid-template-columns: minmax(0, max-content);
|
|
792
806
|
margin-inline: 0;
|
|
793
|
-
transition-duration: var(--glass-
|
|
807
|
+
transition-duration: var(--glass-ui-lens-duration);
|
|
794
808
|
transition-property:
|
|
795
809
|
min-width, min-height, margin, border-width, visibility;
|
|
796
810
|
|
|
@@ -802,7 +816,7 @@
|
|
|
802
816
|
}
|
|
803
817
|
|
|
804
818
|
/* Under the lens, the group grows: its glass and content scale up around
|
|
805
|
-
its center (
|
|
819
|
+
its center (compact 1.05, regular 1.065). Scaled layer
|
|
806
820
|
by layer, so nothing isolates their blending (see pressGroup). */
|
|
807
821
|
&[data-pressed] {
|
|
808
822
|
--uikit-glass-scale: var(--uikit-tab-bar-pressed-group-scale);
|
|
@@ -912,12 +926,12 @@
|
|
|
912
926
|
--uikit-tab-bar-collapsed-label-extent: auto;
|
|
913
927
|
--uikit-tab-bar-collapsed-label-opacity: 1;
|
|
914
928
|
--uikit-tab-bar-collapsed-symbol: flex;
|
|
915
|
-
--uikit-tab-bar-collapsed-icon-size: var(--font-
|
|
929
|
+
--uikit-tab-bar-collapsed-icon-size: var(--font-ui-subheadline-size);
|
|
916
930
|
--uikit-tab-bar-collapsed-icon-line-height: var(
|
|
917
|
-
--font-
|
|
931
|
+
--font-ui-subheadline-line-height
|
|
918
932
|
);
|
|
919
933
|
--uikit-tab-bar-collapsed-icon-letter-spacing: var(
|
|
920
|
-
--font-
|
|
934
|
+
--font-ui-subheadline-tracking
|
|
921
935
|
);
|
|
922
936
|
}
|
|
923
937
|
|
|
@@ -930,7 +944,7 @@
|
|
|
930
944
|
&&&&&&:where([data-selection-shown])
|
|
931
945
|
> [data-tab-bar-part='tabs']
|
|
932
946
|
> [role='tab'][data-active] {
|
|
933
|
-
color: var(--uikit-tab-bar-active-color, var(--color-
|
|
947
|
+
color: var(--uikit-tab-bar-active-color, var(--color-ui-primary));
|
|
934
948
|
}
|
|
935
949
|
}
|
|
936
950
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import '../glass/style.css';
|
|
1
2
|
import './style.css';
|
|
2
|
-
import type { ClearProps } from './props.js';
|
|
3
|
+
import type { ClearProps, SearchProps } from './props.js';
|
|
3
4
|
export declare const TextField: {
|
|
4
|
-
Search: import("preact").FunctionalComponent<import("react").PropsWithoutRef<
|
|
5
|
+
Search: import("preact").FunctionalComponent<import("react").PropsWithoutRef<SearchProps> & {
|
|
5
6
|
ref?: import("preact").Ref<HTMLLabelElement> | undefined;
|
|
6
7
|
}>;
|
|
7
8
|
Root: import("preact").FunctionalComponent<import("react").PropsWithoutRef<Omit<import("@base-ui/react/field").FieldRootProps, "ref">> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/components/text-field/main.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/components/text-field/main.tsx"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,aAAa,CAAC;AAcrB,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAoP1D,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;CASrB,CAAC"}
|
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import '../glass/style.css';
|
|
2
3
|
import './style.css';
|
|
3
4
|
import { Field as BaseField } from '@base-ui/react/field';
|
|
4
|
-
import { forwardRef, useId,
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
//
|
|
5
|
+
import { forwardRef, useId, useState, } from 'react';
|
|
6
|
+
import { GlassBackground } from '../glass/main.js';
|
|
7
|
+
import { cn, isKeyboardFocus } from '../utils/main.js';
|
|
8
|
+
// Text fields, light and dark, in the semantic colors: 52px rows (padding
|
|
9
|
+
// 0 16px),
|
|
8
10
|
// the value in 17px at 510 (20px line height, Body's tracking) in `label`,
|
|
9
11
|
// the placeholder in `placeholderText`, a 2px caret in the tint, the clear
|
|
10
|
-
// button (
|
|
11
|
-
//
|
|
12
|
+
// button (17px) in `tertiaryLabel` while focused and filled. Messages
|
|
13
|
+
// follow Framework7 (`components/input/input.less`,
|
|
12
14
|
// `input-ios.less`, `input-vars.less`): info (`Description`) and error
|
|
13
15
|
// messages in 12px below, invalid text in `systemRed`, disabled at 55%.
|
|
14
16
|
//
|
|
15
|
-
// A Base UI field
|
|
17
|
+
// A Base UI field: in a list row (`Root` rendering a
|
|
16
18
|
// `List.Item`), the label is the row's title and the control fills the rest
|
|
17
19
|
// of the row, the description and error below (see `List`); elsewhere, the
|
|
18
20
|
// parts stack. A textarea renders through `Control`'s `render`.
|
|
19
21
|
//
|
|
20
|
-
//
|
|
22
|
+
// Also:
|
|
21
23
|
// - No outlined style (Framework7 `.input-outline`).
|
|
22
|
-
// - Labels
|
|
23
|
-
//
|
|
24
|
+
// - Labels are inline in rows, in Body (Framework7's iOS theme: 12px labels
|
|
25
|
+
// above the input, `.item-label`); standalone,
|
|
24
26
|
// they're above, in Subheadline.
|
|
25
27
|
// - Info and errors are in Caption 1 (12/16px, Framework7: 12px, 1.4).
|
|
26
|
-
// - The caret is the browser's
|
|
27
|
-
// - The clear button is
|
|
28
|
-
//
|
|
28
|
+
// - The caret is the browser's.
|
|
29
|
+
// - The clear button is a circled cross, cut out of the circle, with a 44px
|
|
30
|
+
// hit area.
|
|
29
31
|
/** A field (Base UI); rendering a `List.Item`, a list row. */
|
|
30
32
|
const Root = forwardRef(({ className, ...props }, ref) => (_jsx(BaseField.Root, { ref: ref, "data-text-field-part": "root", ...props, className: cn('uikit-text-field-root', className) })));
|
|
31
33
|
const Label = forwardRef(({ className, ...props }, ref) => (_jsx(BaseField.Label, { ref: ref, "data-text-field-part": "label", ...props, className: cn('uikit-text-field-label', className) })));
|
|
@@ -45,11 +47,12 @@ const setValue = (control) => {
|
|
|
45
47
|
};
|
|
46
48
|
/**
|
|
47
49
|
* Empties the field's control (as typing would, so its change handlers run),
|
|
48
|
-
*
|
|
50
|
+
* focusing it; shown while it's filled, and (`mode`) while
|
|
51
|
+
* it's focused, while it isn't, or always.
|
|
49
52
|
*/
|
|
50
|
-
const Clear = forwardRef(({ className, children, onClick, onPointerDown, ...props }, ref) => {
|
|
53
|
+
const Clear = forwardRef(({ className, children, mode = 'whileEditing', onClick, onPointerDown, ...props }, ref) => {
|
|
51
54
|
const mask = useId();
|
|
52
|
-
return (_jsx("button", { ref: ref, "aria-label": "Clear text", "data-text-field-part": "clear", tabIndex: -1, type: "button", ...props, className: cn('uikit-text-field-clear', className), onClick: (event) => {
|
|
55
|
+
return (_jsx("button", { ref: ref, "aria-label": "Clear text", "data-mode": mode, "data-text-field-part": "clear", tabIndex: -1, type: "button", ...props, className: cn('uikit-text-field-clear', className), onClick: (event) => {
|
|
53
56
|
onClick?.(event);
|
|
54
57
|
if (event.defaultPrevented)
|
|
55
58
|
return;
|
|
@@ -66,31 +69,27 @@ const Clear = forwardRef(({ className, children, onClick, onPointerDown, ...prop
|
|
|
66
69
|
onPointerDown?.(event);
|
|
67
70
|
// The control keeps focus.
|
|
68
71
|
event.preventDefault();
|
|
69
|
-
}, children: children ?? (_jsxs("svg", { "aria-hidden": "true", height: "17", viewBox: "0 0 17 17", width: "17", children: [_jsxs("mask", { id: mask, children: [_jsx("rect", { fill: "#fff", height: "17", width: "17" }), _jsx("path", { d: "M5.5 5.5l6 6M11.5 5.5l-6 6", stroke: "#000", strokeLinecap: "round", strokeWidth: "1.6" })] }), _jsx("circle", { cx: "8.5", cy: "8.5", fill: "currentcolor", mask: `url(#${CSS.escape(mask)})`, r: "8.5" })] })) }));
|
|
72
|
+
}, children: children ?? (_jsxs("svg", { "aria-hidden": "true", height: "17", viewBox: "0 0 17 17", width: "17", children: [_jsxs("mask", { id: mask, children: [_jsx("rect", { fill: "#fff", height: "17", width: "17" }), _jsx("path", { d: "M5.5 5.5l6 6M11.5 5.5l-6 6", stroke: "#000", strokeLinecap: "round", strokeWidth: "1.6" })] }), _jsx("circle", { cx: "8.5", cy: "8.5", fill: "currentcolor", mask: `url(#${typeof CSS === 'object' ? CSS.escape(mask) : mask})`, r: "8.5" })] })) }));
|
|
70
73
|
});
|
|
71
74
|
/**
|
|
72
|
-
* A search field's capsule
|
|
75
|
+
* A search field's capsule: its symbol, a
|
|
73
76
|
* `TextField.Control` (e.g. `type="search"`), and its buttons.
|
|
74
77
|
*/
|
|
75
|
-
const Search = forwardRef(({ className, onBlur, onFocus,
|
|
76
|
-
// Focused by a pointer (pressed
|
|
77
|
-
|
|
78
|
-
const [
|
|
79
|
-
return (
|
|
78
|
+
const Search = forwardRef(({ children, className, onBlur, onFocus, variant = 'fill', ...props }, ref) => {
|
|
79
|
+
// Focused by keyboard, or by a pointer (pressed anywhere: also beside
|
|
80
|
+
// it, see `preventFocusShift`).
|
|
81
|
+
const [isKeyboard, setIsKeyboard] = useState(false);
|
|
82
|
+
return (_jsxs("label", { ref: ref, "data-keyboard-focus": isKeyboard ? '' : undefined, "data-text-field-part": "search", "data-variant": variant, onBlur: (event) => {
|
|
80
83
|
onBlur?.(event);
|
|
81
84
|
const { relatedTarget } = event;
|
|
82
85
|
if (!(relatedTarget instanceof Node) ||
|
|
83
86
|
!event.currentTarget.contains(relatedTarget)) {
|
|
84
|
-
|
|
87
|
+
setIsKeyboard(false);
|
|
85
88
|
}
|
|
86
89
|
}, onFocus: (event) => {
|
|
87
90
|
onFocus?.(event);
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}, onPointerDown: (event) => {
|
|
91
|
-
onPointerDown?.(event);
|
|
92
|
-
pressed.current = true;
|
|
93
|
-
}, ...props, className: cn('uikit-text-field-search', className) }));
|
|
91
|
+
setIsKeyboard(isKeyboardFocus());
|
|
92
|
+
}, ...props, className: cn('uikit-text-field-search', className), children: [variant === 'tab-bar' || variant === 'toolbar' ? (_jsx(GlassBackground, { kind: variant === 'toolbar' ? 'button' : 'bar' })) : null, children] }));
|
|
94
93
|
});
|
|
95
94
|
export const TextField = {
|
|
96
95
|
...BaseField,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/components/text-field/main.tsx"],"names":[],"mappings":";AAAA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/components/text-field/main.tsx"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EACL,UAAU,EAIV,KAAK,EACL,QAAQ,GACT,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,EAAE,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGvD,0EAA0E;AAC1E,WAAW;AACX,2EAA2E;AAC3E,2EAA2E;AAC3E,sEAAsE;AACtE,oDAAoD;AACpD,uEAAuE;AACvE,wEAAwE;AACxE,EAAE;AACF,qDAAqD;AACrD,4EAA4E;AAC5E,2EAA2E;AAC3E,gEAAgE;AAChE,EAAE;AACF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CAAC"}
|
|
@@ -1,3 +1,25 @@
|
|
|
1
1
|
import type { ComponentProps } from 'react';
|
|
2
|
-
export type ClearProps = Omit<ComponentProps<'button'>, 'ref'
|
|
2
|
+
export type ClearProps = Omit<ComponentProps<'button'>, 'ref'> & {
|
|
3
|
+
/**
|
|
4
|
+
* When it's shown, always only while the field
|
|
5
|
+
* is filled: while it's focused, while it isn't, or either way.
|
|
6
|
+
* @default 'whileEditing'
|
|
7
|
+
*/
|
|
8
|
+
mode?: 'always' | 'unlessEditing' | 'whileEditing';
|
|
9
|
+
};
|
|
10
|
+
/** A search field's look (see `SearchProps`). */
|
|
11
|
+
export type SearchVariant = 'fill' | 'row' | 'tab-bar' | 'tab-bar-collapsed' | 'toolbar';
|
|
12
|
+
export type SearchProps = Omit<ComponentProps<'label'>, 'ref'> & {
|
|
13
|
+
/**
|
|
14
|
+
* Its look: a capsule on the tertiary fill; a list row's look (inset
|
|
15
|
+
* grouped: its background, height and corners; not a row); a tab bar
|
|
16
|
+
* group's glass capsule, as high as its tabs (e.g. beside a
|
|
17
|
+
* `TabBar.Group`); or the collapsed tab bar's, no capsule of its own, on
|
|
18
|
+
* the glass it's in (e.g. a `TabBar.Accessory`'s, filling it); or a
|
|
19
|
+
* toolbar group's glass capsule, as high as its buttons (e.g. between a
|
|
20
|
+
* `Toolbar`'s buttons).
|
|
21
|
+
* @default 'fill'
|
|
22
|
+
*/
|
|
23
|
+
variant?: SearchVariant;
|
|
24
|
+
};
|
|
3
25
|
//# sourceMappingURL=props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/components/text-field/props.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/components/text-field/props.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,GAAG;IAC/D;;;;OAIG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,eAAe,GAAG,cAAc,CAAC;CACpD,CAAC;AAEF,iDAAiD;AACjD,MAAM,MAAM,aAAa,GACvB,MAAM,GAAG,KAAK,GAAG,SAAS,GAAG,mBAAmB,GAAG,SAAS,CAAC;AAE/D,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,GAAG;IAC/D;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB,CAAC"}
|