@tempoxyz/ds 0.3.6 → 0.3.7
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/web/components/Accordion.js.zyzz.json +1 -1
- package/dist/web/components/AddressCard.css +1 -1
- package/dist/web/components/AddressCard.js.zyzz.json +1 -1
- package/dist/web/components/AgentLogo.css +1 -1
- package/dist/web/components/AgentLogo.js.zyzz.json +1 -1
- package/dist/web/components/Alert.js.zyzz.json +1 -1
- package/dist/web/components/AlertDialog.js.zyzz.json +1 -1
- package/dist/web/components/Amount.js.zyzz.json +1 -1
- package/dist/web/components/AmountInput.css +1 -1
- package/dist/web/components/AmountInput.js +1 -1
- package/dist/web/components/AmountInput.js.map +1 -1
- package/dist/web/components/AmountInput.js.zyzz.json +1 -1
- package/dist/web/components/AppShell.css +1 -1
- package/dist/web/components/AppShell.d.ts +9 -7
- package/dist/web/components/AppShell.d.ts.map +1 -1
- package/dist/web/components/AppShell.js +11 -9
- package/dist/web/components/AppShell.js.map +1 -1
- package/dist/web/components/AppShell.js.zyzz.json +1 -1
- package/dist/web/components/AssetChip.css +1 -1
- package/dist/web/components/AssetChip.js.zyzz.json +1 -1
- package/dist/web/components/Autocomplete.js.zyzz.json +1 -1
- package/dist/web/components/Avatar.js.zyzz.json +1 -1
- package/dist/web/components/Badge.css +1 -1
- package/dist/web/components/Badge.d.ts +1 -1
- package/dist/web/components/Badge.js.map +1 -1
- package/dist/web/components/Badge.js.zyzz.json +1 -1
- package/dist/web/components/BadgedLogo.css +1 -0
- package/dist/web/components/BadgedLogo.d.ts +44 -0
- package/dist/web/components/BadgedLogo.d.ts.map +1 -0
- package/dist/web/components/BadgedLogo.js +59 -0
- package/dist/web/components/BadgedLogo.js.map +1 -0
- package/dist/web/components/BadgedLogo.js.zyzz.json +1 -0
- package/dist/web/components/Banner.js.zyzz.json +1 -1
- package/dist/web/components/BarChart.css +1 -1
- package/dist/web/components/BarChart.d.ts +1 -1
- package/dist/web/components/BarChart.js.map +1 -1
- package/dist/web/components/BarChart.js.zyzz.json +1 -1
- package/dist/web/components/Breadcrumbs.js.zyzz.json +1 -1
- package/dist/web/components/Button.css +1 -1
- package/dist/web/components/Button.d.ts +40 -31
- package/dist/web/components/Button.d.ts.map +1 -1
- package/dist/web/components/Button.js +25 -8
- package/dist/web/components/Button.js.map +1 -1
- package/dist/web/components/Button.js.zyzz.json +1 -1
- package/dist/web/components/ButtonGroup.js.zyzz.json +1 -1
- package/dist/web/components/Calendar.css +1 -1
- package/dist/web/components/Calendar.js.zyzz.json +1 -1
- package/dist/web/components/Callout.js.zyzz.json +1 -1
- package/dist/web/components/Checkbox.css +1 -1
- package/dist/web/components/Checkbox.js.zyzz.json +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.zyzz.json +1 -1
- package/dist/web/components/Choicebox.css +1 -1
- package/dist/web/components/Choicebox.js.zyzz.json +1 -1
- package/dist/web/components/Code.js.zyzz.json +1 -1
- package/dist/web/components/Combobox.css +1 -1
- package/dist/web/components/Combobox.js.zyzz.json +1 -1
- package/dist/web/components/Container.js.zyzz.json +1 -1
- package/dist/web/components/CopyButton.js.zyzz.json +1 -1
- package/dist/web/components/DatePicker.css +1 -1
- package/dist/web/components/DatePicker.js.zyzz.json +1 -1
- package/dist/web/components/Dialog.css +1 -1
- package/dist/web/components/Dialog.d.ts +14 -0
- package/dist/web/components/Dialog.d.ts.map +1 -1
- package/dist/web/components/Dialog.js +7 -5
- package/dist/web/components/Dialog.js.map +1 -1
- package/dist/web/components/Dialog.js.zyzz.json +1 -1
- package/dist/web/components/Drawer.css +1 -1
- package/dist/web/components/Drawer.js.zyzz.json +1 -1
- package/dist/web/components/Empty.js.zyzz.json +1 -1
- package/dist/web/components/Field.js.zyzz.json +1 -1
- package/dist/web/components/Fieldset.js.zyzz.json +1 -1
- package/dist/web/components/Frame.js.zyzz.json +1 -1
- package/dist/web/components/Gauge.js.zyzz.json +1 -1
- package/dist/web/components/GetStartedVisual.js.zyzz.json +1 -1
- package/dist/web/components/Grid.js.zyzz.json +1 -1
- package/dist/web/components/HeroVisual.js.zyzz.json +1 -1
- package/dist/web/components/Hex.js.zyzz.json +1 -1
- package/dist/web/components/IconTile.js.zyzz.json +1 -1
- package/dist/web/components/Identicon.js.zyzz.json +1 -1
- package/dist/web/components/Inline.js.zyzz.json +1 -1
- package/dist/web/components/Inset.js.zyzz.json +1 -1
- package/dist/web/components/Kbd.js.zyzz.json +1 -1
- package/dist/web/components/ListGroup.css +1 -1
- package/dist/web/components/ListGroup.d.ts +46 -4
- package/dist/web/components/ListGroup.d.ts.map +1 -1
- package/dist/web/components/ListGroup.js +11 -9
- package/dist/web/components/ListGroup.js.map +1 -1
- package/dist/web/components/ListGroup.js.zyzz.json +1 -1
- package/dist/web/components/LoadingDots.js.zyzz.json +1 -1
- package/dist/web/components/Menu.css +1 -1
- package/dist/web/components/Menu.js.zyzz.json +1 -1
- package/dist/web/components/NativeSelect.css +1 -1
- package/dist/web/components/NativeSelect.js.zyzz.json +1 -1
- package/dist/web/components/NetworkLogo.js.zyzz.json +1 -1
- package/dist/web/components/NumberField.js.zyzz.json +1 -1
- package/dist/web/components/OtpField.css +1 -1
- package/dist/web/components/OtpField.js.zyzz.json +1 -1
- package/dist/web/components/Pagination.css +1 -1
- package/dist/web/components/Pagination.js.zyzz.json +1 -1
- package/dist/web/components/Popover.css +1 -1
- package/dist/web/components/Popover.js.zyzz.json +1 -1
- package/dist/web/components/Progress.js.zyzz.json +1 -1
- package/dist/web/components/Qr.js.zyzz.json +1 -1
- package/dist/web/components/RadioGroup.css +1 -1
- package/dist/web/components/RadioGroup.js.zyzz.json +1 -1
- package/dist/web/components/SecretValue.js.zyzz.json +1 -1
- package/dist/web/components/Select.css +1 -1
- package/dist/web/components/Select.d.ts +14 -7
- package/dist/web/components/Select.d.ts.map +1 -1
- package/dist/web/components/Select.js +8 -6
- package/dist/web/components/Select.js.map +1 -1
- package/dist/web/components/Select.js.zyzz.json +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.d.ts +99 -9
- package/dist/web/components/SidebarMenu.d.ts.map +1 -1
- package/dist/web/components/SidebarMenu.js +56 -3
- package/dist/web/components/SidebarMenu.js.map +1 -1
- package/dist/web/components/SidebarMenu.js.zyzz.json +1 -1
- package/dist/web/components/Skeleton.js.zyzz.json +1 -1
- package/dist/web/components/Slider.js.zyzz.json +1 -1
- package/dist/web/components/Snippet.css +1 -1
- package/dist/web/components/Snippet.js.zyzz.json +1 -1
- package/dist/web/components/Spinner.css +1 -1
- package/dist/web/components/Spinner.d.ts +40 -12
- package/dist/web/components/Spinner.d.ts.map +1 -1
- package/dist/web/components/Spinner.js +8 -7
- package/dist/web/components/Spinner.js.map +1 -1
- package/dist/web/components/Spinner.js.zyzz.json +1 -1
- package/dist/web/components/SplitBar.js.zyzz.json +1 -1
- package/dist/web/components/SplitButton.js.zyzz.json +1 -1
- package/dist/web/components/Stack.js.zyzz.json +1 -1
- package/dist/web/components/StatusChip.js.zyzz.json +1 -1
- package/dist/web/components/StatusIndicator.js.zyzz.json +1 -1
- package/dist/web/components/StatusRow.js.zyzz.json +1 -1
- package/dist/web/components/Stepper.js.zyzz.json +1 -1
- package/dist/web/components/SuccessHero.css +1 -1
- package/dist/web/components/SuccessHero.d.ts.map +1 -1
- package/dist/web/components/SuccessHero.js +0 -2
- package/dist/web/components/SuccessHero.js.map +1 -1
- package/dist/web/components/SuccessHero.js.zyzz.json +1 -1
- package/dist/web/components/Surface.css +1 -1
- package/dist/web/components/Surface.d.ts +1 -1
- 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.d.ts +1 -1
- package/dist/web/components/Switch.js.map +1 -1
- package/dist/web/components/Switch.js.zyzz.json +1 -1
- package/dist/web/components/Table.css +1 -1
- package/dist/web/components/Table.js.zyzz.json +1 -1
- package/dist/web/components/Tabs.css +1 -1
- package/dist/web/components/Tabs.js.zyzz.json +1 -1
- package/dist/web/components/TempoLogo.js.zyzz.json +1 -1
- package/dist/web/components/TextInput.js.zyzz.json +1 -1
- package/dist/web/components/Textarea.css +1 -1
- package/dist/web/components/Textarea.js.zyzz.json +1 -1
- package/dist/web/components/Toast.css +1 -1
- package/dist/web/components/Toast.d.ts.map +1 -1
- package/dist/web/components/Toast.js +3 -3
- package/dist/web/components/Toast.js.map +1 -1
- package/dist/web/components/Toast.js.zyzz.json +1 -1
- package/dist/web/components/Token.css +1 -1
- package/dist/web/components/Token.d.ts.map +1 -1
- package/dist/web/components/Token.js +1 -1
- package/dist/web/components/Token.js.map +1 -1
- package/dist/web/components/Token.js.zyzz.json +1 -1
- package/dist/web/components/TokenLogo.js.zyzz.json +1 -1
- package/dist/web/components/Tooltip.css +1 -1
- package/dist/web/components/Tooltip.js.zyzz.json +1 -1
- package/dist/web/components/VerificationCode.js.zyzz.json +1 -1
- package/dist/web/components/Visual.css +1 -1
- package/dist/web/components/Visual.js.zyzz.json +1 -1
- package/dist/web/components/internal/Field.css +1 -1
- 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.js.zyzz.json +1 -1
- package/dist/web/components/internal/Listbox.css +1 -1
- package/dist/web/components/internal/Listbox.js.zyzz.json +1 -1
- package/dist/web/components/internal/Streaks.js.zyzz.json +1 -1
- package/dist/web/index.d.ts +1 -0
- package/dist/web/index.d.ts.map +1 -1
- package/dist/web/index.js +1 -0
- package/dist/web/index.js.map +1 -1
- package/dist/web/index.js.zyzz.json +1 -1
- package/dist/web/vars.d.ts +34 -4
- 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 +170 -20
- package/dist/web/zyzz.config.d.ts.map +1 -1
- package/dist/web/zyzz.config.js.zyzz.json +1 -1
- package/package.json +1 -1
- package/src/web/components/AmountInput.tsx +6 -1
- package/src/web/components/AppShell.tsx +19 -10
- package/src/web/components/Badge.tsx +1 -1
- package/src/web/components/BadgedLogo.tsx +125 -0
- package/src/web/components/BarChart.tsx +1 -1
- package/src/web/components/Button.tsx +66 -36
- package/src/web/components/Dialog.tsx +11 -0
- package/src/web/components/ListGroup.tsx +53 -7
- package/src/web/components/Select.tsx +15 -8
- package/src/web/components/SidebarMenu.tsx +162 -9
- package/src/web/components/Spinner.tsx +34 -11
- package/src/web/components/SuccessHero.tsx +2 -4
- package/src/web/components/Surface.tsx +1 -1
- package/src/web/components/Switch.tsx +1 -1
- package/src/web/components/Toast.tsx +14 -1
- package/src/web/components/Token.tsx +2 -4
- package/src/web/index.ts +1 -0
- package/src/web/vars.ts +25 -5
|
@@ -12,7 +12,9 @@ import {
|
|
|
12
12
|
import type * as zyzz from 'zyzz'
|
|
13
13
|
import { ChevronDown } from '../icons/ChevronDown.js'
|
|
14
14
|
import { ChevronRight } from '../icons/ChevronRight.js'
|
|
15
|
+
import { Close } from '../icons/Close.js'
|
|
15
16
|
import { style, variants } from '../zyzz.config.js'
|
|
17
|
+
import { Button } from './Button.js'
|
|
16
18
|
import * as TabBar from './internal/TabBar.js'
|
|
17
19
|
import * as Text from './internal/Text.js'
|
|
18
20
|
|
|
@@ -262,6 +264,101 @@ export namespace SidebarMenu {
|
|
|
262
264
|
export type Props = ComponentPropsWithRef<'span'> & zyzz.Props.Variants<typeof styles.logo>
|
|
263
265
|
}
|
|
264
266
|
|
|
267
|
+
/**
|
|
268
|
+
* Renders the brand at the top of a sidebar, such as a 20px `TempoLogo`, in the primary content
|
|
269
|
+
* color and 12px from the start edge of the items. Put it in `AppShell.SidebarHeader`. In an
|
|
270
|
+
* `AppShell` with `collapse`, it centers its content from 768px to 1023px, which fits
|
|
271
|
+
* `TempoLogo` with `type="mark"`.
|
|
272
|
+
*
|
|
273
|
+
* @example
|
|
274
|
+
* <AppShell.SidebarHeader>
|
|
275
|
+
* <SidebarMenu.Mark>
|
|
276
|
+
* <TempoLogo aria-label="Tempo" />
|
|
277
|
+
* </SidebarMenu.Mark>
|
|
278
|
+
* </AppShell.SidebarHeader>
|
|
279
|
+
*/
|
|
280
|
+
export function Mark(props: Mark.Props) {
|
|
281
|
+
const { className, vars, ...attributes } = props
|
|
282
|
+
|
|
283
|
+
return <div {...attributes} {...styles.mark({ className, style: props.style, vars })} />
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export namespace Mark {
|
|
287
|
+
export type Props = ComponentPropsWithRef<'div'> & zyzz.Props.Variants<typeof styles.mark>
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Renders a card at the bottom of a sidebar that promotes one task, such as setting up a
|
|
292
|
+
* passkey: `title`, an optional dismiss button, `children` as the description, then `action`,
|
|
293
|
+
* which spans the card. The card is a `group` named by its title. Put it in
|
|
294
|
+
* `AppShell.SidebarFooter`, above the account row. The collapsed sidebar of an `AppShell` with
|
|
295
|
+
* `collapse` hides it from 768px to 1023px.
|
|
296
|
+
*
|
|
297
|
+
* @example
|
|
298
|
+
* <SidebarMenu.Promo
|
|
299
|
+
* action={
|
|
300
|
+
* <Button size="small" variant="secondary">
|
|
301
|
+
* Set up
|
|
302
|
+
* </Button>
|
|
303
|
+
* }
|
|
304
|
+
* onDismiss={dismiss}
|
|
305
|
+
* title="Set up a passkey"
|
|
306
|
+
* >
|
|
307
|
+
* Sign in with Face ID or Touch ID instead of a code.
|
|
308
|
+
* </SidebarMenu.Promo>
|
|
309
|
+
*/
|
|
310
|
+
export function Promo(props: Promo.Props) {
|
|
311
|
+
const { action, children, className, onDismiss, title, vars, ...attributes } = props
|
|
312
|
+
const id = useId()
|
|
313
|
+
|
|
314
|
+
return (
|
|
315
|
+
<div
|
|
316
|
+
aria-labelledby={id}
|
|
317
|
+
role="group"
|
|
318
|
+
{...attributes}
|
|
319
|
+
{...styles.promo({ className, style: props.style, vars })}
|
|
320
|
+
>
|
|
321
|
+
<div {...styles.promoHeader()}>
|
|
322
|
+
<span id={id} {...styles.promoTitle()}>
|
|
323
|
+
{title}
|
|
324
|
+
</span>
|
|
325
|
+
{onDismiss && (
|
|
326
|
+
<Button
|
|
327
|
+
aria-label="Dismiss"
|
|
328
|
+
onClick={onDismiss}
|
|
329
|
+
shape="icon"
|
|
330
|
+
size="small"
|
|
331
|
+
variant="tertiary"
|
|
332
|
+
>
|
|
333
|
+
<Close />
|
|
334
|
+
</Button>
|
|
335
|
+
)}
|
|
336
|
+
</div>
|
|
337
|
+
{children !== undefined && children !== null && (
|
|
338
|
+
<p {...styles.promoDescription()}>{children}</p>
|
|
339
|
+
)}
|
|
340
|
+
{action}
|
|
341
|
+
</div>
|
|
342
|
+
)
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
export namespace Promo {
|
|
346
|
+
export type Props = Omit<ComponentPropsWithRef<'div'>, 'title'> &
|
|
347
|
+
zyzz.Props.Variants<typeof styles.promo> & {
|
|
348
|
+
/** The call to action under the description, such as a small `secondary` `Button`. */
|
|
349
|
+
action?: ReactNode | undefined
|
|
350
|
+
/** The description in the secondary color. Absent, the action follows the title. */
|
|
351
|
+
children?: ReactNode | undefined
|
|
352
|
+
/**
|
|
353
|
+
* Called when the dismiss button is pressed. Remove the card in it. Absent, the card
|
|
354
|
+
* renders no dismiss button.
|
|
355
|
+
*/
|
|
356
|
+
onDismiss?: (() => void) | undefined
|
|
357
|
+
/** The heading of the card, which names its group. */
|
|
358
|
+
title: ReactNode
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
|
|
265
362
|
/**
|
|
266
363
|
* Renders the `<nav>` landmark, labelled `Main` unless you pass `aria-label`. Give each
|
|
267
364
|
* landmark on a page a distinct label. `size` sets 32, 36 or 56px rows, and `small` also uses
|
|
@@ -504,12 +601,12 @@ namespace styles {
|
|
|
504
601
|
base: {
|
|
505
602
|
display: 'flex',
|
|
506
603
|
flexDirection: 'column',
|
|
507
|
-
rowGap: '
|
|
604
|
+
rowGap: '4',
|
|
508
605
|
selectors: {
|
|
509
606
|
// With the row gap of the menu, groups sit 24px below preceding content, or 16px in a
|
|
510
607
|
// small menu.
|
|
511
|
-
'* + &': { marginTop: '
|
|
512
|
-
'[data-sidebar-menu-size="
|
|
608
|
+
'* + &': { marginTop: '20' },
|
|
609
|
+
'[data-sidebar-menu-size="small"] &': { rowGap: '2' },
|
|
513
610
|
'[data-sidebar-menu-size="small"] * + &': { marginTop: '0.875rem !custom' },
|
|
514
611
|
},
|
|
515
612
|
},
|
|
@@ -654,11 +751,64 @@ namespace styles {
|
|
|
654
751
|
{ id: 'tds/web/sidebar-menu/logo' },
|
|
655
752
|
)
|
|
656
753
|
|
|
754
|
+
export const mark = variants(
|
|
755
|
+
{
|
|
756
|
+
base: {
|
|
757
|
+
alignItems: 'center',
|
|
758
|
+
color: 'content.primary',
|
|
759
|
+
display: 'flex',
|
|
760
|
+
paddingInlineStart: '12',
|
|
761
|
+
'@media (min-width: 768px) and (max-width: 1023px)': {
|
|
762
|
+
selectors: {
|
|
763
|
+
'[data-app-shell-rail] &': { justifyContent: 'center', paddingInlineStart: '0' },
|
|
764
|
+
},
|
|
765
|
+
},
|
|
766
|
+
},
|
|
767
|
+
},
|
|
768
|
+
{ id: 'tds/web/sidebar-menu/mark' },
|
|
769
|
+
)
|
|
770
|
+
|
|
771
|
+
// A box at the `sm` radius pads by 16px.
|
|
772
|
+
export const promo = variants(
|
|
773
|
+
{
|
|
774
|
+
base: {
|
|
775
|
+
backgroundColor: 'container.regular',
|
|
776
|
+
borderRadius: 'sm',
|
|
777
|
+
boxSizing: 'border-box',
|
|
778
|
+
display: 'flex',
|
|
779
|
+
flexDirection: 'column',
|
|
780
|
+
padding: '16',
|
|
781
|
+
rowGap: '12',
|
|
782
|
+
'@media (min-width: 768px) and (max-width: 1023px)': {
|
|
783
|
+
selectors: { '[data-app-shell-rail] &': { display: 'none !custom' } },
|
|
784
|
+
},
|
|
785
|
+
},
|
|
786
|
+
},
|
|
787
|
+
{ id: 'tds/web/sidebar-menu/promo' },
|
|
788
|
+
)
|
|
789
|
+
|
|
790
|
+
export const promoDescription = style(
|
|
791
|
+
{ color: 'content.secondary', margin: '0', typography: 'body.b3' },
|
|
792
|
+
{ id: 'tds/web/sidebar-menu/promo-description' },
|
|
793
|
+
)
|
|
794
|
+
|
|
795
|
+
// The dismiss button aligns its top edge with the first line of the title.
|
|
796
|
+
export const promoHeader = style(
|
|
797
|
+
{ alignItems: 'flex-start', columnGap: '8', display: 'flex' },
|
|
798
|
+
{ id: 'tds/web/sidebar-menu/promo-header' },
|
|
799
|
+
)
|
|
800
|
+
|
|
801
|
+
export const promoTitle = style(
|
|
802
|
+
{ color: 'content.primary', flex: '1 !custom', minWidth: '0', typography: 'body.b2Strong' },
|
|
803
|
+
{ id: 'tds/web/sidebar-menu/promo-title' },
|
|
804
|
+
)
|
|
805
|
+
|
|
657
806
|
export const root = variants(
|
|
658
807
|
{
|
|
659
|
-
|
|
808
|
+
// The Platform Wallet Sidebar spaces its items by 4px. Small rows keep 2px.
|
|
809
|
+
base: { display: 'flex', flexDirection: 'column', minWidth: '0', rowGap: '4' },
|
|
660
810
|
defaultVariants: { size: 'medium' },
|
|
661
|
-
variants: { size: { large: {
|
|
811
|
+
variants: { size: { large: {}, medium: {}, small: { rowGap: '2' } } },
|
|
662
812
|
},
|
|
663
813
|
{ id: 'tds/web/sidebar-menu' },
|
|
664
814
|
)
|
|
@@ -669,11 +819,14 @@ namespace styles {
|
|
|
669
819
|
flexDirection: 'column',
|
|
670
820
|
// Nested labels line up with the trigger's label: icon width plus the icon gap.
|
|
671
821
|
paddingInlineStart: '32',
|
|
672
|
-
paddingTop: '
|
|
673
|
-
rowGap: '
|
|
822
|
+
paddingTop: '4',
|
|
823
|
+
rowGap: '4',
|
|
674
824
|
selectors: {
|
|
675
|
-
'[data-sidebar-menu-size="
|
|
676
|
-
|
|
825
|
+
'[data-sidebar-menu-size="small"] &': {
|
|
826
|
+
paddingInlineStart: '24',
|
|
827
|
+
paddingTop: '2',
|
|
828
|
+
rowGap: '2',
|
|
829
|
+
},
|
|
677
830
|
},
|
|
678
831
|
'@media (min-width: 768px) and (max-width: 1023px)': {
|
|
679
832
|
selectors: { '[data-app-shell-rail] &': { paddingInlineStart: '0' } },
|
|
@@ -8,8 +8,9 @@ import { style, variants } from '../zyzz.config.js'
|
|
|
8
8
|
* An indeterminate loading indicator. Renders a Base UI `Progress.Root` with
|
|
9
9
|
* `role="progressbar"`, no `aria-valuenow`, and the name `Loading`. The arc draws in
|
|
10
10
|
* `currentColor` on a faint track, black in light mode and the text color in dark mode, and stops
|
|
11
|
-
* rotating under `prefers-reduced-motion: reduce`. `
|
|
12
|
-
* with a
|
|
11
|
+
* rotating under `prefers-reduced-motion: reduce`. `size` sets the ring to 16px or 40px, and the
|
|
12
|
+
* ring and its stroke scale together. `elevated` places a 16px ring on a 44px elevated tile with a
|
|
13
|
+
* shadow, whatever the `size`.
|
|
13
14
|
*
|
|
14
15
|
* - Pass `aria-label` to say what is loading, such as `Loading transactions`.
|
|
15
16
|
* - Show it only after a short delay, so fast responses do not flash an indicator.
|
|
@@ -24,13 +25,13 @@ import { style, variants } from '../zyzz.config.js'
|
|
|
24
25
|
* @see {@link https://www.w3.org/WAI/WCAG22/Understanding/pause-stop-hide.html | WCAG 2.2 Pause, Stop, Hide}
|
|
25
26
|
*/
|
|
26
27
|
export function Spinner(props: Spinner.Props) {
|
|
27
|
-
const { className, elevated, vars, ...attributes } = props
|
|
28
|
+
const { className, elevated, size, vars, ...attributes } = props
|
|
28
29
|
|
|
29
30
|
return (
|
|
30
31
|
<BaseUi.Progress.Root
|
|
31
32
|
aria-label="Loading"
|
|
32
33
|
{...attributes}
|
|
33
|
-
{...styles.spinner({ className, elevated, style: props.style, vars })}
|
|
34
|
+
{...styles.spinner({ className, elevated, size, style: props.style, vars })}
|
|
34
35
|
value={null}
|
|
35
36
|
>
|
|
36
37
|
<svg aria-hidden="true" {...styles.glyph()} fill="none" viewBox="0 0 16 16">
|
|
@@ -61,6 +62,8 @@ namespace styles {
|
|
|
61
62
|
animation: `${rotation} 0.8s linear infinite !custom`,
|
|
62
63
|
height: '100% !custom',
|
|
63
64
|
width: '100% !custom',
|
|
65
|
+
// The stroke keeps its CSS width at every size, instead of scaling with the view box.
|
|
66
|
+
selectors: { '& > *': { vectorEffect: 'non-scaling-stroke !custom' } },
|
|
64
67
|
'@media (prefers-reduced-motion: reduce)': { animation: 'none !custom' },
|
|
65
68
|
},
|
|
66
69
|
{ id: 'tds/web/spinner/glyph' },
|
|
@@ -77,12 +80,12 @@ namespace styles {
|
|
|
77
80
|
justifyContent: 'center',
|
|
78
81
|
width: '16',
|
|
79
82
|
},
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
// The designs draw the elevated tile only around the 16px ring, so the tile outranks `size`.
|
|
84
|
+
// The tile is a 44px square around the 16px ring.
|
|
85
|
+
compoundVariants: [
|
|
86
|
+
{
|
|
87
|
+
when: { elevated: true },
|
|
88
|
+
style: {
|
|
86
89
|
backgroundColor: 'background.elevated',
|
|
87
90
|
borderRadius: 'xs',
|
|
88
91
|
// Web has no elevated shadow step, so this repeats the Mobile `shadow.elevated` layers, in
|
|
@@ -90,7 +93,27 @@ namespace styles {
|
|
|
90
93
|
boxShadow: '0 12px 36px #0000000a, 0 8px 32px #0000000a, 0 4px 12px #0000000a !custom',
|
|
91
94
|
height: '44',
|
|
92
95
|
width: '44',
|
|
93
|
-
selectors: {
|
|
96
|
+
selectors: {
|
|
97
|
+
'& > svg': { height: '16', width: '16' },
|
|
98
|
+
'& > svg > *': { strokeWidth: '1px !custom' },
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
defaultVariants: { elevated: false, size: '16' },
|
|
104
|
+
variants: {
|
|
105
|
+
elevated: { false: {}, true: {} },
|
|
106
|
+
/**
|
|
107
|
+
* The width and height of the ring, in pixels. The 40px ring draws a 2.5px stroke.
|
|
108
|
+
*
|
|
109
|
+
* @default '16'
|
|
110
|
+
*/
|
|
111
|
+
size: {
|
|
112
|
+
'16': {},
|
|
113
|
+
'40': {
|
|
114
|
+
height: '40',
|
|
115
|
+
width: '40',
|
|
116
|
+
selectors: { '& > svg > *': { strokeWidth: '2.5px !custom' } },
|
|
94
117
|
},
|
|
95
118
|
},
|
|
96
119
|
},
|
|
@@ -201,9 +201,8 @@ namespace styles {
|
|
|
201
201
|
{ id: 'tds/web/success-hero/body' },
|
|
202
202
|
)
|
|
203
203
|
|
|
204
|
-
// Figma draws the caption at 50% white, which no variable holds.
|
|
205
204
|
export const caption = style(
|
|
206
|
-
{ color: '
|
|
205
|
+
{ color: 'overlay.content.tertiary', margin: '0', typography: 'body.b3Strong' },
|
|
207
206
|
{ id: 'tds/web/success-hero/caption' },
|
|
208
207
|
)
|
|
209
208
|
|
|
@@ -219,9 +218,8 @@ namespace styles {
|
|
|
219
218
|
{ id: 'tds/web/success-hero/content' },
|
|
220
219
|
)
|
|
221
220
|
|
|
222
|
-
// Figma draws the description at 60% white, which no variable holds.
|
|
223
221
|
export const description = style(
|
|
224
|
-
{ color: '
|
|
222
|
+
{ color: 'overlay.content.secondary', margin: '0', typography: 'body.b2' },
|
|
225
223
|
{ id: 'tds/web/success-hero/description' },
|
|
226
224
|
)
|
|
227
225
|
|
|
@@ -131,7 +131,7 @@ namespace styles {
|
|
|
131
131
|
'&::after': { content: '"" !custom', inset: '-8', position: 'absolute' },
|
|
132
132
|
'&:focus-visible': { outlineColor: 'border.focus', outlineOffset: '2' },
|
|
133
133
|
'&:hover:not([data-disabled]):not([data-checked])': { backgroundColor: 'line.primary' },
|
|
134
|
-
'&[data-checked]': { backgroundColor: '
|
|
134
|
+
'&[data-checked]': { backgroundColor: 'inverse.background.primary' },
|
|
135
135
|
'&[data-checked]:hover:not([data-disabled])': { opacity: 'hover' },
|
|
136
136
|
'&[data-disabled]': { cursor: 'default', opacity: 'disabled' },
|
|
137
137
|
'&[data-invalid]': {
|
|
@@ -309,7 +309,7 @@ namespace styles {
|
|
|
309
309
|
|
|
310
310
|
export const root = style(
|
|
311
311
|
{
|
|
312
|
-
backgroundColor: 'background.
|
|
312
|
+
backgroundColor: 'background.menu',
|
|
313
313
|
borderRadius: 'sm',
|
|
314
314
|
boxShadow: 'large',
|
|
315
315
|
boxSizing: 'border-box',
|
|
@@ -328,6 +328,19 @@ namespace styles {
|
|
|
328
328
|
userSelect: 'none',
|
|
329
329
|
zIndex: 'calc(1000 - var(--toast-index)) !custom',
|
|
330
330
|
selectors: {
|
|
331
|
+
// The 1px card line is inset, so it adds nothing to the height that Base UI measures.
|
|
332
|
+
'&::before': {
|
|
333
|
+
borderColor: 'line.card',
|
|
334
|
+
borderRadius: 'inherit !custom',
|
|
335
|
+
borderStyle: 'solid !custom',
|
|
336
|
+
borderWidth: 'regular',
|
|
337
|
+
boxSizing: 'border-box',
|
|
338
|
+
content: '"" !custom',
|
|
339
|
+
cornerShape: 'inherit !custom',
|
|
340
|
+
inset: '0',
|
|
341
|
+
pointerEvents: 'none',
|
|
342
|
+
position: 'absolute',
|
|
343
|
+
},
|
|
331
344
|
'&::after': {
|
|
332
345
|
content: '"" !custom',
|
|
333
346
|
height: '16',
|
|
@@ -82,11 +82,9 @@ namespace styles {
|
|
|
82
82
|
export const token = style(
|
|
83
83
|
{
|
|
84
84
|
alignItems: 'center',
|
|
85
|
-
backgroundColor: '
|
|
86
|
-
|
|
85
|
+
backgroundColor: 'container.selected',
|
|
86
|
+
border: 'none !custom',
|
|
87
87
|
borderRadius: 'full',
|
|
88
|
-
borderStyle: 'solid',
|
|
89
|
-
borderWidth: 'regular',
|
|
90
88
|
boxSizing: 'border-box',
|
|
91
89
|
color: 'content.primary',
|
|
92
90
|
columnGap: '8',
|
package/src/web/index.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { AssetChip } from './components/AssetChip.js'
|
|
|
10
10
|
export { Autocomplete } from './components/Autocomplete.js'
|
|
11
11
|
export { Avatar } from './components/Avatar.js'
|
|
12
12
|
export { Badge } from './components/Badge.js'
|
|
13
|
+
export { BadgedLogo } from './components/BadgedLogo.js'
|
|
13
14
|
export { Banner } from './components/Banner.js'
|
|
14
15
|
export { BarChart } from './components/BarChart.js'
|
|
15
16
|
export { Breadcrumbs } from './components/Breadcrumbs.js'
|
package/src/web/vars.ts
CHANGED
|
@@ -384,12 +384,16 @@ export const variables = Vars.define(
|
|
|
384
384
|
},
|
|
385
385
|
},
|
|
386
386
|
},
|
|
387
|
+
// Dark mode lifts the page to 92% black, and the elevated and menu fills step lighter from
|
|
388
|
+
// it, at the Platform primitive solid steps 090 and 087, which TDS 1.0 Core has no step for.
|
|
387
389
|
background: {
|
|
388
|
-
elevated: { dark:
|
|
389
|
-
|
|
390
|
+
elevated: { dark: '#1a1a1a', light: vars.color.neutral['000'] },
|
|
391
|
+
menu: { dark: '#222', light: vars.color.neutral['000'] },
|
|
392
|
+
primary: { dark: vars.color.neutral['092'], light: vars.color.neutral['004'] },
|
|
390
393
|
secondary: { dark: vars.color.neutral['092'], light: vars.color.neutral['000'] },
|
|
391
|
-
// The layouts fill the sidebar
|
|
392
|
-
|
|
394
|
+
// The layouts fill the sidebar a step lighter than the page in light mode, and with the page
|
|
395
|
+
// in dark mode.
|
|
396
|
+
sidebar: { dark: vars.color.neutral['092'], light: '#fafafa' },
|
|
393
397
|
},
|
|
394
398
|
border: {
|
|
395
399
|
focus: { dark: vars.color.neutral.tint['052'], light: vars.color.neutral.shade['040'] },
|
|
@@ -457,6 +461,8 @@ export const variables = Vars.define(
|
|
|
457
461
|
},
|
|
458
462
|
container: {
|
|
459
463
|
accent: vars.color.accent.alpha.regular.blue['100'],
|
|
464
|
+
// The quiet fill of inputs and other controls.
|
|
465
|
+
control: { dark: vars.color.neutral.tint['004'], light: vars.color.neutral.shade['004'] },
|
|
460
466
|
negative: {
|
|
461
467
|
dark: vars.color.accent.alpha.regular.red['200'],
|
|
462
468
|
light: vars.color.accent.alpha.regular.red['100'],
|
|
@@ -468,6 +474,10 @@ export const variables = Vars.define(
|
|
|
468
474
|
// Dark mode fills the regular container at 8% white, dimmer than Figma's 12%, so badges and
|
|
469
475
|
// other soft fills recede on the dark page.
|
|
470
476
|
regular: { dark: vars.color.neutral.tint['008'], light: vars.color.neutral.shade['004'] },
|
|
477
|
+
// The fill of a selected option, such as a picker row.
|
|
478
|
+
selected: { dark: vars.color.neutral.tint['012'], light: vars.color.neutral['000'] },
|
|
479
|
+
// An opaque fill at the Platform primitive solid steps 079 and 010.
|
|
480
|
+
solid: { dark: '#353535', light: '#e6e6e6' },
|
|
471
481
|
strong: { dark: vars.color.neutral.tint['016'], light: vars.color.neutral.shade['008'] },
|
|
472
482
|
special: 'rgb(126 89 228 / 0.08)',
|
|
473
483
|
subtle: { dark: vars.color.neutral.tint['008'], light: vars.color.neutral.shade['003'] },
|
|
@@ -500,6 +510,8 @@ export const variables = Vars.define(
|
|
|
500
510
|
},
|
|
501
511
|
},
|
|
502
512
|
line: {
|
|
513
|
+
// The border of a card, at 5% white in dark mode.
|
|
514
|
+
card: { dark: '#ffffff0d', light: vars.color.neutral.shade['008'] },
|
|
503
515
|
primary: { dark: vars.color.neutral.tint['024'], light: vars.color.neutral.shade['016'] },
|
|
504
516
|
// Dark mode draws the secondary line at 8% white, dimmer than Figma's 16%, so the borders
|
|
505
517
|
// and dividers recede on the dark fills.
|
|
@@ -508,6 +520,8 @@ export const variables = Vars.define(
|
|
|
508
520
|
},
|
|
509
521
|
material: {
|
|
510
522
|
regular: { dark: vars.color.neutral.tint['048'], light: vars.color.neutral.shade['040'] },
|
|
523
|
+
// The grain over a material, at 7%.
|
|
524
|
+
texture: { dark: '#ffffff12', light: '#00000012' },
|
|
511
525
|
thick: { dark: vars.color.neutral.tint['064'], light: vars.color.neutral.shade['060'] },
|
|
512
526
|
thin: { dark: vars.color.neutral.tint['024'], light: vars.color.neutral.shade['020'] },
|
|
513
527
|
ultrathick: {
|
|
@@ -523,13 +537,19 @@ export const variables = Vars.define(
|
|
|
523
537
|
tertiary: { fill: { hover: vars.color.neutral.tint['012'] } },
|
|
524
538
|
},
|
|
525
539
|
container: { regular: '#70707052' },
|
|
526
|
-
content: {
|
|
540
|
+
content: {
|
|
541
|
+
primary: vars.color.neutral['000'],
|
|
542
|
+
secondary: vars.color.neutral.tint['064'],
|
|
543
|
+
tertiary: vars.color.neutral.tint['052'],
|
|
544
|
+
},
|
|
527
545
|
},
|
|
528
546
|
scrim: {
|
|
529
547
|
regular: vars.color.neutral.shade['016'],
|
|
530
548
|
strong: vars.color.neutral.shade['032'],
|
|
531
549
|
},
|
|
532
550
|
shadow: {
|
|
551
|
+
// The shadow under elevated fills, such as menus and modals.
|
|
552
|
+
elevated: { dark: '#0000003d', light: vars.color.neutral.shade['012'] },
|
|
533
553
|
primary: { dark: vars.color.neutral.shade['032'], light: vars.color.neutral.shade['008'] },
|
|
534
554
|
secondary: {
|
|
535
555
|
dark: vars.color.neutral.shade['016'],
|