@mrpelz/uikit-ish 7.10.0 → 7.12.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/action-sheet/main.d.ts.map +1 -1
- package/dist/components/action-sheet/main.js +2 -1
- package/dist/components/action-sheet/main.js.map +1 -1
- package/dist/components/action-sheet/style.css +6 -0
- package/dist/components/activity-view/main.d.ts.map +1 -1
- package/dist/components/activity-view/main.js +5 -0
- package/dist/components/activity-view/main.js.map +1 -1
- package/dist/components/activity-view/style.css +8 -0
- package/dist/components/alert/main.d.ts.map +1 -1
- package/dist/components/alert/main.js +2 -1
- package/dist/components/alert/main.js.map +1 -1
- package/dist/components/color-picker/color.d.ts +23 -0
- package/dist/components/color-picker/color.d.ts.map +1 -0
- package/dist/components/color-picker/color.js +150 -0
- package/dist/components/color-picker/color.js.map +1 -0
- package/dist/components/color-picker/main.d.ts +16 -6
- package/dist/components/color-picker/main.d.ts.map +1 -1
- package/dist/components/color-picker/main.js +472 -99
- package/dist/components/color-picker/main.js.map +1 -1
- package/dist/components/color-picker/named-colors.d.ts +3 -0
- package/dist/components/color-picker/named-colors.d.ts.map +1 -0
- package/dist/components/color-picker/named-colors.js +152 -0
- package/dist/components/color-picker/named-colors.js.map +1 -0
- package/dist/components/color-picker/props.d.ts +60 -12
- package/dist/components/color-picker/props.d.ts.map +1 -1
- package/dist/components/color-picker/style.css +211 -28
- package/dist/components/contextual-menu/main.d.ts +2 -2
- package/dist/components/contextual-menu/main.d.ts.map +1 -1
- package/dist/components/contextual-menu/main.js +19 -7
- package/dist/components/contextual-menu/main.js.map +1 -1
- package/dist/components/contextual-menu/props.d.ts +10 -1
- package/dist/components/contextual-menu/props.d.ts.map +1 -1
- package/dist/components/drawer/main.d.ts.map +1 -1
- package/dist/components/drawer/main.js +2 -1
- package/dist/components/drawer/main.js.map +1 -1
- package/dist/components/edit-menu/main.d.ts.map +1 -1
- package/dist/components/edit-menu/main.js +10 -8
- package/dist/components/edit-menu/main.js.map +1 -1
- package/dist/components/edit-menu/style.css +24 -2
- package/dist/components/glass/style.css +20 -1
- package/dist/components/index.d.ts +7 -5
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +3 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/island/main.d.ts +27 -0
- package/dist/components/island/main.d.ts.map +1 -0
- package/dist/components/island/main.js +409 -0
- package/dist/components/island/main.js.map +1 -0
- package/dist/components/island/props.d.ts +54 -0
- package/dist/components/island/props.d.ts.map +1 -0
- package/dist/components/island/props.js +2 -0
- package/dist/components/island/props.js.map +1 -0
- package/dist/components/island/style.css +404 -0
- package/dist/components/layout/props.d.ts +4 -3
- package/dist/components/layout/props.d.ts.map +1 -1
- package/dist/components/layout/style.css +37 -0
- package/dist/components/list/main.d.ts.map +1 -1
- package/dist/components/list/main.js +89 -17
- package/dist/components/list/main.js.map +1 -1
- package/dist/components/list/props.d.ts +4 -1
- package/dist/components/list/props.d.ts.map +1 -1
- package/dist/components/list/reorder.d.ts.map +1 -1
- package/dist/components/list/reorder.js +24 -0
- package/dist/components/list/reorder.js.map +1 -1
- package/dist/components/list/style.css +22 -3
- package/dist/components/menu/main.d.ts +13 -2
- package/dist/components/menu/main.d.ts.map +1 -1
- package/dist/components/menu/main.js +239 -9
- package/dist/components/menu/main.js.map +1 -1
- package/dist/components/menu/style.css +21 -6
- package/dist/components/navigation/main.d.ts +4 -2
- package/dist/components/navigation/main.d.ts.map +1 -1
- package/dist/components/navigation/main.js +115 -11
- package/dist/components/navigation/main.js.map +1 -1
- package/dist/components/navigation/props.d.ts +12 -1
- package/dist/components/navigation/props.d.ts.map +1 -1
- package/dist/components/navigation/style.css +25 -0
- package/dist/components/page/main.d.ts.map +1 -1
- package/dist/components/page/main.js +10 -5
- 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 +17 -0
- package/dist/components/popover/main.d.ts +5 -5
- package/dist/components/popover/main.d.ts.map +1 -1
- package/dist/components/popover/main.js +85 -27
- package/dist/components/popover/main.js.map +1 -1
- package/dist/components/popover/props.d.ts +26 -0
- package/dist/components/popover/props.d.ts.map +1 -1
- package/dist/components/popover/style.css +67 -3
- package/dist/components/progress/main.d.ts.map +1 -1
- package/dist/components/progress/main.js +47 -6
- package/dist/components/progress/main.js.map +1 -1
- package/dist/components/progress/style.css +4 -7
- package/dist/components/roll/main.d.ts.map +1 -1
- package/dist/components/roll/main.js +1 -1
- package/dist/components/roll/main.js.map +1 -1
- package/dist/components/roll/style.css +5 -0
- package/dist/components/segmented/main.d.ts.map +1 -1
- package/dist/components/segmented/main.js +149 -14
- package/dist/components/segmented/main.js.map +1 -1
- package/dist/components/segmented/props.d.ts +7 -0
- package/dist/components/segmented/props.d.ts.map +1 -1
- package/dist/components/segmented/style.css +135 -6
- package/dist/components/settings/main.d.ts +21 -0
- package/dist/components/settings/main.d.ts.map +1 -0
- package/dist/components/settings/main.js +182 -0
- package/dist/components/settings/main.js.map +1 -0
- package/dist/components/settings/props.d.ts +44 -0
- package/dist/components/settings/props.d.ts.map +1 -0
- package/dist/components/settings/props.js +2 -0
- package/dist/components/settings/props.js.map +1 -0
- package/dist/components/settings/style.css +8 -0
- package/dist/components/sheet/main.d.ts +11 -5
- package/dist/components/sheet/main.d.ts.map +1 -1
- package/dist/components/sheet/main.js +378 -20
- package/dist/components/sheet/main.js.map +1 -1
- package/dist/components/sheet/props.d.ts +56 -2
- package/dist/components/sheet/props.d.ts.map +1 -1
- package/dist/components/sheet/snap.d.ts +21 -0
- package/dist/components/sheet/snap.d.ts.map +1 -0
- package/dist/components/sheet/snap.js +363 -0
- package/dist/components/sheet/snap.js.map +1 -0
- package/dist/components/sheet/style.css +491 -33
- package/dist/components/sidebar/main.d.ts.map +1 -1
- package/dist/components/sidebar/main.js +6 -4
- package/dist/components/sidebar/main.js.map +1 -1
- package/dist/components/sidebar/style.css +17 -35
- package/dist/components/switch/style.css +2 -2
- package/dist/components/tab-bar/main.d.ts.map +1 -1
- package/dist/components/tab-bar/main.js +15 -8
- package/dist/components/tab-bar/main.js.map +1 -1
- package/dist/components/tab-bar/props.d.ts +2 -1
- package/dist/components/tab-bar/props.d.ts.map +1 -1
- package/dist/components/text-field/main.d.ts +2 -2
- package/dist/components/text-field/main.d.ts.map +1 -1
- package/dist/components/text-field/main.js +30 -10
- package/dist/components/text-field/main.js.map +1 -1
- package/dist/components/text-field/props.d.ts +5 -5
- package/dist/components/text-field/props.d.ts.map +1 -1
- package/dist/components/text-field/style.css +49 -20
- package/dist/components/tooltip/main.d.ts +1 -1
- package/dist/components/tooltip/main.d.ts.map +1 -1
- package/dist/components/tooltip/main.js +123 -8
- package/dist/components/tooltip/main.js.map +1 -1
- package/dist/components/utils/main.d.ts +12 -5
- package/dist/components/utils/main.d.ts.map +1 -1
- package/dist/components/utils/main.js +13 -4
- package/dist/components/utils/main.js.map +1 -1
- package/dist/components/viewport/edge-effect.d.ts.map +1 -1
- package/dist/components/viewport/edge-effect.js +128 -2
- package/dist/components/viewport/edge-effect.js.map +1 -1
- package/dist/components/viewport/edge.d.ts +1 -1
- package/dist/components/viewport/edge.d.ts.map +1 -1
- package/dist/components/viewport/edge.js +3 -3
- package/dist/components/viewport/edge.js.map +1 -1
- package/dist/components/viewport/input.d.ts +3 -1
- package/dist/components/viewport/input.d.ts.map +1 -1
- package/dist/components/viewport/input.js +57 -9
- package/dist/components/viewport/input.js.map +1 -1
- package/dist/components/viewport/ios27.d.ts +14 -0
- package/dist/components/viewport/ios27.d.ts.map +1 -0
- package/dist/components/viewport/ios27.js +28 -0
- package/dist/components/viewport/ios27.js.map +1 -0
- package/dist/components/viewport/main.d.ts +4 -2
- package/dist/components/viewport/main.d.ts.map +1 -1
- package/dist/components/viewport/main.js +206 -36
- package/dist/components/viewport/main.js.map +1 -1
- package/dist/components/viewport/padding.d.ts +12 -0
- package/dist/components/viewport/padding.d.ts.map +1 -1
- package/dist/components/viewport/padding.js +75 -15
- package/dist/components/viewport/padding.js.map +1 -1
- package/dist/components/viewport/props.d.ts +12 -1
- package/dist/components/viewport/props.d.ts.map +1 -1
- package/dist/components/viewport/style.css +63 -7
- package/dist/styles.css +56 -0
- package/package.json +7 -4
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import './style.css';
|
|
3
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
4
|
+
import { createContext, forwardRef, useContext, useMemo, useSyncExternalStore, } from 'react';
|
|
5
|
+
import { cn, withStyle } from '../utils/main.js';
|
|
6
|
+
// Settings: each the nearest provider's override, else the system's (a
|
|
7
|
+
// media query's, live), else the default. For CSS, as custom properties
|
|
8
|
+
// (inherited: the nearest provider's wins, see style.css): a provider sets
|
|
9
|
+
// those it overrides on its element (`display: contents`), a portal those
|
|
10
|
+
// overridden where it's opened (see `useSettingsPortalProps`), as it's
|
|
11
|
+
// outside that element.
|
|
12
|
+
const keys = [
|
|
13
|
+
'colorScheme',
|
|
14
|
+
'contrast',
|
|
15
|
+
'differentiateWithoutColor',
|
|
16
|
+
'reducedMotion',
|
|
17
|
+
'reducedTransparency',
|
|
18
|
+
'textSize',
|
|
19
|
+
];
|
|
20
|
+
const defaults = {
|
|
21
|
+
colorScheme: 'light',
|
|
22
|
+
contrast: 'standard',
|
|
23
|
+
differentiateWithoutColor: false,
|
|
24
|
+
reducedMotion: false,
|
|
25
|
+
reducedTransparency: false,
|
|
26
|
+
textSize: 'large',
|
|
27
|
+
};
|
|
28
|
+
// The system's, by media queries.
|
|
29
|
+
const queries = {
|
|
30
|
+
colorScheme: '(prefers-color-scheme: dark)',
|
|
31
|
+
contrast: '(prefers-contrast: more), (forced-colors: active)',
|
|
32
|
+
reducedMotion: '(prefers-reduced-motion: reduce)',
|
|
33
|
+
reducedTransparency: '(prefers-reduced-transparency: reduce)',
|
|
34
|
+
};
|
|
35
|
+
const noSystem = {};
|
|
36
|
+
let system;
|
|
37
|
+
/** The system's settings (the same object until they change). */
|
|
38
|
+
const getSystem = () => {
|
|
39
|
+
const [isDark, isMore, isReducedMotion, isReducedTransparency] = Object.values(queries).map((query) => matchMedia(query).matches);
|
|
40
|
+
const key = [isDark, isMore, isReducedMotion, isReducedTransparency].join(',');
|
|
41
|
+
if (system?.key !== key) {
|
|
42
|
+
system = {
|
|
43
|
+
key,
|
|
44
|
+
values: {
|
|
45
|
+
colorScheme: isDark ? 'dark' : 'light',
|
|
46
|
+
contrast: isMore ? 'more' : 'standard',
|
|
47
|
+
reducedMotion: isReducedMotion,
|
|
48
|
+
reducedTransparency: isReducedTransparency,
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
return system.values;
|
|
53
|
+
};
|
|
54
|
+
const subscribe = (onChange) => {
|
|
55
|
+
const lists = Object.values(queries).map((query) => matchMedia(query));
|
|
56
|
+
for (const list of lists)
|
|
57
|
+
list.addEventListener('change', onChange);
|
|
58
|
+
return () => {
|
|
59
|
+
for (const list of lists)
|
|
60
|
+
list.removeEventListener('change', onChange);
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
const SettingsContext = createContext({});
|
|
64
|
+
/**
|
|
65
|
+
* The settings where it's rendered: each the nearest provider's override,
|
|
66
|
+
* else the system's, else the default (see `Settings.Provider`). A
|
|
67
|
+
* component's own props win over them (e.g. a switch's `onOffLabels`).
|
|
68
|
+
*/
|
|
69
|
+
export const useSettings = () => {
|
|
70
|
+
const overrides = useContext(SettingsContext);
|
|
71
|
+
const systemValues = useSyncExternalStore(subscribe, getSystem, () => noSystem);
|
|
72
|
+
return useMemo(() => Object.fromEntries(keys.map((key) => [
|
|
73
|
+
key,
|
|
74
|
+
overrides[key] ?? systemValues[key] ?? defaults[key],
|
|
75
|
+
])), [overrides, systemValues]);
|
|
76
|
+
};
|
|
77
|
+
/** A setting's custom property (see style.css), its value for CSS. */
|
|
78
|
+
const properties = {
|
|
79
|
+
contrast: [
|
|
80
|
+
'--uikit-settings-contrast',
|
|
81
|
+
(value) => (value === 'more' ? '1' : '0'),
|
|
82
|
+
],
|
|
83
|
+
differentiateWithoutColor: [
|
|
84
|
+
'--uikit-settings-differentiate-without-color',
|
|
85
|
+
(value) => (value ? '1' : '0'),
|
|
86
|
+
],
|
|
87
|
+
reducedMotion: [
|
|
88
|
+
'--uikit-settings-reduced-motion',
|
|
89
|
+
(value) => (value ? '1' : '0'),
|
|
90
|
+
],
|
|
91
|
+
reducedTransparency: [
|
|
92
|
+
'--uikit-settings-reduced-transparency',
|
|
93
|
+
(value) => (value ? '1' : '0'),
|
|
94
|
+
],
|
|
95
|
+
textSize: ['--uikit-settings-text-size', (value) => value],
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* The custom properties (and color scheme) for `overrides`: each key in it
|
|
99
|
+
* (`only`), its value, or reset to the system's (`undefined`).
|
|
100
|
+
*/
|
|
101
|
+
const styleFor = (overrides, only) => {
|
|
102
|
+
const style = {};
|
|
103
|
+
for (const key of only) {
|
|
104
|
+
const value = overrides[key];
|
|
105
|
+
if (key === 'colorScheme') {
|
|
106
|
+
style['color-scheme'] =
|
|
107
|
+
value === undefined ? 'light dark' : String(value);
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
const [name, encode] = properties[key];
|
|
111
|
+
style[name] =
|
|
112
|
+
value === undefined ? `var(${name}-system)` : encode(value);
|
|
113
|
+
}
|
|
114
|
+
return style;
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* The props of a portal opened within providers: their overrides as custom
|
|
118
|
+
* properties (and its color scheme), on the portal (outside their elements,
|
|
119
|
+
* e.g. in the body). Spread by the library's portals (Menu's, Popover's, …).
|
|
120
|
+
*/
|
|
121
|
+
export const useSettingsPortalProps = () => {
|
|
122
|
+
const overrides = useContext(SettingsContext);
|
|
123
|
+
return useMemo(() => {
|
|
124
|
+
const overridden = keys.filter((key) => overrides[key] !== undefined);
|
|
125
|
+
if (overridden.length === 0)
|
|
126
|
+
return {};
|
|
127
|
+
return {
|
|
128
|
+
'data-color-scheme': overrides.colorScheme,
|
|
129
|
+
style: styleFor(overrides, overridden),
|
|
130
|
+
};
|
|
131
|
+
}, [overrides]);
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* A provider's own settings (given, even as `undefined`), as a key: JSON,
|
|
135
|
+
* `null` for a reset (JSON has no `undefined`).
|
|
136
|
+
*/
|
|
137
|
+
const ownSettingsKey = (props) => JSON.stringify(keys
|
|
138
|
+
.filter((key) => Object.hasOwn(props, key))
|
|
139
|
+
.map((key) => [key, props[key] ?? null]));
|
|
140
|
+
/** A provider's overrides: its outer provider's, then its own (by key). */
|
|
141
|
+
const useOverrides = (outer, ownKey) => useMemo(() => ({
|
|
142
|
+
...outer,
|
|
143
|
+
...Object.fromEntries(JSON.parse(ownKey).map(([key, value]) => [
|
|
144
|
+
key,
|
|
145
|
+
value ?? undefined,
|
|
146
|
+
])),
|
|
147
|
+
}), [outer, ownKey]);
|
|
148
|
+
/**
|
|
149
|
+
* Settings for what's within it (see `SettingsProviderProps`): a
|
|
150
|
+
* `display: contents` element (or `render`'s, as it's laid out), its
|
|
151
|
+
* overrides on it as
|
|
152
|
+
* custom properties, for CSS, and in context, for `useSettings`. Nested,
|
|
153
|
+
* an inner provider overrides an outer one's, setting by setting.
|
|
154
|
+
*/
|
|
155
|
+
const Provider = forwardRef(({ className, render, style, ...props }, ref) => {
|
|
156
|
+
const outer = useContext(SettingsContext);
|
|
157
|
+
// (Given, even as `undefined`: its own.)
|
|
158
|
+
const own = keys.filter((key) => Object.hasOwn(props, key));
|
|
159
|
+
const ownKey = ownSettingsKey(props);
|
|
160
|
+
const elementProps = Object.fromEntries(Object.entries(props).filter(([key]) => !keys.includes(key)));
|
|
161
|
+
const overrides = useOverrides(outer, ownKey);
|
|
162
|
+
const element = useRender({
|
|
163
|
+
defaultTagName: 'div',
|
|
164
|
+
props: {
|
|
165
|
+
...elementProps,
|
|
166
|
+
// (`render`'s element a box of its own: e.g. an app's root, laid
|
|
167
|
+
// out as it is.)
|
|
168
|
+
className: render === undefined ? cn('uikit-settings', className) : className,
|
|
169
|
+
'data-color-scheme': own.includes('colorScheme')
|
|
170
|
+
? props.colorScheme
|
|
171
|
+
: undefined,
|
|
172
|
+
style: withStyle(styleFor(overrides, own), style),
|
|
173
|
+
},
|
|
174
|
+
ref,
|
|
175
|
+
render,
|
|
176
|
+
});
|
|
177
|
+
return (_jsx(SettingsContext.Provider, { value: overrides, children: element }));
|
|
178
|
+
});
|
|
179
|
+
export const Settings = {
|
|
180
|
+
Provider,
|
|
181
|
+
};
|
|
182
|
+
//# sourceMappingURL=main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/components/settings/main.tsx"],"names":[],"mappings":";AAAA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EACL,aAAa,EACb,UAAU,EACV,UAAU,EACV,OAAO,EACP,oBAAoB,GACrB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAcjD,uEAAuE;AACvE,wEAAwE;AACxE,2EAA2E;AAC3E,0EAA0E;AAC1E,uEAAuE;AACvE,wBAAwB;AAExB,MAAM,IAAI,GAAG;IACX,aAAa;IACb,UAAU;IACV,2BAA2B;IAC3B,eAAe;IACf,qBAAqB;IACrB,UAAU;CAC0C,CAAC;AAOvD,MAAM,QAAQ,GAAmB;IAC/B,WAAW,EAAE,OAAO;IACpB,QAAQ,EAAE,UAAU;IACpB,yBAAyB,EAAE,KAAK;IAChC,aAAa,EAAE,KAAK;IACpB,mBAAmB,EAAE,KAAK;IAC1B,QAAQ,EAAE,OAAO;CAClB,CAAC;AAEF,kCAAkC;AAClC,MAAM,OAAO,GAAG;IACd,WAAW,EAAE,8BAA8B;IAC3C,QAAQ,EAAE,mD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AC;IAC5D,MAAM,MAAM,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;IACrC,MAAM,YAAY,GAAG,MAAM,CAAC,WAAW,CACrC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAC1B,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAE,IAA0B,CAAC,QAAQ,CAAC,GAAG,CAAC,CACtD,CACF,CAAC;IAEF,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAE9C,MAAM,OAAO,GAAG,SAAS,CAAC;QACxB,cAAc,EAAE,KAAK;QACrB,KAAK,EAAE;YACL,GAAG,YAAY;YACf,iEAAiE;YACjE,iBAAiB;YACjB,SAAS,EACP,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS;YACpE,mBAAmB,EAAE,GAAG,CAAC,QAAQ,CAAC,aAAa,CAAC;gBAC9C,CAAC,CAAC,KAAK,CAAC,WAAW;gBACnB,CAAC,CAAC,SAAS;YACb,KAAK,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC;SAClD;QACD,GAAG;QACH,MAAM;KACP,CAAC,CAAC;IAEH,OAAO,CACL,KAAC,eAAe,CAAC,QAAQ,IAAC,KAAK,EAAE,SAAS,YACvC,OAAO,GACiB,CAC5B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,QAAQ;CACT,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { useRender } from '@base-ui/react/use-render';
|
|
2
|
+
import type { TextSize } from '../typography/main.js';
|
|
3
|
+
import type { ColorScheme } from '../utils/main.js';
|
|
4
|
+
/** Contrast: the standard one, or increased. */
|
|
5
|
+
export type SettingsContrast = 'more' | 'standard';
|
|
6
|
+
/** The settings, resolved (see `useSettings`). */
|
|
7
|
+
export type SettingsValues = {
|
|
8
|
+
/** The color scheme (system: `prefers-color-scheme`). */
|
|
9
|
+
colorScheme: ColorScheme;
|
|
10
|
+
/**
|
|
11
|
+
* Contrast (system: `prefers-contrast: more`, or `forced-colors:
|
|
12
|
+
* active`).
|
|
13
|
+
*/
|
|
14
|
+
contrast: SettingsContrast;
|
|
15
|
+
/**
|
|
16
|
+
* State told without color alone: shapes, symbols, labels (e.g. a
|
|
17
|
+
* switch's on/off labels). No system signal on the web.
|
|
18
|
+
*/
|
|
19
|
+
differentiateWithoutColor: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Motion reduced: no slides, zooms or movement, fades kept (system:
|
|
22
|
+
* `prefers-reduced-motion: reduce`).
|
|
23
|
+
*/
|
|
24
|
+
reducedMotion: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Transparency reduced: materials opaque (system:
|
|
27
|
+
* `prefers-reduced-transparency: reduce`).
|
|
28
|
+
*/
|
|
29
|
+
reducedTransparency: boolean;
|
|
30
|
+
/** The text size. No system signal on the web. */
|
|
31
|
+
textSize: TextSize;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* A provider's settings: each given, an override (for what's within it);
|
|
35
|
+
* given as `undefined`, reset (the system's, or the default, whatever an
|
|
36
|
+
* outer provider set); left out, its outer provider's.
|
|
37
|
+
*/
|
|
38
|
+
export type SettingsProviderProps = Partial<SettingsValues> & useRender.ComponentProps<'div'>;
|
|
39
|
+
/** A portal's props for the settings of where it's opened (see `Portal`s). */
|
|
40
|
+
export type SettingsPortalProps = {
|
|
41
|
+
'data-color-scheme'?: ColorScheme;
|
|
42
|
+
style?: Record<string, string>;
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/components/settings/props.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,gDAAgD;AAChD,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,UAAU,CAAC;AAEnD,kDAAkD;AAClD,MAAM,MAAM,cAAc,GAAG;IAC3B,yDAAyD;IACzD,WAAW,EAAE,WAAW,CAAC;IACzB;;;OAGG;IACH,QAAQ,EAAE,gBAAgB,CAAC;IAC3B;;;OAGG;IACH,yBAAyB,EAAE,OAAO,CAAC;IACnC;;;OAGG;IACH,aAAa,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,mBAAmB,EAAE,OAAO,CAAC;IAC7B,kDAAkD;IAClD,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,cAAc,CAAC,GACzD,SAAS,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;AAElC,8EAA8E;AAC9E,MAAM,MAAM,mBAAmB,GAAG;IAChC,mBAAmB,CAAC,EAAE,WAAW,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.js","sourceRoot":"","sources":["../../../src/components/settings/props.tsx"],"names":[],"mappings":""}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import '../glass/style.css';
|
|
2
2
|
import './style.css';
|
|
3
3
|
import { Drawer as BaseDrawer } from '@base-ui/react/drawer';
|
|
4
|
-
import
|
|
5
|
-
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
import type { SheetContentProps, SheetGrabberProps, SheetHandle, SheetHeaderProps, SheetPopupProps, SheetRootProps, SheetSnapGroupProps, SheetTriggerProps } from './props.js';
|
|
6
|
+
export type { SheetContentProps, SheetDetent, SheetGrabberProps, SheetHandle, SheetHeaderProps, SheetPopupProps, SheetRegular, SheetRootProps, SheetSnapGroupProps, SheetSwipeDirection, SheetTriggerProps, } from './props.js';
|
|
6
7
|
/** `Sheet.createHandle`, in a component: made once, for its lifetime. */
|
|
7
8
|
export declare const useCreateSheetHandle: <Payload = unknown>() => SheetHandle<Payload>;
|
|
8
9
|
/**
|
|
@@ -11,10 +12,14 @@ export declare const useCreateSheetHandle: <Payload = unknown>() => SheetHandle<
|
|
|
11
12
|
* form sheet in a regular width.
|
|
12
13
|
*/
|
|
13
14
|
export declare const Sheet: {
|
|
15
|
+
Root: <Payload>({ actionsRef, defaultSnapPoint, onOpenChange, onSnapPointChange, snapPoint, snapPoints, swipeDirection, ...props }: SheetRootProps<Payload>) => ReactNode;
|
|
16
|
+
Trigger: import("preact").FunctionalComponent<import("react").PropsWithoutRef<SheetTriggerProps> & {
|
|
17
|
+
ref?: import("preact").Ref<HTMLButtonElement> | undefined;
|
|
18
|
+
}>;
|
|
14
19
|
Popup: import("preact").FunctionalComponent<import("react").PropsWithoutRef<SheetPopupProps> & {
|
|
15
20
|
ref?: import("preact").Ref<HTMLDivElement> | undefined;
|
|
16
21
|
}>;
|
|
17
|
-
Header: import("preact").FunctionalComponent<import("react").PropsWithoutRef<
|
|
22
|
+
Header: import("preact").FunctionalComponent<import("react").PropsWithoutRef<SheetHeaderProps> & {
|
|
18
23
|
ref?: import("preact").Ref<HTMLDivElement> | undefined;
|
|
19
24
|
}>;
|
|
20
25
|
Grabber: import("preact").FunctionalComponent<import("react").PropsWithoutRef<SheetGrabberProps> & {
|
|
@@ -23,6 +28,9 @@ export declare const Sheet: {
|
|
|
23
28
|
Content: import("preact").FunctionalComponent<import("react").PropsWithoutRef<SheetContentProps> & {
|
|
24
29
|
ref?: import("preact").Ref<HTMLDivElement> | undefined;
|
|
25
30
|
}>;
|
|
31
|
+
SnapGroup: import("preact").FunctionalComponent<import("react").PropsWithoutRef<SheetSnapGroupProps> & {
|
|
32
|
+
ref?: import("preact").Ref<HTMLDivElement> | undefined;
|
|
33
|
+
}>;
|
|
26
34
|
createHandle: <Payload = unknown>() => SheetHandle<Payload>;
|
|
27
35
|
Backdrop: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react/drawer").DrawerBackdropProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
28
36
|
Close: BaseDrawer.Close;
|
|
@@ -31,10 +39,8 @@ export declare const Sheet: {
|
|
|
31
39
|
IndentBackground: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react/drawer").DrawerIndentBackgroundProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
32
40
|
Portal: BaseDrawer.Portal;
|
|
33
41
|
Provider: typeof BaseDrawer.Provider;
|
|
34
|
-
Root: typeof BaseDrawer.Root;
|
|
35
42
|
SwipeArea: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react/drawer").DrawerSwipeAreaProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
36
43
|
Title: BaseDrawer.Title;
|
|
37
|
-
Trigger: BaseDrawer.Trigger;
|
|
38
44
|
Viewport: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react/drawer").DrawerViewportProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
39
45
|
VirtualKeyboardProvider: typeof BaseDrawer.VirtualKeyboardProvider;
|
|
40
46
|
Handle: typeof BaseDrawer.Handle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/components/sheet/main.tsx"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/components/sheet/main.tsx"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAKL,SAAS,EASV,MAAM,OAAO,CAAC;AAYf,OAAO,KAAK,EACV,iBAAiB,EAEjB,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,eAAe,EAEf,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAGpB,YAAY,EACV,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,YAAY,CAAC;AA4qBpB,yEAAyE;AACzE,eAAO,MAAM,oBAAoB,GAC/B,OAAO,GAAG,OAAO,OACd,WAAW,CAAC,OAAO,CAIvB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,KAAK;WAxmBJ,OAAO,sHASlB,cAAc,CAAC,OAAO,CAAC,KAAG,SAAS;;;;;;;;;;;;;;;;;;;mBA8kBhB,OAAO,iBAAgB,WAAW,CAAC,OAAO,CAAC;;;;;;;;;;;;;CA2BhE,CAAC"}
|