@tempoxyz/ds 0.2.4 → 0.2.6
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/fonts/Inter-cyrillic-ext.woff2 +0 -0
- package/dist/fonts/Inter-cyrillic.woff2 +0 -0
- package/dist/fonts/Inter-greek-ext.woff2 +0 -0
- package/dist/fonts/Inter-greek.woff2 +0 -0
- package/dist/fonts/Inter-latin-ext.woff2 +0 -0
- package/dist/fonts/Inter-latin.woff2 +0 -0
- package/dist/fonts/Inter-symbols.woff2 +0 -0
- package/dist/fonts/Inter-vietnamese.woff2 +0 -0
- package/dist/mobile/Haptics.d.ts +39 -0
- package/dist/mobile/Haptics.d.ts.map +1 -0
- package/dist/mobile/Haptics.js +51 -0
- package/dist/mobile/Haptics.js.map +1 -0
- package/dist/mobile/components/Button.d.ts.map +1 -1
- package/dist/mobile/components/Button.js +3 -3
- package/dist/mobile/components/Button.js.map +1 -1
- package/dist/mobile/components/IconButton.d.ts.map +1 -1
- package/dist/mobile/components/IconButton.js +3 -3
- package/dist/mobile/components/IconButton.js.map +1 -1
- package/dist/mobile/components/Spinner.js +1 -1
- package/dist/mobile/components/Spinner.js.map +1 -1
- package/dist/mobile/components/TextButton.d.ts.map +1 -1
- package/dist/mobile/components/TextButton.js +3 -3
- package/dist/mobile/components/TextButton.js.map +1 -1
- package/dist/mobile/components/TextInput.js +1 -1
- package/dist/mobile/components/TextInput.js.map +1 -1
- package/dist/mobile/components/Toast.js +1 -1
- package/dist/mobile/components/Toast.js.map +1 -1
- package/dist/mobile/components/Toggle.d.ts.map +1 -1
- package/dist/mobile/components/Toggle.js +2 -2
- package/dist/mobile/components/Toggle.js.map +1 -1
- package/dist/mobile/index.d.ts +2 -0
- package/dist/mobile/index.d.ts.map +1 -1
- package/dist/mobile/index.js +2 -0
- package/dist/mobile/index.js.map +1 -1
- package/dist/mobile/useColor.d.ts +23 -0
- package/dist/mobile/useColor.d.ts.map +1 -0
- package/dist/mobile/useColor.js +29 -0
- package/dist/mobile/useColor.js.map +1 -0
- package/dist/web/components/Accordion.css +1 -1
- package/dist/web/components/Accordion.js +8 -8
- package/dist/web/components/Accordion.js.zyzz.json +1 -1
- package/dist/web/components/AlertDialog.css +1 -1
- package/dist/web/components/AlertDialog.js +2 -2
- package/dist/web/components/AlertDialog.js.zyzz.json +1 -1
- package/dist/web/components/Amount.css +1 -1
- package/dist/web/components/Amount.js +3 -3
- package/dist/web/components/Amount.js.zyzz.json +1 -1
- package/dist/web/components/AmountInput.css +1 -1
- package/dist/web/components/AmountInput.js +4 -4
- package/dist/web/components/AmountInput.js.zyzz.json +1 -1
- package/dist/web/components/AppShell.css +1 -1
- package/dist/web/components/AppShell.js +16 -16
- package/dist/web/components/AppShell.js.zyzz.json +1 -1
- package/dist/web/components/Autocomplete.js.zyzz.json +1 -1
- package/dist/web/components/Avatar.css +1 -1
- package/dist/web/components/Avatar.js +4 -6
- package/dist/web/components/Avatar.js.zyzz.json +1 -1
- package/dist/web/components/Banner.css +1 -1
- package/dist/web/components/Banner.js +5 -5
- package/dist/web/components/Banner.js.zyzz.json +1 -1
- package/dist/web/components/Breadcrumbs.css +1 -1
- package/dist/web/components/Breadcrumbs.js +6 -6
- package/dist/web/components/Breadcrumbs.js.zyzz.json +1 -1
- package/dist/web/components/Button.css +1 -1
- package/dist/web/components/Button.js +4 -4
- package/dist/web/components/Button.js.zyzz.json +1 -1
- package/dist/web/components/Calendar.css +1 -1
- package/dist/web/components/Calendar.js +7 -7
- package/dist/web/components/Calendar.js.zyzz.json +1 -1
- package/dist/web/components/Callout.css +1 -1
- package/dist/web/components/Callout.js +5 -5
- package/dist/web/components/Callout.js.zyzz.json +1 -1
- package/dist/web/components/Checkbox.css +1 -1
- package/dist/web/components/Checkbox.js +5 -5
- package/dist/web/components/Checkbox.js.zyzz.json +1 -1
- package/dist/web/components/CheckboxGroup.css +1 -1
- package/dist/web/components/CheckboxGroup.js +1 -1
- package/dist/web/components/CheckboxGroup.js.zyzz.json +1 -1
- package/dist/web/components/ChoiceGroup.css +1 -1
- package/dist/web/components/ChoiceGroup.js +5 -5
- package/dist/web/components/ChoiceGroup.js.zyzz.json +1 -1
- package/dist/web/components/Choicebox.css +1 -1
- package/dist/web/components/Choicebox.js +11 -11
- package/dist/web/components/Choicebox.js.zyzz.json +1 -1
- package/dist/web/components/Combobox.css +1 -1
- package/dist/web/components/Combobox.js +4 -4
- package/dist/web/components/Combobox.js.zyzz.json +1 -1
- package/dist/web/components/Container.css +1 -1
- package/dist/web/components/Container.js +1 -3
- package/dist/web/components/Container.js.zyzz.json +1 -1
- package/dist/web/components/CopyButton.css +1 -1
- package/dist/web/components/CopyButton.js +3 -3
- package/dist/web/components/CopyButton.js.zyzz.json +1 -1
- package/dist/web/components/DatePicker.css +1 -1
- package/dist/web/components/DatePicker.js +6 -6
- package/dist/web/components/DatePicker.js.zyzz.json +1 -1
- package/dist/web/components/Dialog.css +1 -1
- package/dist/web/components/Dialog.js +6 -6
- package/dist/web/components/Dialog.js.zyzz.json +1 -1
- package/dist/web/components/Drawer.css +1 -1
- package/dist/web/components/Drawer.js +4 -4
- package/dist/web/components/Drawer.js.zyzz.json +1 -1
- package/dist/web/components/Empty.css +1 -1
- package/dist/web/components/Empty.js +5 -5
- package/dist/web/components/Empty.js.zyzz.json +1 -1
- package/dist/web/components/Field.css +1 -1
- package/dist/web/components/Field.js +5 -5
- package/dist/web/components/Field.js.zyzz.json +1 -1
- package/dist/web/components/Fieldset.css +1 -1
- package/dist/web/components/Fieldset.js +2 -2
- package/dist/web/components/Fieldset.js.zyzz.json +1 -1
- package/dist/web/components/Frame.css +1 -1
- package/dist/web/components/Frame.js +8 -10
- package/dist/web/components/Frame.js.zyzz.json +1 -1
- package/dist/web/components/Gauge.css +1 -1
- package/dist/web/components/Gauge.js +6 -6
- package/dist/web/components/Gauge.js.zyzz.json +1 -1
- package/dist/web/components/Grid.css +1 -1
- package/dist/web/components/Grid.js +1 -3
- package/dist/web/components/Grid.js.zyzz.json +1 -1
- package/dist/web/components/Hex.css +1 -1
- package/dist/web/components/Hex.d.ts +43 -1
- package/dist/web/components/Hex.d.ts.map +1 -1
- package/dist/web/components/Hex.js +10 -8
- package/dist/web/components/Hex.js.map +1 -1
- package/dist/web/components/Hex.js.zyzz.json +1 -1
- package/dist/web/components/IconChip.css +1 -1
- package/dist/web/components/IconChip.d.ts.map +1 -1
- package/dist/web/components/IconChip.js +1 -3
- package/dist/web/components/IconChip.js.map +1 -1
- package/dist/web/components/IconChip.js.zyzz.json +1 -1
- package/dist/web/components/Identicon.css +1 -1
- package/dist/web/components/Identicon.d.ts +8 -0
- package/dist/web/components/Identicon.d.ts.map +1 -1
- package/dist/web/components/Identicon.js +5 -4
- package/dist/web/components/Identicon.js.map +1 -1
- package/dist/web/components/Identicon.js.zyzz.json +1 -1
- package/dist/web/components/Inline.css +1 -1
- package/dist/web/components/Inline.js +1 -3
- package/dist/web/components/Inline.js.zyzz.json +1 -1
- package/dist/web/components/Input.css +1 -1
- package/dist/web/components/Input.js +4 -4
- package/dist/web/components/Input.js.zyzz.json +1 -1
- package/dist/web/components/Inset.css +1 -1
- package/dist/web/components/Inset.js +1 -3
- package/dist/web/components/Inset.js.zyzz.json +1 -1
- package/dist/web/components/Kbd.css +1 -1
- package/dist/web/components/Kbd.js +3 -3
- package/dist/web/components/Kbd.js.zyzz.json +1 -1
- package/dist/web/components/LoadingDots.css +1 -1
- package/dist/web/components/LoadingDots.js +3 -3
- package/dist/web/components/LoadingDots.js.zyzz.json +1 -1
- package/dist/web/components/Menu.css +1 -1
- package/dist/web/components/Menu.js +9 -9
- package/dist/web/components/Menu.js.zyzz.json +1 -1
- package/dist/web/components/NumberField.css +1 -1
- package/dist/web/components/NumberField.js +5 -5
- package/dist/web/components/NumberField.js.zyzz.json +1 -1
- package/dist/web/components/OtpField.css +1 -1
- package/dist/web/components/OtpField.js +3 -3
- package/dist/web/components/OtpField.js.zyzz.json +1 -1
- package/dist/web/components/Pagination.css +1 -1
- package/dist/web/components/Pagination.js +6 -6
- package/dist/web/components/Pagination.js.zyzz.json +1 -1
- package/dist/web/components/Popover.css +1 -1
- package/dist/web/components/Popover.js +5 -5
- package/dist/web/components/Popover.js.zyzz.json +1 -1
- package/dist/web/components/Progress.css +1 -1
- package/dist/web/components/Progress.js +6 -6
- package/dist/web/components/Progress.js.zyzz.json +1 -1
- package/dist/web/components/Qr.css +1 -1
- package/dist/web/components/Qr.js +1 -3
- package/dist/web/components/Qr.js.zyzz.json +1 -1
- package/dist/web/components/RadioGroup.css +1 -1
- package/dist/web/components/RadioGroup.js +4 -4
- package/dist/web/components/RadioGroup.js.zyzz.json +1 -1
- package/dist/web/components/Rows.css +1 -1
- package/dist/web/components/Rows.d.ts +74 -11
- package/dist/web/components/Rows.d.ts.map +1 -1
- package/dist/web/components/Rows.js +36 -23
- package/dist/web/components/Rows.js.map +1 -1
- package/dist/web/components/Rows.js.zyzz.json +1 -1
- package/dist/web/components/SecretValue.css +1 -1
- package/dist/web/components/SecretValue.js +3 -3
- package/dist/web/components/SecretValue.js.zyzz.json +1 -1
- package/dist/web/components/Select.css +1 -1
- package/dist/web/components/Select.js +2 -2
- package/dist/web/components/Select.js.zyzz.json +1 -1
- package/dist/web/components/Separator.css +1 -1
- package/dist/web/components/Separator.js +1 -1
- package/dist/web/components/Separator.js.zyzz.json +1 -1
- package/dist/web/components/SidebarMenu.css +1 -1
- package/dist/web/components/SidebarMenu.js +8 -8
- package/dist/web/components/SidebarMenu.js.zyzz.json +1 -1
- package/dist/web/components/Skeleton.css +1 -1
- package/dist/web/components/Skeleton.js +1 -3
- package/dist/web/components/Skeleton.js.zyzz.json +1 -1
- package/dist/web/components/Slider.css +1 -1
- package/dist/web/components/Slider.js +6 -6
- package/dist/web/components/Slider.js.zyzz.json +1 -1
- package/dist/web/components/Snippet.css +1 -1
- package/dist/web/components/Snippet.js +4 -4
- package/dist/web/components/Snippet.js.zyzz.json +1 -1
- package/dist/web/components/Spinner.css +1 -1
- package/dist/web/components/Spinner.js +3 -3
- package/dist/web/components/Spinner.js.zyzz.json +1 -1
- package/dist/web/components/SplitButton.css +1 -1
- package/dist/web/components/SplitButton.js +1 -1
- package/dist/web/components/SplitButton.js.zyzz.json +1 -1
- package/dist/web/components/Stack.css +1 -1
- package/dist/web/components/Stack.js +1 -3
- package/dist/web/components/Stack.js.zyzz.json +1 -1
- package/dist/web/components/Stepper.css +1 -1
- package/dist/web/components/Stepper.js +3 -3
- package/dist/web/components/Stepper.js.zyzz.json +1 -1
- package/dist/web/components/Surface.css +1 -1
- package/dist/web/components/Surface.d.ts +19 -1
- package/dist/web/components/Surface.d.ts.map +1 -1
- package/dist/web/components/Surface.js +6 -8
- package/dist/web/components/Surface.js.map +1 -1
- package/dist/web/components/Surface.js.zyzz.json +1 -1
- package/dist/web/components/Switch.css +1 -1
- package/dist/web/components/Switch.js +3 -3
- package/dist/web/components/Switch.js.zyzz.json +1 -1
- package/dist/web/components/Table.css +1 -1
- package/dist/web/components/Table.js +5 -7
- package/dist/web/components/Table.js.zyzz.json +1 -1
- package/dist/web/components/Tabs.css +1 -1
- package/dist/web/components/Tabs.js +4 -6
- package/dist/web/components/Tabs.js.zyzz.json +1 -1
- package/dist/web/components/Tag.css +1 -1
- package/dist/web/components/Tag.js +3 -3
- package/dist/web/components/Tag.js.zyzz.json +1 -1
- package/dist/web/components/Textarea.css +1 -1
- package/dist/web/components/Textarea.js +1 -3
- package/dist/web/components/Textarea.js.zyzz.json +1 -1
- package/dist/web/components/Toast.css +1 -1
- package/dist/web/components/Toast.js +10 -10
- package/dist/web/components/Toast.js.zyzz.json +1 -1
- package/dist/web/components/Token.css +1 -1
- package/dist/web/components/Token.js +1 -3
- package/dist/web/components/Token.js.zyzz.json +1 -1
- package/dist/web/components/Tooltip.css +1 -1
- package/dist/web/components/Tooltip.js +2 -2
- package/dist/web/components/Tooltip.js.zyzz.json +1 -1
- package/dist/web/components/internal/Field.css +1 -1
- package/dist/web/components/internal/Field.js +4 -4
- package/dist/web/components/internal/Field.js.zyzz.json +1 -1
- package/dist/web/components/internal/InputGroup.css +1 -1
- package/dist/web/components/internal/InputGroup.d.ts +11 -0
- package/dist/web/components/internal/InputGroup.d.ts.map +1 -1
- package/dist/web/components/internal/InputGroup.js +1 -3
- package/dist/web/components/internal/InputGroup.js.map +1 -1
- package/dist/web/components/internal/InputGroup.js.zyzz.json +1 -1
- package/dist/web/components/internal/Listbox.css +1 -1
- package/dist/web/components/internal/Listbox.js +13 -13
- package/dist/web/components/internal/Listbox.js.zyzz.json +1 -1
- package/dist/web/index.js.zyzz.json +1 -1
- package/dist/web/vars.d.ts +8 -1
- package/dist/web/vars.d.ts.map +1 -1
- package/dist/web/vars.js.map +1 -1
- package/dist/web/vars.js.zyzz.json +1 -1
- package/dist/web/zyzz.config.d.ts +40 -5
- package/dist/web/zyzz.config.d.ts.map +1 -1
- package/dist/web/zyzz.config.js +10 -0
- package/dist/web/zyzz.config.js.map +1 -1
- package/dist/web/zyzz.config.js.zyzz.json +1 -1
- package/package.json +33 -1
- package/src/fonts/Inter-cyrillic-ext.woff2 +0 -0
- package/src/fonts/Inter-cyrillic.woff2 +0 -0
- package/src/fonts/Inter-greek-ext.woff2 +0 -0
- package/src/fonts/Inter-greek.woff2 +0 -0
- package/src/fonts/Inter-latin-ext.woff2 +0 -0
- package/src/fonts/Inter-latin.woff2 +0 -0
- package/src/fonts/Inter-symbols.woff2 +0 -0
- package/src/fonts/Inter-vietnamese.woff2 +0 -0
- package/src/fonts/README.md +8 -0
- package/src/mobile/Haptics.ts +55 -0
- package/src/mobile/README.md +97 -1
- package/src/mobile/components/Button.tsx +3 -3
- package/src/mobile/components/IconButton.tsx +3 -3
- package/src/mobile/components/Spinner.tsx +1 -1
- package/src/mobile/components/TextButton.tsx +3 -3
- package/src/mobile/components/TextInput.tsx +1 -1
- package/src/mobile/components/Toast.tsx +1 -1
- package/src/mobile/components/Toggle.tsx +2 -2
- package/src/mobile/index.ts +2 -0
- package/src/mobile/useColor.ts +31 -0
- package/src/web/components/Hex.tsx +45 -2
- package/src/web/components/IconChip.tsx +0 -1
- package/src/web/components/Identicon.tsx +15 -1
- package/src/web/components/Rows.tsx +100 -22
- package/src/web/components/Surface.tsx +9 -3
- package/src/web/components/internal/InputGroup.ts +10 -0
- package/src/web/vars.ts +12 -3
- package/src/web/zyzz.config.ts +72 -1
- package/dist/mobile/internal/useColor.d.ts +0 -4
- package/dist/mobile/internal/useColor.d.ts.map +0 -1
- package/dist/mobile/internal/useColor.js +0 -12
- package/dist/mobile/internal/useColor.js.map +0 -1
- package/src/mobile/internal/useColor.ts +0 -13
|
@@ -3,7 +3,6 @@ import type { ComponentPropsWithRef, ReactNode } from 'react'
|
|
|
3
3
|
import { use } from 'react'
|
|
4
4
|
import type * as zyzz from 'zyzz'
|
|
5
5
|
import { keyframes } from 'zyzz/web'
|
|
6
|
-
import { ChevronDown } from '../icons/ChevronDown.js'
|
|
7
6
|
import { ChevronRight } from '../icons/ChevronRight.js'
|
|
8
7
|
import { style, variants } from '../zyzz.config.js'
|
|
9
8
|
import * as RowsSize from './internal/RowsSize.js'
|
|
@@ -51,29 +50,52 @@ export namespace Rows {
|
|
|
51
50
|
zyzz.Props.Variants<typeof styles.description>
|
|
52
51
|
}
|
|
53
52
|
|
|
54
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* A block wrapper for a run of rows. `RowGroupLoader` renders the same wrapper while loading.
|
|
55
|
+
* Directly after an expanded row, or after a group that follows one, its dividers start at the
|
|
56
|
+
* row text.
|
|
57
|
+
*/
|
|
55
58
|
export function Group(props: Group.Props) {
|
|
56
59
|
const { className, vars, ...attributes } = props
|
|
57
60
|
|
|
58
|
-
return
|
|
61
|
+
return (
|
|
62
|
+
<div
|
|
63
|
+
{...attributes}
|
|
64
|
+
data-group=""
|
|
65
|
+
{...styles.group({ className, style: props.style, vars })}
|
|
66
|
+
/>
|
|
67
|
+
)
|
|
59
68
|
}
|
|
60
69
|
|
|
61
70
|
export namespace Group {
|
|
62
71
|
export type Props = ComponentPropsWithRef<'div'> & zyzz.Props.Variants<typeof styles.group>
|
|
63
72
|
}
|
|
64
73
|
|
|
65
|
-
/**
|
|
74
|
+
/**
|
|
75
|
+
* Groups a `Rows.Title` and `Rows.Description` beside a control, or stacks a `Rows.Label` over a
|
|
76
|
+
* short paragraph that does not fit on one line beside it.
|
|
77
|
+
*/
|
|
66
78
|
export function Info(props: Info.Props) {
|
|
67
79
|
const { className, vars, ...attributes } = props
|
|
68
80
|
|
|
69
|
-
return
|
|
81
|
+
return (
|
|
82
|
+
<span
|
|
83
|
+
{...attributes}
|
|
84
|
+
data-info=""
|
|
85
|
+
{...styles.info({ className, style: props.style, vars })}
|
|
86
|
+
/>
|
|
87
|
+
)
|
|
70
88
|
}
|
|
71
89
|
|
|
72
90
|
export namespace Info {
|
|
73
91
|
export type Props = ComponentPropsWithRef<'span'> & zyzz.Props.Variants<typeof styles.info>
|
|
74
92
|
}
|
|
75
93
|
|
|
76
|
-
/**
|
|
94
|
+
/**
|
|
95
|
+
* The key of a key-value row. It keeps its width, holds at least half the row, and pushes the
|
|
96
|
+
* content after it to the end. The value then takes at most the other half, so a `Hex` truncates
|
|
97
|
+
* and long text wraps.
|
|
98
|
+
*/
|
|
77
99
|
export function Label(props: Label.Props) {
|
|
78
100
|
const { className, vars, ...attributes } = props
|
|
79
101
|
|
|
@@ -92,7 +114,7 @@ export namespace Rows {
|
|
|
92
114
|
|
|
93
115
|
/**
|
|
94
116
|
* Content revealed by an expandable row. Mount it directly after the row while open. It eases in
|
|
95
|
-
* on mount, and the divider
|
|
117
|
+
* on mount, and the divider above it starts at the row text.
|
|
96
118
|
*/
|
|
97
119
|
export function Panel(props: Panel.Props) {
|
|
98
120
|
const { className, vars, ...attributes } = props
|
|
@@ -141,7 +163,10 @@ export namespace Rows {
|
|
|
141
163
|
}
|
|
142
164
|
|
|
143
165
|
/**
|
|
144
|
-
* `size` sets one row height for every row. `
|
|
166
|
+
* `size` sets one row height for every row. A 32px control fits `small` and `medium` rows, and a
|
|
167
|
+
* 40px control fits `large` rows, without changing that height. `inset` dividers start where the
|
|
168
|
+
* row text does. Dividers in a `Rows.Panel` or `Rows.Group` directly after an expanded row start
|
|
169
|
+
* there with `full` dividers too.
|
|
145
170
|
* Inside a `Surface`, rows reach its edges. Variants default to `dividers="inset"`,
|
|
146
171
|
* `size="medium"`.
|
|
147
172
|
*/
|
|
@@ -202,7 +227,7 @@ export namespace Rows {
|
|
|
202
227
|
children: (
|
|
203
228
|
<>
|
|
204
229
|
<span {...styles.content()}>{children}</span>
|
|
205
|
-
{action === 'expand' && <
|
|
230
|
+
{action === 'expand' && <ChevronRight data-indicator="" {...styles.indicator()} />}
|
|
206
231
|
{action === 'navigation' && <ChevronRight {...styles.indicator()} />}
|
|
207
232
|
</>
|
|
208
233
|
),
|
|
@@ -216,8 +241,9 @@ export namespace Rows {
|
|
|
216
241
|
export type Props = Omit<useRender.ComponentProps<'div'>, 'children'> &
|
|
217
242
|
Omit<zyzz.Props.Variants<typeof styles.row>, 'size'> & {
|
|
218
243
|
/**
|
|
219
|
-
* `expand` shows a chevron that turns
|
|
220
|
-
* chevron. Either makes the row a button unless `render`
|
|
244
|
+
* `expand` shows a trailing chevron that turns from right to down while `aria-expanded` is
|
|
245
|
+
* true. `navigation` shows a trailing chevron. Either makes the row a button unless `render`
|
|
246
|
+
* is set.
|
|
221
247
|
* @default 'none'
|
|
222
248
|
*/
|
|
223
249
|
action?: 'expand' | 'navigation' | 'none' | undefined
|
|
@@ -255,6 +281,7 @@ export namespace Rows {
|
|
|
255
281
|
aria-label="Loading"
|
|
256
282
|
role="status"
|
|
257
283
|
{...attributes}
|
|
284
|
+
data-group=""
|
|
258
285
|
{...styles.group({ className, style: props.style, vars })}
|
|
259
286
|
>
|
|
260
287
|
{['30%', '45%'].map((width) => (
|
|
@@ -347,6 +374,29 @@ namespace styles {
|
|
|
347
374
|
color: 'gray.900',
|
|
348
375
|
flexShrink: '0 !custom',
|
|
349
376
|
marginInlineEnd: 'auto !custom',
|
|
377
|
+
// Holding half the row leaves the value at most the other half, however long it is.
|
|
378
|
+
minWidth: '50% !custom',
|
|
379
|
+
selectors: {
|
|
380
|
+
// A `Hex` value yields the width of its leading identicon and gap back from this half.
|
|
381
|
+
'&:has(~ [data-hex] > [data-identicon="16"]:first-child)': {
|
|
382
|
+
minWidth: 'calc(50% - 24px) !custom',
|
|
383
|
+
},
|
|
384
|
+
'&:has(~ [data-hex] > [data-identicon="24"]:first-child)': {
|
|
385
|
+
minWidth: 'calc(50% - 32px) !custom',
|
|
386
|
+
},
|
|
387
|
+
'&:has(~ [data-hex] > [data-identicon="32"]:first-child)': {
|
|
388
|
+
minWidth: 'calc(50% - 40px) !custom',
|
|
389
|
+
},
|
|
390
|
+
'&:has(~ [data-hex] > [data-identicon="40"]:first-child)': {
|
|
391
|
+
minWidth: 'calc(50% - 48px) !custom',
|
|
392
|
+
},
|
|
393
|
+
'&:has(~ [data-hex] > [data-identicon="48"]:first-child)': {
|
|
394
|
+
minWidth: 'calc(50% - 56px) !custom',
|
|
395
|
+
},
|
|
396
|
+
'&:has(~ [data-hex] > [data-identicon="64"]:first-child)': {
|
|
397
|
+
minWidth: 'calc(50% - 72px) !custom',
|
|
398
|
+
},
|
|
399
|
+
},
|
|
350
400
|
},
|
|
351
401
|
},
|
|
352
402
|
{ id: 'tds/web/rows/label' },
|
|
@@ -392,8 +442,9 @@ namespace styles {
|
|
|
392
442
|
typography: 'label.14.strong',
|
|
393
443
|
selectors: {
|
|
394
444
|
'& [data-divider]': { position: 'relative' },
|
|
445
|
+
// The faintest gray keeps dividers quiet on filled surfaces as well as on the page.
|
|
395
446
|
'& [data-divider]::before': {
|
|
396
|
-
backgroundColor: 'grayAlpha.
|
|
447
|
+
backgroundColor: 'grayAlpha.100',
|
|
397
448
|
content: '"" !custom',
|
|
398
449
|
height: '1',
|
|
399
450
|
insetBlockStart: '0',
|
|
@@ -406,8 +457,8 @@ namespace styles {
|
|
|
406
457
|
{ display: 'none' },
|
|
407
458
|
'& :is(button, a[href], [role="button"])[data-divider]:hover:not(:disabled, [aria-disabled="true"]) + [data-divider]::before':
|
|
408
459
|
{ display: 'none' },
|
|
409
|
-
|
|
410
|
-
|
|
460
|
+
'& :is(button, a[href], [role="button"])[data-divider]:hover:not(:disabled, [aria-disabled="true"]) + [data-group] > [data-divider]:first-child::before':
|
|
461
|
+
{ display: 'none' },
|
|
411
462
|
},
|
|
412
463
|
},
|
|
413
464
|
// Inset dividers start where the row text does: 16, 20 or 24px in.
|
|
@@ -428,11 +479,37 @@ namespace styles {
|
|
|
428
479
|
inset: { selectors: { '& [data-divider]::before': { insetInline: '16' } } },
|
|
429
480
|
none: { selectors: { '& [data-divider]::before': { display: 'none' } } },
|
|
430
481
|
},
|
|
431
|
-
// Panels share the rows' side padding so their text lines up.
|
|
482
|
+
// Panels share the rows' side padding so their text lines up. Info takes back the block
|
|
483
|
+
// padding that small and medium rows trim for controls, so two-line text keeps its room.
|
|
484
|
+
// Dividers in content revealed by an expanded row start at the row text, even with `full`
|
|
485
|
+
// dividers, so the content reads as nested under the row.
|
|
432
486
|
size: {
|
|
433
|
-
large: {
|
|
434
|
-
|
|
435
|
-
|
|
487
|
+
large: {
|
|
488
|
+
selectors: {
|
|
489
|
+
'& :is([aria-expanded="true"] + [data-group], [aria-expanded="true"] + [data-group] + [data-group]) > [data-divider]::before':
|
|
490
|
+
{ insetInlineStart: '24' },
|
|
491
|
+
'& [aria-expanded="true"] + [data-panel]::before': { insetInlineStart: '24' },
|
|
492
|
+
'& [data-panel]': { paddingInline: '24' },
|
|
493
|
+
},
|
|
494
|
+
},
|
|
495
|
+
medium: {
|
|
496
|
+
selectors: {
|
|
497
|
+
'& :is([aria-expanded="true"] + [data-group], [aria-expanded="true"] + [data-group] + [data-group]) > [data-divider]::before':
|
|
498
|
+
{ insetInlineStart: '20' },
|
|
499
|
+
'& [aria-expanded="true"] + [data-panel]::before': { insetInlineStart: '20' },
|
|
500
|
+
'& [data-info]': { paddingBlock: '4' },
|
|
501
|
+
'& [data-panel]': { paddingInline: '20' },
|
|
502
|
+
},
|
|
503
|
+
},
|
|
504
|
+
small: {
|
|
505
|
+
typography: 'label.13.strong',
|
|
506
|
+
selectors: {
|
|
507
|
+
'& :is([aria-expanded="true"] + [data-group], [aria-expanded="true"] + [data-group] + [data-group]) > [data-divider]::before':
|
|
508
|
+
{ insetInlineStart: '16' },
|
|
509
|
+
'& [aria-expanded="true"] + [data-panel]::before': { insetInlineStart: '16' },
|
|
510
|
+
'& [data-info]': { paddingBlock: '2' },
|
|
511
|
+
},
|
|
512
|
+
},
|
|
436
513
|
},
|
|
437
514
|
},
|
|
438
515
|
},
|
|
@@ -474,7 +551,7 @@ namespace styles {
|
|
|
474
551
|
outlineOffset: '-2',
|
|
475
552
|
},
|
|
476
553
|
'&:disabled, &[aria-disabled="true"]': { cursor: 'default', opacity: 'disabled' },
|
|
477
|
-
'&[aria-expanded="true"] [data-indicator]': { transform: 'rotate(
|
|
554
|
+
'&[aria-expanded="true"] [data-indicator]': { transform: 'rotate(90deg) !custom' },
|
|
478
555
|
},
|
|
479
556
|
'@media (prefers-reduced-motion: reduce)': {
|
|
480
557
|
transitionProperty: 'background-color, opacity, outline-color',
|
|
@@ -491,11 +568,12 @@ namespace styles {
|
|
|
491
568
|
],
|
|
492
569
|
defaultVariants: { size: 'medium', spacing: 'both' },
|
|
493
570
|
variants: {
|
|
494
|
-
// 36, 40 and 56px.
|
|
571
|
+
// 36, 40 and 56px. Block padding leaves room for a 32px control in small and medium rows and a
|
|
572
|
+
// 40px control in large rows, so a row with a control matches the text rows beside it.
|
|
495
573
|
size: {
|
|
496
574
|
large: { minHeight: '56' },
|
|
497
|
-
medium: { minHeight: '40' },
|
|
498
|
-
small: { minHeight: '36', paddingBlock: '
|
|
575
|
+
medium: { minHeight: '40', paddingBlock: '4' },
|
|
576
|
+
small: { minHeight: '36', paddingBlock: '2' },
|
|
499
577
|
},
|
|
500
578
|
spacing: {
|
|
501
579
|
both: { paddingInline: '16' },
|
|
@@ -11,7 +11,7 @@ import { variants, vars } from '../zyzz.config.js'
|
|
|
11
11
|
* - `size` sets the corner radius and padding together.
|
|
12
12
|
* - Name the card with `Surface.Title`, which renders an `h2`, so headings keep the card navigable.
|
|
13
13
|
* - A pressable surface should hold no other interactive controls, since nested targets conflict.
|
|
14
|
-
* - A direct child `table` or `Rows` bleeds into the
|
|
14
|
+
* - A direct child `table` or `Rows` bleeds into the padding, so row fills reach the edges.
|
|
15
15
|
*
|
|
16
16
|
* @example
|
|
17
17
|
* <Surface>
|
|
@@ -251,8 +251,8 @@ namespace styles {
|
|
|
251
251
|
// Padding is one and a half times the radius, and they scale together. A direct child
|
|
252
252
|
// table or Rows bleeds into the inline padding so fills reach the edges. Table cells at the
|
|
253
253
|
// edges take back exactly the padding, so their text aligns with the content edge, while rows
|
|
254
|
-
// keep their own side padding. Rows
|
|
255
|
-
// its own.
|
|
254
|
+
// keep their own side padding. Rows at the top or bottom edge take the full block padding,
|
|
255
|
+
// since each row brings its own, and take half beside other content.
|
|
256
256
|
size: {
|
|
257
257
|
large: {
|
|
258
258
|
borderRadius: '16',
|
|
@@ -260,6 +260,8 @@ namespace styles {
|
|
|
260
260
|
selectors: {
|
|
261
261
|
'& > table, & > [data-rows]': { marginInline: '-24' },
|
|
262
262
|
'& > [data-rows]': { marginBlock: '-12' },
|
|
263
|
+
'& > [data-rows]:first-child': { marginBlockStart: '-24' },
|
|
264
|
+
'& > [data-rows]:last-child': { marginBlockEnd: '-24' },
|
|
263
265
|
'& > table': { width: `calc(100% + ${vars.spacing['48']}) !custom` },
|
|
264
266
|
'& > table > caption, & > table tr > :first-child': {
|
|
265
267
|
paddingInlineStart: '24',
|
|
@@ -283,6 +285,8 @@ namespace styles {
|
|
|
283
285
|
selectors: {
|
|
284
286
|
'& > table, & > [data-rows]': { marginInline: '-16' },
|
|
285
287
|
'& > [data-rows]': { marginBlock: '-8' },
|
|
288
|
+
'& > [data-rows]:first-child': { marginBlockStart: '-16' },
|
|
289
|
+
'& > [data-rows]:last-child': { marginBlockEnd: '-16' },
|
|
286
290
|
'& > table': { width: `calc(100% + ${vars.spacing['32']}) !custom` },
|
|
287
291
|
'& > table > caption, & > table tr > :first-child': {
|
|
288
292
|
paddingInlineStart: '16',
|
|
@@ -306,6 +310,8 @@ namespace styles {
|
|
|
306
310
|
selectors: {
|
|
307
311
|
'& > table, & > [data-rows]': { marginInline: '-12' },
|
|
308
312
|
'& > [data-rows]': { marginBlock: '-6' },
|
|
313
|
+
'& > [data-rows]:first-child': { marginBlockStart: '-12' },
|
|
314
|
+
'& > [data-rows]:last-child': { marginBlockEnd: '-12' },
|
|
309
315
|
'& > table': { width: `calc(100% + ${vars.spacing['24']}) !custom` },
|
|
310
316
|
'& > table > caption, & > table tr > :first-child': {
|
|
311
317
|
paddingInlineStart: '12',
|
|
@@ -234,6 +234,16 @@ export namespace styles {
|
|
|
234
234
|
},
|
|
235
235
|
},
|
|
236
236
|
default: {},
|
|
237
|
+
// Fills only on hover, for a picker inside a row. As a button, it sizes to its content.
|
|
238
|
+
text: {
|
|
239
|
+
backgroundColor: 'transparent !custom',
|
|
240
|
+
selectors: {
|
|
241
|
+
'&:is(button)': { width: 'auto !custom' },
|
|
242
|
+
'&:hover:not(:disabled, [data-disabled], :has(input:disabled))': {
|
|
243
|
+
backgroundColor: 'grayAlpha.100',
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
},
|
|
237
247
|
},
|
|
238
248
|
},
|
|
239
249
|
},
|
package/src/web/vars.ts
CHANGED
|
@@ -58,10 +58,10 @@ export const variables = Vars.define(
|
|
|
58
58
|
},
|
|
59
59
|
// Lifts surfaces off the near-black page in dark mode, so cards and popups stay distinct.
|
|
60
60
|
// `raised` fills popups and dialogs above surfaces. `indicator` fills the selected segment of a
|
|
61
|
-
// segmented control.
|
|
62
|
-
// dark mode.
|
|
61
|
+
// segmented control. `chip` matches grayAlpha 100, so it stays dim on gray fills. The status
|
|
62
|
+
// fills tint callouts with step 300 in light mode and step 100 in dark mode.
|
|
63
63
|
background: {
|
|
64
|
-
chip: { dark: '#
|
|
64
|
+
chip: { dark: '#ffffff12', light: '#0000000d' },
|
|
65
65
|
indicator: { dark: 'rgb(255 255 255 / 0.16)', light: '#fff' },
|
|
66
66
|
info: { dark: '#161b29', light: '#e6eefe' },
|
|
67
67
|
negative: { dark: '#2a1410', light: '#ffe6e0' },
|
|
@@ -405,6 +405,15 @@ export const variables = Vars.define(
|
|
|
405
405
|
fontWeight: 400,
|
|
406
406
|
letterSpacing: '0px',
|
|
407
407
|
lineHeight: '18px',
|
|
408
|
+
// Matches the 500 weight of `label.*.strong` row text, for a Hex value in a row.
|
|
409
|
+
strong: {
|
|
410
|
+
fontFamily:
|
|
411
|
+
'"Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',
|
|
412
|
+
fontSize: '13px',
|
|
413
|
+
fontWeight: 500,
|
|
414
|
+
letterSpacing: '0px',
|
|
415
|
+
lineHeight: '18px',
|
|
416
|
+
},
|
|
408
417
|
},
|
|
409
418
|
},
|
|
410
419
|
'14': {
|
package/src/web/zyzz.config.ts
CHANGED
|
@@ -32,12 +32,83 @@ export const { style, variants, vars } = Config.create({
|
|
|
32
32
|
vars: variables,
|
|
33
33
|
})
|
|
34
34
|
|
|
35
|
+
// Inter's subsets, written by `scripts/subset-fonts.ts`. A browser downloads only the subsets whose
|
|
36
|
+
// `unicodeRange` the page's text uses, and a face declared later takes precedence where ranges
|
|
37
|
+
// overlap, so the order is intentional: `symbols` first and `latin` last, as Google Fonts orders them.
|
|
35
38
|
fontFace({
|
|
36
39
|
fontDisplay: 'swap',
|
|
37
40
|
fontFamily: 'Inter',
|
|
38
41
|
fontStyle: 'normal',
|
|
39
42
|
fontWeight: '100 900',
|
|
40
|
-
src: "url('../fonts/Inter-
|
|
43
|
+
src: "url('../fonts/Inter-symbols.woff2') format('woff2')",
|
|
44
|
+
unicodeRange:
|
|
45
|
+
'U+02CD-036F,U+0E3F,U+1DC0-1DFF,U+2070-2298,U+2303-232B,U+2380-238B,U+23CE-23CF,U+2423-2468,U+24B6-24EA,U+25A0-26A0,U+2713-2788,U+27EF-27FA,U+2913,U+2A38,U+2B06-2B24,U+2E18,U+A92E,U+E000-E163,U+E1C3-E2DC,U+EE01-EEE1,U+F6C3,U+1F12F-1F16B,U+1F850-1F852',
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
fontFace({
|
|
49
|
+
fontDisplay: 'swap',
|
|
50
|
+
fontFamily: 'Inter',
|
|
51
|
+
fontStyle: 'normal',
|
|
52
|
+
fontWeight: '100 900',
|
|
53
|
+
src: "url('../fonts/Inter-cyrillic-ext.woff2') format('woff2')",
|
|
54
|
+
unicodeRange: 'U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F',
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
fontFace({
|
|
58
|
+
fontDisplay: 'swap',
|
|
59
|
+
fontFamily: 'Inter',
|
|
60
|
+
fontStyle: 'normal',
|
|
61
|
+
fontWeight: '100 900',
|
|
62
|
+
src: "url('../fonts/Inter-cyrillic.woff2') format('woff2')",
|
|
63
|
+
unicodeRange: 'U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116',
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
fontFace({
|
|
67
|
+
fontDisplay: 'swap',
|
|
68
|
+
fontFamily: 'Inter',
|
|
69
|
+
fontStyle: 'normal',
|
|
70
|
+
fontWeight: '100 900',
|
|
71
|
+
src: "url('../fonts/Inter-greek-ext.woff2') format('woff2')",
|
|
72
|
+
unicodeRange: 'U+1F00-1FFF',
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
fontFace({
|
|
76
|
+
fontDisplay: 'swap',
|
|
77
|
+
fontFamily: 'Inter',
|
|
78
|
+
fontStyle: 'normal',
|
|
79
|
+
fontWeight: '100 900',
|
|
80
|
+
src: "url('../fonts/Inter-greek.woff2') format('woff2')",
|
|
81
|
+
unicodeRange: 'U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF',
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
fontFace({
|
|
85
|
+
fontDisplay: 'swap',
|
|
86
|
+
fontFamily: 'Inter',
|
|
87
|
+
fontStyle: 'normal',
|
|
88
|
+
fontWeight: '100 900',
|
|
89
|
+
src: "url('../fonts/Inter-vietnamese.woff2') format('woff2')",
|
|
90
|
+
unicodeRange:
|
|
91
|
+
'U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB',
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
fontFace({
|
|
95
|
+
fontDisplay: 'swap',
|
|
96
|
+
fontFamily: 'Inter',
|
|
97
|
+
fontStyle: 'normal',
|
|
98
|
+
fontWeight: '100 900',
|
|
99
|
+
src: "url('../fonts/Inter-latin-ext.woff2') format('woff2')",
|
|
100
|
+
unicodeRange:
|
|
101
|
+
'U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF',
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
fontFace({
|
|
105
|
+
fontDisplay: 'swap',
|
|
106
|
+
fontFamily: 'Inter',
|
|
107
|
+
fontStyle: 'normal',
|
|
108
|
+
fontWeight: '100 900',
|
|
109
|
+
src: "url('../fonts/Inter-latin.woff2') format('woff2')",
|
|
110
|
+
unicodeRange:
|
|
111
|
+
'U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD',
|
|
41
112
|
})
|
|
42
113
|
|
|
43
114
|
fontFace({
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ColorValue } from 'react-native';
|
|
2
|
-
/** Resolves a compiled style's color for props that take a color instead of a style, such as SVG fills. */
|
|
3
|
-
export declare function useColor(style: Readonly<Record<string, string | number | undefined>> | undefined): ColorValue;
|
|
4
|
-
//# sourceMappingURL=useColor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useColor.d.ts","sourceRoot":"","sources":["../../../src/mobile/internal/useColor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAG9C,2GAA2G;AAC3G,wBAAgB,QAAQ,CACtB,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC,GAAG,SAAS,GACvE,UAAU,CAMZ"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { useStyles } from 'zyzz/react-native';
|
|
2
|
-
/** Resolves a compiled style's color for props that take a color instead of a style, such as SVG fills. */
|
|
3
|
-
export function useColor(style) {
|
|
4
|
-
const color = useStyles().style(style).color;
|
|
5
|
-
if (typeof color === 'string')
|
|
6
|
-
return color;
|
|
7
|
-
// iOS resolves `system` schemes to dynamic colors, which Zyzz's resolved style type omits.
|
|
8
|
-
if (color && typeof color === 'object')
|
|
9
|
-
return color;
|
|
10
|
-
throw new Error('Expected a compiled style with a color');
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=useColor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useColor.js","sourceRoot":"","sources":["../../../src/mobile/internal/useColor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAE7C,2GAA2G;AAC3G,MAAM,UAAU,QAAQ,CACtB,KAAwE;IAExE,MAAM,KAAK,GAAY,SAAS,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,CAAA;IACrD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC3C,2FAA2F;IAC3F,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAmB,CAAA;IAClE,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAA;AAC3D,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ColorValue } from 'react-native'
|
|
2
|
-
import { useStyles } from 'zyzz/react-native'
|
|
3
|
-
|
|
4
|
-
/** Resolves a compiled style's color for props that take a color instead of a style, such as SVG fills. */
|
|
5
|
-
export function useColor(
|
|
6
|
-
style: Readonly<Record<string, string | number | undefined>> | undefined,
|
|
7
|
-
): ColorValue {
|
|
8
|
-
const color: unknown = useStyles().style(style).color
|
|
9
|
-
if (typeof color === 'string') return color
|
|
10
|
-
// iOS resolves `system` schemes to dynamic colors, which Zyzz's resolved style type omits.
|
|
11
|
-
if (color && typeof color === 'object') return color as ColorValue
|
|
12
|
-
throw new Error('Expected a compiled style with a color')
|
|
13
|
-
}
|