@tempoxyz/ds 0.2.0 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -0
- package/dist/mobile/components/Avatar.d.ts +1 -1
- package/dist/mobile/components/Avatar.d.ts.map +1 -1
- package/dist/mobile/components/Avatar.js.map +1 -1
- package/dist/mobile/components/Button.d.ts +2 -2
- package/dist/mobile/components/Button.d.ts.map +1 -1
- package/dist/mobile/components/Button.js +6 -2
- package/dist/mobile/components/Button.js.map +1 -1
- package/dist/mobile/components/CodeInput.d.ts +1 -1
- package/dist/mobile/components/CodeInput.d.ts.map +1 -1
- package/dist/mobile/components/CodeInput.js.map +1 -1
- package/dist/mobile/components/IconButton.d.ts +2 -2
- package/dist/mobile/components/IconButton.d.ts.map +1 -1
- package/dist/mobile/components/IconButton.js +6 -2
- package/dist/mobile/components/IconButton.js.map +1 -1
- package/dist/mobile/components/Skeleton.d.ts.map +1 -1
- package/dist/mobile/components/Skeleton.js.map +1 -1
- package/dist/mobile/components/Spinner.d.ts +4 -4
- package/dist/mobile/components/Spinner.d.ts.map +1 -1
- package/dist/mobile/components/Spinner.js +3 -3
- 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 +7 -2
- package/dist/mobile/components/TextButton.js.map +1 -1
- package/dist/mobile/components/TextInput.d.ts.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.d.ts +1 -1
- package/dist/mobile/components/Toast.d.ts.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 +2 -2
- package/dist/mobile/components/Toggle.js +2 -2
- package/dist/mobile/components/Toggle.js.map +1 -1
- package/dist/mobile/vars.d.ts +24 -0
- package/dist/mobile/vars.d.ts.map +1 -1
- package/dist/mobile/vars.js +12 -0
- package/dist/mobile/vars.js.map +1 -1
- package/dist/mobile/zyzz.config.d.ts +96 -0
- package/dist/mobile/zyzz.config.d.ts.map +1 -1
- package/dist/oxlint/index.d.ts +43 -0
- package/dist/oxlint/index.d.ts.map +1 -0
- package/dist/oxlint/index.js +68 -0
- package/dist/oxlint/index.js.map +1 -0
- package/dist/oxlint/internal/Imports.d.ts +22 -0
- package/dist/oxlint/internal/Imports.d.ts.map +1 -0
- package/dist/oxlint/internal/Imports.js +52 -0
- package/dist/oxlint/internal/Imports.js.map +1 -0
- package/dist/oxlint/rules/NoCrossSurface.d.ts +16 -0
- package/dist/oxlint/rules/NoCrossSurface.d.ts.map +1 -0
- package/dist/oxlint/rules/NoCrossSurface.js +55 -0
- package/dist/oxlint/rules/NoCrossSurface.js.map +1 -0
- package/dist/oxlint/rules/NoInternalImports.d.ts +8 -0
- package/dist/oxlint/rules/NoInternalImports.d.ts.map +1 -0
- package/dist/oxlint/rules/NoInternalImports.js +22 -0
- package/dist/oxlint/rules/NoInternalImports.js.map +1 -0
- package/dist/oxlint/rules/NoRawValues.d.ts +9 -0
- package/dist/oxlint/rules/NoRawValues.d.ts.map +1 -0
- package/dist/oxlint/rules/NoRawValues.js +73 -0
- package/dist/oxlint/rules/NoRawValues.js.map +1 -0
- package/dist/oxlint/rules/PreferComponent.d.ts +16 -0
- package/dist/oxlint/rules/PreferComponent.d.ts.map +1 -0
- package/dist/oxlint/rules/PreferComponent.js +92 -0
- package/dist/oxlint/rules/PreferComponent.js.map +1 -0
- package/dist/oxlint/rules/RequireAccessibleName.d.ts +9 -0
- package/dist/oxlint/rules/RequireAccessibleName.d.ts.map +1 -0
- package/dist/oxlint/rules/RequireAccessibleName.js +104 -0
- package/dist/oxlint/rules/RequireAccessibleName.js.map +1 -0
- package/dist/web/components/Accordion.css +1 -1
- package/dist/web/components/Accordion.d.ts +7 -7
- package/dist/web/components/Accordion.js.map +1 -1
- package/dist/web/components/Accordion.js.zyzz.json +1 -1
- package/dist/web/components/AlertDialog.css +1 -1
- package/dist/web/components/AlertDialog.d.ts.map +1 -1
- package/dist/web/components/AlertDialog.js +1 -1
- package/dist/web/components/AlertDialog.js.map +1 -1
- package/dist/web/components/AlertDialog.js.zyzz.json +1 -1
- package/dist/web/components/Amount.d.ts +10 -3
- package/dist/web/components/Amount.d.ts.map +1 -1
- package/dist/web/components/Amount.js +19 -9
- package/dist/web/components/Amount.js.map +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.d.ts +15 -2
- package/dist/web/components/AmountInput.d.ts.map +1 -1
- package/dist/web/components/AmountInput.js +43 -12
- 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 +10 -10
- package/dist/web/components/AppShell.js.map +1 -1
- 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.d.ts +3 -3
- package/dist/web/components/Avatar.js.map +1 -1
- package/dist/web/components/Avatar.js.zyzz.json +1 -1
- package/dist/web/components/Banner.css +1 -1
- package/dist/web/components/Banner.js +3 -3
- package/dist/web/components/Banner.js.map +1 -1
- package/dist/web/components/Banner.js.zyzz.json +1 -1
- package/dist/web/components/Breadcrumbs.css +1 -1
- package/dist/web/components/Breadcrumbs.d.ts +4 -4
- package/dist/web/components/Breadcrumbs.js.map +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 +12 -11
- package/dist/web/components/Button.d.ts.map +1 -1
- package/dist/web/components/Button.js +2 -2
- package/dist/web/components/Button.js.map +1 -1
- package/dist/web/components/Button.js.zyzz.json +1 -1
- package/dist/web/components/Calendar.css +1 -1
- package/dist/web/components/Calendar.d.ts.map +1 -1
- package/dist/web/components/Calendar.js +7 -5
- package/dist/web/components/Calendar.js.map +1 -1
- package/dist/web/components/Calendar.js.zyzz.json +1 -1
- package/dist/web/components/Callout.css +1 -1
- package/dist/web/components/Callout.d.ts +6 -6
- package/dist/web/components/Callout.d.ts.map +1 -1
- package/dist/web/components/Callout.js +5 -2
- package/dist/web/components/Callout.js.map +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.d.ts +8 -8
- package/dist/web/components/Checkbox.js.map +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.d.ts +2 -2
- package/dist/web/components/ChoiceGroup.d.ts.map +1 -1
- package/dist/web/components/ChoiceGroup.js +2 -2
- package/dist/web/components/ChoiceGroup.js.map +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.d.ts +4 -4
- package/dist/web/components/Choicebox.js +1 -1
- package/dist/web/components/Choicebox.js.map +1 -1
- package/dist/web/components/Choicebox.js.zyzz.json +1 -1
- package/dist/web/components/Combobox.css +1 -1
- package/dist/web/components/Combobox.js.map +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.d.ts +20 -20
- package/dist/web/components/DatePicker.d.ts.map +1 -1
- package/dist/web/components/DatePicker.js +2 -2
- package/dist/web/components/DatePicker.js.map +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.map +1 -1
- package/dist/web/components/Dialog.js +3 -3
- 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 +2 -2
- package/dist/web/components/Drawer.js.map +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.css +1 -1
- package/dist/web/components/Field.d.ts +7 -0
- package/dist/web/components/Field.d.ts.map +1 -1
- package/dist/web/components/Field.js +25 -3
- package/dist/web/components/Field.js.map +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.css +1 -1
- package/dist/web/components/Frame.d.ts +27 -10
- package/dist/web/components/Frame.d.ts.map +1 -1
- package/dist/web/components/Frame.js +12 -5
- package/dist/web/components/Frame.js.map +1 -1
- package/dist/web/components/Frame.js.zyzz.json +1 -1
- package/dist/web/components/Gauge.css +1 -1
- package/dist/web/components/Gauge.js.map +1 -1
- package/dist/web/components/Gauge.js.zyzz.json +1 -1
- 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 +5 -5
- package/dist/web/components/Hex.js +1 -1
- 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 +1 -1
- package/dist/web/components/IconChip.js.map +1 -1
- package/dist/web/components/IconChip.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/Input.css +1 -1
- package/dist/web/components/Input.js.map +1 -1
- package/dist/web/components/Input.js.zyzz.json +1 -1
- package/dist/web/components/Inset.js.zyzz.json +1 -1
- package/dist/web/components/Kbd.css +1 -1
- package/dist/web/components/Kbd.d.ts +32 -10
- package/dist/web/components/Kbd.d.ts.map +1 -1
- package/dist/web/components/Kbd.js +55 -13
- package/dist/web/components/Kbd.js.map +1 -1
- package/dist/web/components/Kbd.js.zyzz.json +1 -1
- package/dist/web/components/LoadingDots.css +1 -1
- package/dist/web/components/LoadingDots.d.ts +2 -2
- package/dist/web/components/LoadingDots.js.map +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.d.ts +11 -11
- package/dist/web/components/Menu.d.ts.map +1 -1
- package/dist/web/components/Menu.js +2 -2
- package/dist/web/components/Menu.js.map +1 -1
- package/dist/web/components/Menu.js.zyzz.json +1 -1
- package/dist/web/components/NumberField.css +1 -1
- package/dist/web/components/NumberField.js +1 -1
- package/dist/web/components/NumberField.js.map +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.d.ts.map +1 -1
- package/dist/web/components/OtpField.js +1 -1
- package/dist/web/components/OtpField.js.map +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.d.ts +13 -13
- package/dist/web/components/Pagination.js +1 -1
- package/dist/web/components/Pagination.js.map +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.d.ts.map +1 -1
- package/dist/web/components/Popover.js +1 -1
- package/dist/web/components/Popover.js.map +1 -1
- package/dist/web/components/Popover.js.zyzz.json +1 -1
- package/dist/web/components/Progress.css +1 -1
- package/dist/web/components/Progress.js.map +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.d.ts +4 -4
- package/dist/web/components/RadioGroup.js.map +1 -1
- 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 +7 -7
- package/dist/web/components/Rows.d.ts.map +1 -1
- package/dist/web/components/Rows.js +3 -3
- 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.d.ts +4 -4
- package/dist/web/components/SecretValue.js +1 -1
- package/dist/web/components/SecretValue.js.map +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.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 +11 -11
- package/dist/web/components/SidebarMenu.d.ts.map +1 -1
- package/dist/web/components/SidebarMenu.js +1 -1
- 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.css +1 -1
- package/dist/web/components/Slider.d.ts.map +1 -1
- package/dist/web/components/Slider.js.map +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.d.ts +4 -4
- package/dist/web/components/Snippet.js +2 -2
- package/dist/web/components/Snippet.js.map +1 -1
- package/dist/web/components/Snippet.js.zyzz.json +1 -1
- package/dist/web/components/Spinner.js.zyzz.json +1 -1
- package/dist/web/components/SplitButton.css +1 -1
- package/dist/web/components/SplitButton.d.ts.map +1 -1
- package/dist/web/components/SplitButton.js +1 -1
- package/dist/web/components/SplitButton.js.map +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/Stepper.css +1 -1
- package/dist/web/components/Stepper.d.ts +1 -1
- package/dist/web/components/Stepper.js.map +1 -1
- 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 +46 -46
- package/dist/web/components/Surface.js +2 -2
- 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 +14 -14
- package/dist/web/components/Switch.d.ts.map +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.d.ts +10 -7
- package/dist/web/components/Table.d.ts.map +1 -1
- package/dist/web/components/Table.js +5 -2
- package/dist/web/components/Table.js.map +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.d.ts +14 -14
- package/dist/web/components/Tabs.js +1 -1
- package/dist/web/components/Tabs.js.map +1 -1
- package/dist/web/components/Tabs.js.zyzz.json +1 -1
- package/dist/web/components/Tag.css +1 -1
- package/dist/web/components/Tag.d.ts +10 -10
- package/dist/web/components/Tag.js +1 -1
- package/dist/web/components/Tag.js.map +1 -1
- package/dist/web/components/Tag.js.zyzz.json +1 -1
- package/dist/web/components/Textarea.css +1 -1
- package/dist/web/components/Textarea.d.ts +15 -15
- package/dist/web/components/Textarea.js.map +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 +7 -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.js.zyzz.json +1 -1
- package/dist/web/components/Tooltip.css +1 -1
- package/dist/web/components/Tooltip.d.ts.map +1 -1
- package/dist/web/components/Tooltip.js +1 -1
- package/dist/web/components/Tooltip.js.map +1 -1
- 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.d.ts +7 -7
- package/dist/web/components/internal/Field.js.map +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.d.ts +12 -12
- package/dist/web/components/internal/InputGroup.d.ts.map +1 -1
- package/dist/web/components/internal/InputGroup.js +1 -1
- 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.d.ts +9 -9
- package/dist/web/components/internal/Listbox.d.ts.map +1 -1
- package/dist/web/components/internal/Listbox.js +1 -1
- package/dist/web/components/internal/Listbox.js.map +1 -1
- package/dist/web/components/internal/Listbox.js.zyzz.json +1 -1
- package/dist/web/icons/BadgeX.d.ts.map +1 -1
- package/dist/web/icons/BadgeX.js.map +1 -1
- package/dist/web/icons/InfinityIcon.d.ts.map +1 -1
- package/dist/web/icons/InfinityIcon.js.map +1 -1
- package/dist/web/icons/LightMode.d.ts.map +1 -1
- package/dist/web/icons/LightMode.js.map +1 -1
- package/dist/web/icons/OctagonAlert.d.ts.map +1 -1
- package/dist/web/icons/OctagonAlert.js.map +1 -1
- package/dist/web/icons/Unlink.d.ts.map +1 -1
- package/dist/web/icons/Unlink.js.map +1 -1
- package/dist/web/index.js.zyzz.json +1 -1
- package/dist/web/vars.d.ts +91 -0
- 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 +455 -0
- package/dist/web/zyzz.config.d.ts.map +1 -1
- package/dist/web/zyzz.config.js.zyzz.json +1 -1
- package/package.json +7 -1
- package/src/mobile/components/Avatar.tsx +2 -2
- package/src/mobile/components/Button.tsx +6 -3
- package/src/mobile/components/CodeInput.tsx +2 -2
- package/src/mobile/components/IconButton.tsx +6 -3
- package/src/mobile/components/Skeleton.tsx +1 -1
- package/src/mobile/components/Spinner.tsx +4 -5
- package/src/mobile/components/TextButton.tsx +6 -2
- package/src/mobile/components/TextInput.tsx +1 -1
- package/src/mobile/components/Toast.tsx +1 -2
- package/src/mobile/components/Toggle.tsx +2 -2
- package/src/mobile/vars.ts +14 -0
- package/src/oxlint/index.ts +89 -0
- package/src/oxlint/internal/Imports.ts +68 -0
- package/src/oxlint/rules/NoCrossSurface.ts +71 -0
- package/src/oxlint/rules/NoInternalImports.ts +25 -0
- package/src/oxlint/rules/NoRawValues.ts +76 -0
- package/src/oxlint/rules/PreferComponent.ts +113 -0
- package/src/oxlint/rules/RequireAccessibleName.ts +132 -0
- package/src/web/components/Accordion.tsx +8 -8
- package/src/web/components/AlertDialog.tsx +11 -8
- package/src/web/components/Amount.tsx +29 -9
- package/src/web/components/AmountInput.tsx +60 -24
- package/src/web/components/AppShell.tsx +23 -23
- package/src/web/components/Avatar.tsx +3 -3
- package/src/web/components/Banner.tsx +16 -16
- package/src/web/components/Breadcrumbs.tsx +4 -4
- package/src/web/components/Button.tsx +15 -12
- package/src/web/components/Calendar.tsx +10 -11
- package/src/web/components/Callout.tsx +19 -16
- package/src/web/components/Checkbox.tsx +9 -9
- package/src/web/components/ChoiceGroup.tsx +13 -14
- package/src/web/components/Choicebox.tsx +21 -21
- package/src/web/components/Combobox.tsx +3 -3
- package/src/web/components/DatePicker.tsx +25 -25
- package/src/web/components/Dialog.tsx +28 -19
- package/src/web/components/Drawer.tsx +8 -8
- package/src/web/components/Field.tsx +46 -11
- package/src/web/components/Frame.tsx +30 -9
- package/src/web/components/Gauge.tsx +1 -1
- package/src/web/components/Hex.tsx +5 -5
- package/src/web/components/IconChip.tsx +1 -1
- package/src/web/components/Input.tsx +11 -11
- package/src/web/components/Kbd.tsx +77 -21
- package/src/web/components/LoadingDots.tsx +4 -4
- package/src/web/components/Menu.tsx +17 -14
- package/src/web/components/NumberField.tsx +17 -17
- package/src/web/components/OtpField.tsx +14 -6
- package/src/web/components/Pagination.tsx +13 -13
- package/src/web/components/Popover.tsx +14 -11
- package/src/web/components/Progress.tsx +2 -2
- package/src/web/components/RadioGroup.tsx +11 -11
- package/src/web/components/Rows.tsx +8 -9
- package/src/web/components/SecretValue.tsx +4 -4
- package/src/web/components/Select.tsx +2 -2
- package/src/web/components/SidebarMenu.tsx +14 -15
- package/src/web/components/Slider.tsx +6 -7
- package/src/web/components/Snippet.tsx +9 -9
- package/src/web/components/SplitButton.tsx +17 -5
- package/src/web/components/Stepper.tsx +1 -1
- package/src/web/components/Surface.tsx +47 -47
- package/src/web/components/Switch.tsx +21 -23
- package/src/web/components/Table.tsx +11 -7
- package/src/web/components/Tabs.tsx +14 -14
- package/src/web/components/Tag.tsx +12 -12
- package/src/web/components/Textarea.tsx +15 -15
- package/src/web/components/Toast.tsx +28 -21
- package/src/web/components/Tooltip.tsx +12 -9
- package/src/web/components/internal/Field.ts +20 -20
- package/src/web/components/internal/InputGroup.ts +13 -14
- package/src/web/components/internal/Listbox.ts +19 -16
- package/src/web/icons/BadgeX.tsx +1 -1
- package/src/web/icons/InfinityIcon.tsx +1 -1
- package/src/web/icons/LightMode.tsx +1 -1
- package/src/web/icons/OctagonAlert.tsx +1 -1
- package/src/web/icons/Unlink.tsx +1 -1
- package/src/web/vars.ts +81 -2
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/** Requires a name on `@tempoxyz/ds` components that render no text of their own. @module */
|
|
2
|
+
import type { ESTree, Rule } from '@oxlint/plugins'
|
|
3
|
+
import * as Imports from '../internal/Imports.ts'
|
|
4
|
+
|
|
5
|
+
type Target = {
|
|
6
|
+
/** Attributes that name the element. */
|
|
7
|
+
readonly names: readonly string[]
|
|
8
|
+
/** An attribute and value that make the component icon-only. When absent, every use needs a name. */
|
|
9
|
+
readonly when?: { readonly attribute: string; readonly value: string } | undefined
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const list = new Intl.ListFormat('en', { type: 'disjunction' })
|
|
13
|
+
const web = ['aria-label', 'aria-labelledby']
|
|
14
|
+
const mobile = ['accessibilityLabel', 'accessibilityLabelledBy', 'aria-label', 'aria-labelledby']
|
|
15
|
+
|
|
16
|
+
// Components from each surface whose rendered output has no text to name it.
|
|
17
|
+
const targets: Record<Imports.Surface, Record<string, Target>> = {
|
|
18
|
+
mobile: { IconButton: { names: mobile } },
|
|
19
|
+
web: {
|
|
20
|
+
Button: { names: web, when: { attribute: 'shape', value: 'icon' } },
|
|
21
|
+
'Button.Link': { names: web, when: { attribute: 'shape', value: 'icon' } },
|
|
22
|
+
Gauge: { names: web },
|
|
23
|
+
},
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Reports an icon-only `Button` or `Button.Link`, a `Gauge`, or a Mobile `IconButton` without an
|
|
28
|
+
* accessible name. An element passed to a `render` prop can take its name from the element that
|
|
29
|
+
* owns the prop. Elements with a spread attribute are skipped, since the spread can supply the name.
|
|
30
|
+
*/
|
|
31
|
+
export const rule: Rule = {
|
|
32
|
+
meta: {
|
|
33
|
+
docs: { description: 'Name `@tempoxyz/ds` components that render no text.' },
|
|
34
|
+
messages: {
|
|
35
|
+
missing: "'{{component}}' renders no text. Name it with {{names}}.",
|
|
36
|
+
},
|
|
37
|
+
schema: [],
|
|
38
|
+
type: 'problem',
|
|
39
|
+
},
|
|
40
|
+
create(context) {
|
|
41
|
+
type Binding = { imported: string | undefined; surface: Imports.Surface }
|
|
42
|
+
|
|
43
|
+
const bindings = new Map<string, Binding>()
|
|
44
|
+
|
|
45
|
+
function attribute(node: ESTree.JSXOpeningElement, name: string) {
|
|
46
|
+
return node.attributes.find(
|
|
47
|
+
(attribute): attribute is ESTree.JSXAttribute =>
|
|
48
|
+
attribute.type === 'JSXAttribute' &&
|
|
49
|
+
attribute.name.type === 'JSXIdentifier' &&
|
|
50
|
+
attribute.name.name === name,
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function literal(node: ESTree.JSXAttribute) {
|
|
55
|
+
const value =
|
|
56
|
+
node.value?.type === 'JSXExpressionContainer' ? node.value.expression : node.value
|
|
57
|
+
|
|
58
|
+
return value?.type === 'Literal' ? value.value : undefined
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function named(target: Target, node: ESTree.JSXOpeningElement) {
|
|
62
|
+
if (node.attributes.some((attribute) => attribute.type === 'JSXSpreadAttribute')) return true
|
|
63
|
+
|
|
64
|
+
return target.names.some((name) => {
|
|
65
|
+
const found = attribute(node, name)
|
|
66
|
+
|
|
67
|
+
return found !== undefined && literal(found) !== ''
|
|
68
|
+
})
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function path(node: ESTree.JSXElementName | ESTree.JSXMemberExpressionObject): string[] {
|
|
72
|
+
if (node.type === 'JSXIdentifier') return [node.name]
|
|
73
|
+
if (node.type === 'JSXMemberExpression') return [...path(node.object), node.property.name]
|
|
74
|
+
return []
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return {
|
|
78
|
+
ImportDeclaration(node) {
|
|
79
|
+
const surface = Imports.surface(node.source.value)
|
|
80
|
+
|
|
81
|
+
if (!surface || node.importKind === 'type') return
|
|
82
|
+
for (const specifier of node.specifiers) {
|
|
83
|
+
if (specifier.type === 'ImportNamespaceSpecifier')
|
|
84
|
+
bindings.set(specifier.local.name, { imported: undefined, surface })
|
|
85
|
+
if (specifier.type === 'ImportSpecifier' && specifier.importKind !== 'type')
|
|
86
|
+
bindings.set(specifier.local.name, {
|
|
87
|
+
imported:
|
|
88
|
+
specifier.imported.type === 'Identifier'
|
|
89
|
+
? specifier.imported.name
|
|
90
|
+
: String(specifier.imported.value),
|
|
91
|
+
surface,
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
JSXOpeningElement(node) {
|
|
96
|
+
const [head, ...rest] = path(node.name)
|
|
97
|
+
const binding = head === undefined ? undefined : bindings.get(head)
|
|
98
|
+
|
|
99
|
+
if (!binding) return
|
|
100
|
+
|
|
101
|
+
const component = (binding.imported ? [binding.imported, ...rest] : rest).join('.')
|
|
102
|
+
const target = targets[binding.surface][component]
|
|
103
|
+
|
|
104
|
+
if (!target) return
|
|
105
|
+
if (target.when) {
|
|
106
|
+
const condition = attribute(node, target.when.attribute)
|
|
107
|
+
|
|
108
|
+
if (!condition || literal(condition) !== target.when.value) return
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// An element passed to `render` takes its attributes from the element that owns the prop.
|
|
112
|
+
const owner = (() => {
|
|
113
|
+
for (let parent: ESTree.Node | null = node.parent; parent; parent = parent.parent)
|
|
114
|
+
if (
|
|
115
|
+
parent.type === 'JSXAttribute' &&
|
|
116
|
+
parent.name.type === 'JSXIdentifier' &&
|
|
117
|
+
parent.name.name === 'render'
|
|
118
|
+
)
|
|
119
|
+
return parent.parent.type === 'JSXOpeningElement' ? parent.parent : undefined
|
|
120
|
+
return undefined
|
|
121
|
+
})()
|
|
122
|
+
|
|
123
|
+
if (!named(target, node) && (!owner || !named(target, owner)))
|
|
124
|
+
context.report({
|
|
125
|
+
data: { component, names: list.format(target.names.map((name) => `\`${name}\``)) },
|
|
126
|
+
messageId: 'missing',
|
|
127
|
+
node,
|
|
128
|
+
})
|
|
129
|
+
},
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
}
|
|
@@ -143,7 +143,7 @@ namespace styles {
|
|
|
143
143
|
{
|
|
144
144
|
flexShrink: '0 !custom',
|
|
145
145
|
height: '16',
|
|
146
|
-
transitionDuration: '
|
|
146
|
+
transitionDuration: '240',
|
|
147
147
|
transitionProperty: 'transform',
|
|
148
148
|
transitionTimingFunction: 'spring',
|
|
149
149
|
width: '16',
|
|
@@ -169,11 +169,11 @@ namespace styles {
|
|
|
169
169
|
height: 'var(--accordion-panel-height) !custom',
|
|
170
170
|
overflow: 'hidden',
|
|
171
171
|
// Revealing content needs its measured height, which a transform cannot provide.
|
|
172
|
-
transitionDuration: '
|
|
172
|
+
transitionDuration: '240',
|
|
173
173
|
transitionProperty: 'height, opacity',
|
|
174
174
|
transitionTimingFunction: 'spring',
|
|
175
175
|
selectors: {
|
|
176
|
-
'&[data-ending-style]': { transitionDuration: '
|
|
176
|
+
'&[data-ending-style]': { transitionDuration: '180' },
|
|
177
177
|
'&[data-ending-style], &[data-starting-style]': {
|
|
178
178
|
height: '0',
|
|
179
179
|
opacity: '0 !custom',
|
|
@@ -232,21 +232,21 @@ namespace styles {
|
|
|
232
232
|
justifyContent: 'space-between',
|
|
233
233
|
minHeight: '40',
|
|
234
234
|
outlineColor: 'transparent !custom',
|
|
235
|
-
outlineOffset: '
|
|
235
|
+
outlineOffset: '0',
|
|
236
236
|
outlineStyle: 'solid !custom',
|
|
237
|
-
outlineWidth: '
|
|
237
|
+
outlineWidth: '2',
|
|
238
238
|
paddingBlock: '8',
|
|
239
239
|
paddingInline: '0',
|
|
240
240
|
textAlign: 'start',
|
|
241
|
-
transitionDuration: '
|
|
241
|
+
transitionDuration: '160',
|
|
242
242
|
transitionProperty: 'opacity, outline-color, outline-offset',
|
|
243
243
|
transitionTimingFunction: 'snappy',
|
|
244
244
|
// Weight overrides the typography token, so it stays after it.
|
|
245
245
|
typography: 'button.14',
|
|
246
246
|
width: '100% !custom',
|
|
247
247
|
selectors: {
|
|
248
|
-
'&:focus-visible': { outlineColor: 'blue.700', outlineOffset: '
|
|
249
|
-
'&[data-disabled]': { cursor: 'default', opacity: '
|
|
248
|
+
'&:focus-visible': { outlineColor: 'blue.700', outlineOffset: '2' },
|
|
249
|
+
'&[data-disabled]': { cursor: 'default', opacity: 'disabled' },
|
|
250
250
|
},
|
|
251
251
|
'@media (prefers-reduced-motion: reduce)': { transitionProperty: 'opacity, outline-color' },
|
|
252
252
|
},
|
|
@@ -107,31 +107,34 @@ export namespace AlertDialog {
|
|
|
107
107
|
namespace styles {
|
|
108
108
|
export const popup = style(
|
|
109
109
|
{
|
|
110
|
-
backgroundColor: '
|
|
110
|
+
backgroundColor: 'background.raised',
|
|
111
111
|
borderRadius: '16',
|
|
112
|
-
boxShadow: '
|
|
112
|
+
boxShadow: 'modal',
|
|
113
113
|
boxSizing: 'border-box',
|
|
114
114
|
color: 'foreground',
|
|
115
115
|
maxWidth: '384',
|
|
116
116
|
outline: 'none !custom',
|
|
117
117
|
padding: '24',
|
|
118
|
-
transitionDuration: '
|
|
119
|
-
transitionProperty: 'opacity,
|
|
118
|
+
transitionDuration: '280',
|
|
119
|
+
transitionProperty: 'opacity, scale',
|
|
120
120
|
transitionTimingFunction: 'spring',
|
|
121
121
|
typography: 'copy.14',
|
|
122
122
|
width: '100% !custom',
|
|
123
123
|
selectors: {
|
|
124
124
|
'&[data-ending-style]': {
|
|
125
125
|
opacity: '0 !custom',
|
|
126
|
-
|
|
127
|
-
transitionDuration: '
|
|
126
|
+
scale: 'enter',
|
|
127
|
+
transitionDuration: '180',
|
|
128
|
+
},
|
|
129
|
+
'&[data-starting-style]': {
|
|
130
|
+
opacity: '0 !custom',
|
|
131
|
+
scale: 'enter',
|
|
128
132
|
},
|
|
129
|
-
'&[data-starting-style]': { opacity: '0 !custom', transform: 'scale(0.96) !custom' },
|
|
130
133
|
},
|
|
131
134
|
'@media (prefers-reduced-motion: reduce)': {
|
|
132
135
|
transitionProperty: 'opacity',
|
|
133
136
|
selectors: {
|
|
134
|
-
'&[data-ending-style], &[data-starting-style]': {
|
|
137
|
+
'&[data-ending-style], &[data-starting-style]': { scale: 'none !custom' },
|
|
135
138
|
},
|
|
136
139
|
},
|
|
137
140
|
},
|
|
@@ -3,9 +3,9 @@ import type * as zyzz from 'zyzz'
|
|
|
3
3
|
import { style, variants } from '../zyzz.config.js'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Formats a number in
|
|
7
|
-
* an ISO 4217 code as money, and `symbol` follows the number with a token
|
|
8
|
-
* mutually exclusive.
|
|
6
|
+
* Formats a number in `en-US`, or in `locale` when set, inside a `span` with tabular figures.
|
|
7
|
+
* `currency` formats an ISO 4217 code as money, and `symbol` follows the number with a token
|
|
8
|
+
* symbol. The two are mutually exclusive.
|
|
9
9
|
*
|
|
10
10
|
* - Pass amounts as decimal strings to avoid floating-point rounding.
|
|
11
11
|
* - Always pass `currency` or `symbol` so the unit does not depend on surrounding context.
|
|
@@ -24,6 +24,7 @@ export function Amount(props: Amount.Props) {
|
|
|
24
24
|
const {
|
|
25
25
|
className,
|
|
26
26
|
currency,
|
|
27
|
+
locale,
|
|
27
28
|
maxDecimals,
|
|
28
29
|
precise,
|
|
29
30
|
sign,
|
|
@@ -48,7 +49,7 @@ export function Amount(props: Amount.Props) {
|
|
|
48
49
|
})}
|
|
49
50
|
>
|
|
50
51
|
{sign}
|
|
51
|
-
{format({ currency, maxDecimals, precise, value })}
|
|
52
|
+
{format({ currency, locale, maxDecimals, precise, value })}
|
|
52
53
|
{symbol && <span {...styles.symbol()}> {symbol}</span>}
|
|
53
54
|
</span>
|
|
54
55
|
)
|
|
@@ -57,6 +58,13 @@ export function Amount(props: Amount.Props) {
|
|
|
57
58
|
export namespace Amount {
|
|
58
59
|
export type Props = Omit<ComponentPropsWithRef<'span'>, 'children'> &
|
|
59
60
|
zyzz.Props.Variants<typeof styles.amount> & {
|
|
61
|
+
/**
|
|
62
|
+
* BCP 47 tag, such as `de-DE`, for grouping, decimal marks, and currency symbols. The default
|
|
63
|
+
* does not depend on the runtime locale, so server and browser render the same text. A tag
|
|
64
|
+
* that `Intl` rejects, such as `""` or `"en_US"`, falls back to `en-US` instead of throwing.
|
|
65
|
+
* @default 'en-US'
|
|
66
|
+
*/
|
|
67
|
+
locale?: string | undefined
|
|
60
68
|
/**
|
|
61
69
|
* Caps the fraction digits shown. With `currency`, it never exceeds the currency's own digits
|
|
62
70
|
* and sets the exact count, so `0` renders `$5`.
|
|
@@ -88,29 +96,41 @@ export namespace Amount {
|
|
|
88
96
|
)
|
|
89
97
|
}
|
|
90
98
|
|
|
91
|
-
function format(
|
|
99
|
+
function format(
|
|
100
|
+
options: Pick<Amount.Props, 'currency' | 'locale' | 'maxDecimals' | 'precise' | 'value'>,
|
|
101
|
+
) {
|
|
92
102
|
const { currency, maxDecimals, precise, value } = options
|
|
93
103
|
// ES2023 formats decimal strings exactly. The signature keeps ES2022 libs compiling.
|
|
94
104
|
const exact = (formatter: Intl.NumberFormat) =>
|
|
95
105
|
(formatter.format as (value: number | string) => string)(value)
|
|
96
106
|
|
|
107
|
+
// `Intl.NumberFormat` throws for a malformed tag and replaces an unsupported one with the
|
|
108
|
+
// runtime locale, so both resolve to `en-US` here.
|
|
109
|
+
const locale = (() => {
|
|
110
|
+
try {
|
|
111
|
+
return Intl.NumberFormat.supportedLocalesOf(options.locale)[0] ?? 'en-US'
|
|
112
|
+
} catch {
|
|
113
|
+
return 'en-US'
|
|
114
|
+
}
|
|
115
|
+
})()
|
|
116
|
+
|
|
97
117
|
if (currency) {
|
|
98
118
|
const money = { currency, style: 'currency' } as const
|
|
99
|
-
const max = new Intl.NumberFormat(
|
|
119
|
+
const max = new Intl.NumberFormat(locale, money).resolvedOptions().maximumFractionDigits!
|
|
100
120
|
const digits = Math.min(maxDecimals ?? max, max)
|
|
101
121
|
const number = Number(value)
|
|
102
122
|
const sub = number !== 0 && Math.abs(number) < 10 ** -digits
|
|
103
123
|
|
|
104
124
|
if (sub && precise)
|
|
105
125
|
return exact(
|
|
106
|
-
new Intl.NumberFormat(
|
|
126
|
+
new Intl.NumberFormat(locale, {
|
|
107
127
|
...money,
|
|
108
128
|
maximumFractionDigits: 20,
|
|
109
129
|
maximumSignificantDigits: 2,
|
|
110
130
|
}),
|
|
111
131
|
)
|
|
112
132
|
|
|
113
|
-
const formatter = new Intl.NumberFormat(
|
|
133
|
+
const formatter = new Intl.NumberFormat(locale, {
|
|
114
134
|
...money,
|
|
115
135
|
maximumFractionDigits: digits,
|
|
116
136
|
minimumFractionDigits: digits,
|
|
@@ -124,7 +144,7 @@ function format(options: Pick<Amount.Props, 'currency' | 'maxDecimals' | 'precis
|
|
|
124
144
|
const digits = Math.min(maxDecimals ?? fraction, fraction)
|
|
125
145
|
|
|
126
146
|
return exact(
|
|
127
|
-
new Intl.NumberFormat(
|
|
147
|
+
new Intl.NumberFormat(locale, {
|
|
128
148
|
maximumFractionDigits: digits,
|
|
129
149
|
minimumFractionDigits: typeof value === 'string' ? digits : 0,
|
|
130
150
|
}),
|
|
@@ -6,8 +6,21 @@ import { Input } from './Input.js'
|
|
|
6
6
|
import * as AmountContext from './internal/AmountContext.js'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Decimal amount entry. The value is a raw string
|
|
10
|
-
* not a non-negative decimal is rejected.
|
|
9
|
+
* Decimal amount entry. The value is a raw string with a dot separator and no grouping
|
|
10
|
+
* separators, and input that is not a non-negative decimal is rejected.
|
|
11
|
+
*
|
|
12
|
+
* The text around a comma decides whether it groups thousands or separates decimals:
|
|
13
|
+
*
|
|
14
|
+
* - With both a dot and a comma, the last one separates decimals and the other groups thousands:
|
|
15
|
+
* `1,250.50` and `1.250,50` are both `1250.50`.
|
|
16
|
+
* - Several commas group thousands: `1,250,000` is `1250000`.
|
|
17
|
+
* - A lone comma groups thousands after one to three digits that do not start with `0`, when
|
|
18
|
+
* exactly three digits follow it: `1,250` is `1250`.
|
|
19
|
+
* - Any other lone comma separates decimals: `1,5` is `1.5`, `0,250` is `0.250`, `1234,567` is
|
|
20
|
+
* `1234.567`, and `12,` is `12.`.
|
|
21
|
+
*
|
|
22
|
+
* The field shows a lone comma as typed until a dot or a second comma settles it, then shows the
|
|
23
|
+
* value.
|
|
11
24
|
*
|
|
12
25
|
* `Control` is a text input with `inputMode="decimal"`, so mobile keyboards show digits without
|
|
13
26
|
* the scroll and spinner behavior of `type="number"`.
|
|
@@ -46,10 +59,8 @@ export namespace AmountInput {
|
|
|
46
59
|
value={{
|
|
47
60
|
value,
|
|
48
61
|
setValue(next) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
setUncontrolled(clean)
|
|
52
|
-
onValueChange?.(clean)
|
|
62
|
+
setUncontrolled(next)
|
|
63
|
+
onValueChange?.(next)
|
|
53
64
|
},
|
|
54
65
|
}}
|
|
55
66
|
>
|
|
@@ -70,9 +81,11 @@ export namespace AmountInput {
|
|
|
70
81
|
/** Text field whose digits morph as the value changes. Motion stops under reduced motion. */
|
|
71
82
|
export function Control(props: Control.Props) {
|
|
72
83
|
const amount = AmountContext.use()
|
|
73
|
-
const [typed, setTyped] = useState<{ caret: number | null; value: string }>()
|
|
84
|
+
const [typed, setTyped] = useState<{ caret: number | null; text: string; value: string }>()
|
|
74
85
|
// Typed edits morph at the caret. Other changes, such as Max, roll digits by place value.
|
|
75
|
-
const
|
|
86
|
+
const edit = typed?.value === amount.value ? typed : undefined
|
|
87
|
+
const caret = edit?.caret ?? undefined
|
|
88
|
+
const text = edit?.text ?? amount.value
|
|
76
89
|
|
|
77
90
|
return (
|
|
78
91
|
<span {...styles.control()}>
|
|
@@ -82,15 +95,20 @@ export namespace AmountInput {
|
|
|
82
95
|
{...props}
|
|
83
96
|
{...styles.input({ className: props.className, style: props.style })}
|
|
84
97
|
onValueChange={(next, details) => {
|
|
98
|
+
const value = parse(next)
|
|
99
|
+
if (value === undefined) return
|
|
100
|
+
|
|
85
101
|
const input = details.event.target as HTMLInputElement
|
|
86
|
-
|
|
87
|
-
|
|
102
|
+
// The digits typed after a lone comma can still change its role, so it stays in place.
|
|
103
|
+
const lone = !next.includes('.') && next.split(',').length === 2
|
|
104
|
+
setTyped({ caret: input.selectionStart, text: lone ? next : value, value })
|
|
105
|
+
amount.setValue(value)
|
|
88
106
|
}}
|
|
89
107
|
type="text"
|
|
90
|
-
value={
|
|
108
|
+
value={text}
|
|
91
109
|
/>
|
|
92
110
|
<span aria-hidden="true" {...styles.morph()}>
|
|
93
|
-
<TextMorph {...(caret !== undefined && { cursorIndex: caret })}>{
|
|
111
|
+
<TextMorph {...(caret !== undefined && { cursorIndex: caret })}>{text}</TextMorph>
|
|
94
112
|
</span>
|
|
95
113
|
</span>
|
|
96
114
|
)
|
|
@@ -133,6 +151,24 @@ export namespace AmountInput {
|
|
|
133
151
|
export const Suffix = Input.Suffix
|
|
134
152
|
}
|
|
135
153
|
|
|
154
|
+
/** Returns the raw decimal for typed text, or `undefined` when it is not a non-negative decimal. */
|
|
155
|
+
function parse(text: string) {
|
|
156
|
+
const value = (() => {
|
|
157
|
+
const dot = text.lastIndexOf('.')
|
|
158
|
+
if (dot !== -1 && text.lastIndexOf(',') > dot)
|
|
159
|
+
return text.replaceAll('.', '').replaceAll(',', '.')
|
|
160
|
+
|
|
161
|
+
// Grouping needs a first group of one to three digits without a leading zero, so `0,250` and
|
|
162
|
+
// `1234,567` are decimals.
|
|
163
|
+
if (/^[^,.]*,[^,.]*$/.test(text) && !/^[1-9]\d{0,2},\d{3}$/.test(text))
|
|
164
|
+
return text.replace(',', '.')
|
|
165
|
+
|
|
166
|
+
return text.replaceAll(',', '')
|
|
167
|
+
})()
|
|
168
|
+
|
|
169
|
+
return /^\d*\.?\d*$/.test(value) ? value : undefined
|
|
170
|
+
}
|
|
171
|
+
|
|
136
172
|
namespace styles {
|
|
137
173
|
export const control = style(
|
|
138
174
|
{
|
|
@@ -163,33 +199,33 @@ namespace styles {
|
|
|
163
199
|
cursor: 'pointer',
|
|
164
200
|
flexShrink: '0 !custom',
|
|
165
201
|
outlineColor: 'transparent !custom',
|
|
166
|
-
outlineOffset: '
|
|
202
|
+
outlineOffset: '0',
|
|
167
203
|
outlineStyle: 'solid !custom',
|
|
168
|
-
outlineWidth: '
|
|
204
|
+
outlineWidth: '2',
|
|
169
205
|
position: 'relative',
|
|
170
|
-
transitionDuration: '
|
|
171
|
-
transitionProperty: 'background-color, outline-color, outline-offset,
|
|
206
|
+
transitionDuration: '160',
|
|
207
|
+
transitionProperty: 'background-color, outline-color, outline-offset, scale',
|
|
172
208
|
transitionTimingFunction: 'snappy',
|
|
173
209
|
selectors: {
|
|
174
210
|
// Each field size insets Max equally from the end and the top, with a concentric radius.
|
|
175
211
|
'[data-size="large"] > &': {
|
|
176
212
|
borderRadius: '8',
|
|
177
213
|
height: '40',
|
|
178
|
-
marginInlineEnd: '-
|
|
214
|
+
marginInlineEnd: '-12',
|
|
179
215
|
paddingInline: '16',
|
|
180
216
|
typography: 'button.14',
|
|
181
217
|
},
|
|
182
218
|
'[data-size="medium"] > &': {
|
|
183
219
|
borderRadius: '6',
|
|
184
220
|
height: '28',
|
|
185
|
-
marginInlineEnd: '-
|
|
221
|
+
marginInlineEnd: '-10',
|
|
186
222
|
paddingInline: '12',
|
|
187
223
|
typography: 'button.12',
|
|
188
224
|
},
|
|
189
225
|
'[data-size="small"] > &': {
|
|
190
226
|
borderRadius: '4',
|
|
191
227
|
height: '24',
|
|
192
|
-
marginInlineEnd: '-
|
|
228
|
+
marginInlineEnd: '-8',
|
|
193
229
|
paddingInline: '8',
|
|
194
230
|
typography: 'button.12',
|
|
195
231
|
},
|
|
@@ -197,7 +233,7 @@ namespace styles {
|
|
|
197
233
|
'[data-variant="stacked"] > [data-size="small"] > &': {
|
|
198
234
|
borderRadius: '6',
|
|
199
235
|
height: '28',
|
|
200
|
-
marginInlineEnd: '-
|
|
236
|
+
marginInlineEnd: '-10',
|
|
201
237
|
paddingInline: '12',
|
|
202
238
|
typography: 'button.12',
|
|
203
239
|
},
|
|
@@ -209,15 +245,15 @@ namespace styles {
|
|
|
209
245
|
paddingInline: '12',
|
|
210
246
|
typography: 'button.12',
|
|
211
247
|
},
|
|
212
|
-
'&::after': { content: '"" !custom', inset: '-
|
|
213
|
-
'&:active': {
|
|
214
|
-
'&:focus-visible': { outlineColor: 'blue.700', outlineOffset: '
|
|
248
|
+
'&::after': { content: '"" !custom', inset: '-4', position: 'absolute' },
|
|
249
|
+
'&:active': { scale: 'press' },
|
|
250
|
+
'&:focus-visible': { outlineColor: 'blue.700', outlineOffset: '2' },
|
|
215
251
|
'&:hover': { backgroundColor: 'grayAlpha.300' },
|
|
216
252
|
'[data-invalid] &': { display: 'none' },
|
|
217
253
|
},
|
|
218
254
|
'@media (prefers-reduced-motion: reduce)': {
|
|
219
255
|
transitionProperty: 'background-color, outline-color',
|
|
220
|
-
selectors: { '&:active': {
|
|
256
|
+
selectors: { '&:active': { scale: 'none !custom' } },
|
|
221
257
|
},
|
|
222
258
|
},
|
|
223
259
|
{ id: 'tds/web/amount-input/max' },
|
|
@@ -294,12 +294,12 @@ namespace styles {
|
|
|
294
294
|
inset: '0',
|
|
295
295
|
opacity: '0.6 !custom',
|
|
296
296
|
position: 'fixed',
|
|
297
|
-
transitionDuration: '
|
|
297
|
+
transitionDuration: '280',
|
|
298
298
|
transitionProperty: 'opacity !custom',
|
|
299
299
|
transitionTimingFunction: 'spring',
|
|
300
|
-
zIndex: '
|
|
300
|
+
zIndex: 'overlay',
|
|
301
301
|
selectors: {
|
|
302
|
-
'&[data-ending-style]': { opacity: '0 !custom', transitionDuration: '
|
|
302
|
+
'&[data-ending-style]': { opacity: '0 !custom', transitionDuration: '200' },
|
|
303
303
|
'&[data-starting-style]': { opacity: '0 !custom' },
|
|
304
304
|
},
|
|
305
305
|
},
|
|
@@ -310,23 +310,23 @@ namespace styles {
|
|
|
310
310
|
{
|
|
311
311
|
backgroundColor: 'currentColor !custom',
|
|
312
312
|
borderRadius: 'full',
|
|
313
|
-
height: '
|
|
313
|
+
height: '2',
|
|
314
314
|
insetInlineStart: '0',
|
|
315
315
|
position: 'absolute',
|
|
316
316
|
top: '50% !custom',
|
|
317
|
-
transitionDuration: '
|
|
317
|
+
transitionDuration: '240',
|
|
318
318
|
transitionProperty: 'transform !custom',
|
|
319
319
|
transitionTimingFunction: 'spring',
|
|
320
320
|
width: '100% !custom',
|
|
321
321
|
selectors: {
|
|
322
322
|
// Two bars 6px apart meet at the centre and cross into a close mark while the drawer is open.
|
|
323
|
-
'&:first-child': { transform: 'translateY(-
|
|
324
|
-
'&:last-child': { transform: 'translateY(
|
|
323
|
+
'&:first-child': { transform: 'translateY(-4px) !custom' },
|
|
324
|
+
'&:last-child': { transform: 'translateY(2px) !custom' },
|
|
325
325
|
'[data-popup-open] &:first-child': {
|
|
326
|
-
transform: 'translateY(-
|
|
326
|
+
transform: 'translateY(-1px) rotate(45deg) !custom',
|
|
327
327
|
},
|
|
328
328
|
'[data-popup-open] &:last-child': {
|
|
329
|
-
transform: 'translateY(-
|
|
329
|
+
transform: 'translateY(-1px) rotate(-45deg) !custom',
|
|
330
330
|
},
|
|
331
331
|
},
|
|
332
332
|
'@media (prefers-reduced-motion: reduce)': { transitionProperty: 'none !custom' },
|
|
@@ -348,17 +348,17 @@ namespace styles {
|
|
|
348
348
|
outline: 'none !custom',
|
|
349
349
|
overflowY: 'auto',
|
|
350
350
|
transform: 'translateX(var(--drawer-swipe-movement-x, 0px)) !custom',
|
|
351
|
-
transitionDuration: '
|
|
351
|
+
transitionDuration: '280',
|
|
352
352
|
transitionProperty: 'transform !custom',
|
|
353
353
|
transitionTimingFunction: 'spring',
|
|
354
354
|
width: 'min(18rem, 85vw) !custom',
|
|
355
355
|
selectors: {
|
|
356
356
|
'&[data-ending-style]': {
|
|
357
357
|
transform: 'translateX(100%) !custom',
|
|
358
|
-
transitionDuration: '
|
|
358
|
+
transitionDuration: '200',
|
|
359
359
|
},
|
|
360
360
|
'&[data-starting-style]': { transform: 'translateX(100%) !custom' },
|
|
361
|
-
'&[data-swiping]': { transitionDuration: '
|
|
361
|
+
'&[data-swiping]': { transitionDuration: '0', userSelect: 'none' },
|
|
362
362
|
},
|
|
363
363
|
'@media (prefers-reduced-motion: reduce)': {
|
|
364
364
|
transitionProperty: 'opacity !custom',
|
|
@@ -452,7 +452,7 @@ namespace styles {
|
|
|
452
452
|
flexShrink: '0 !custom',
|
|
453
453
|
minHeight: '0',
|
|
454
454
|
paddingBottom: '20',
|
|
455
|
-
paddingInline: '
|
|
455
|
+
paddingInline: '10',
|
|
456
456
|
rowGap: '24',
|
|
457
457
|
},
|
|
458
458
|
},
|
|
@@ -481,11 +481,11 @@ namespace styles {
|
|
|
481
481
|
base: {
|
|
482
482
|
flex: '1 !custom',
|
|
483
483
|
// Bleeding into the sidebar's inline padding puts the scrollbar at the sidebar edge.
|
|
484
|
-
marginInline: '-
|
|
484
|
+
marginInline: '-10',
|
|
485
485
|
minHeight: '0',
|
|
486
486
|
overflowY: 'auto',
|
|
487
487
|
overscrollBehavior: 'contain',
|
|
488
|
-
paddingInline: '
|
|
488
|
+
paddingInline: '10',
|
|
489
489
|
// Classic scrollbars keep their own lane instead of covering content at the edge.
|
|
490
490
|
scrollbarGutter: 'stable',
|
|
491
491
|
scrollbarWidth: 'thin',
|
|
@@ -560,7 +560,7 @@ namespace styles {
|
|
|
560
560
|
borderColor: 'grayAlpha.200',
|
|
561
561
|
borderRadius: 'full',
|
|
562
562
|
borderStyle: 'solid',
|
|
563
|
-
borderWidth: '
|
|
563
|
+
borderWidth: '1',
|
|
564
564
|
boxShadow: 'raised',
|
|
565
565
|
boxSizing: 'border-box',
|
|
566
566
|
color: 'foreground',
|
|
@@ -571,26 +571,26 @@ namespace styles {
|
|
|
571
571
|
insetInlineEnd: '16',
|
|
572
572
|
justifyContent: 'center',
|
|
573
573
|
outlineColor: 'transparent !custom',
|
|
574
|
-
outlineOffset: '
|
|
574
|
+
outlineOffset: '0',
|
|
575
575
|
outlineStyle: 'solid !custom',
|
|
576
|
-
outlineWidth: '
|
|
576
|
+
outlineWidth: '2',
|
|
577
577
|
padding: '0',
|
|
578
578
|
// Fixed above the drawer and its backdrop, so the same button closes what it opened.
|
|
579
579
|
position: 'fixed',
|
|
580
|
-
transitionDuration: '
|
|
580
|
+
transitionDuration: '160',
|
|
581
581
|
transitionProperty: 'background-color, outline-color, outline-offset, transform !custom',
|
|
582
582
|
transitionTimingFunction: 'snappy',
|
|
583
583
|
width: '40',
|
|
584
|
-
zIndex: '
|
|
584
|
+
zIndex: 'modal',
|
|
585
585
|
selectors: {
|
|
586
586
|
'&:active': { transform: 'scale(0.96) !custom' },
|
|
587
|
-
'&:focus-visible': { outlineColor: 'blue.700', outlineOffset: '
|
|
587
|
+
'&:focus-visible': { outlineColor: 'blue.700', outlineOffset: '2' },
|
|
588
588
|
'&:hover': { backgroundColor: 'gray.100' },
|
|
589
589
|
// While open, the button rides out with the drawer and rests 8px outside its left edge,
|
|
590
590
|
// so the close mark never covers the sidebar. The width matches the drawer's.
|
|
591
591
|
'&[data-popup-open]': {
|
|
592
592
|
transform: 'translateX(calc(8px - min(18rem, 85vw))) !custom',
|
|
593
|
-
transitionDuration: '
|
|
593
|
+
transitionDuration: '280',
|
|
594
594
|
transitionTimingFunction: 'spring',
|
|
595
595
|
},
|
|
596
596
|
},
|
|
@@ -610,7 +610,7 @@ namespace styles {
|
|
|
610
610
|
inset: '0',
|
|
611
611
|
justifyContent: 'flex-end',
|
|
612
612
|
position: 'fixed',
|
|
613
|
-
zIndex: '
|
|
613
|
+
zIndex: 'popover',
|
|
614
614
|
},
|
|
615
615
|
{ id: 'tds/web/app-shell/viewport' },
|
|
616
616
|
)
|
|
@@ -141,7 +141,7 @@ namespace styles {
|
|
|
141
141
|
// Margin changes the group's width, which a transform cannot. Transitions retarget from
|
|
142
142
|
// the current margin, so a brief hover reverses smoothly.
|
|
143
143
|
'& > * + *': {
|
|
144
|
-
transitionDuration: '
|
|
144
|
+
transitionDuration: '220',
|
|
145
145
|
transitionProperty: 'margin-inline-start',
|
|
146
146
|
transitionTimingFunction: 'snappy',
|
|
147
147
|
},
|
|
@@ -160,11 +160,11 @@ namespace styles {
|
|
|
160
160
|
false: { columnGap: '8' },
|
|
161
161
|
true: {
|
|
162
162
|
selectors: {
|
|
163
|
-
'& > * + *': { marginInlineStart: '-
|
|
163
|
+
'& > * + *': { marginInlineStart: '-8' },
|
|
164
164
|
'& > *': {
|
|
165
165
|
outlineColor: 'background.primary',
|
|
166
166
|
outlineStyle: 'solid !custom',
|
|
167
|
-
outlineWidth: '
|
|
167
|
+
outlineWidth: '2',
|
|
168
168
|
},
|
|
169
169
|
},
|
|
170
170
|
},
|