@linyao.tw/ui 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -1
- package/dist/components/date-time/calendar.js +7 -6
- package/dist/components/date-time/calendar.js.map +1 -1
- package/dist/components/date-time/date-field.js +9 -8
- package/dist/components/date-time/date-field.js.map +1 -1
- package/dist/components/date-time/date-picker.js +7 -6
- package/dist/components/date-time/date-picker.js.map +1 -1
- package/dist/components/date-time/date-range-picker.js +7 -6
- package/dist/components/date-time/date-range-picker.js.map +1 -1
- package/dist/components/date-time/index.js +0 -1
- package/dist/components/date-time/shared.d.ts +0 -1
- package/dist/components/date-time/shared.js +6 -9
- package/dist/components/date-time/shared.js.map +1 -1
- package/dist/components/date-time/time-field.js +7 -6
- package/dist/components/date-time/time-field.js.map +1 -1
- package/dist/components/feedback/alert.js +34 -34
- package/dist/components/feedback/alert.js.map +1 -1
- package/dist/components/feedback/banner.js +14 -14
- package/dist/components/feedback/banner.js.map +1 -1
- package/dist/components/feedback/empty-state.d.ts +2 -1
- package/dist/components/feedback/empty-state.js +30 -31
- package/dist/components/feedback/empty-state.js.map +1 -1
- package/dist/components/feedback/feedback.types.d.ts +0 -1
- package/dist/components/feedback/feedback.types.js +2 -5
- package/dist/components/feedback/feedback.types.js.map +1 -1
- package/dist/components/feedback/index.d.ts +8 -8
- package/dist/components/feedback/meter.js +20 -21
- package/dist/components/feedback/meter.js.map +1 -1
- package/dist/components/feedback/progress.js +20 -21
- package/dist/components/feedback/progress.js.map +1 -1
- package/dist/components/feedback/skeleton.js +10 -11
- package/dist/components/feedback/skeleton.js.map +1 -1
- package/dist/components/feedback/spinner.js +24 -25
- package/dist/components/feedback/spinner.js.map +1 -1
- package/dist/components/feedback/toast.js +22 -21
- package/dist/components/feedback/toast.js.map +1 -1
- package/dist/components/forms/{CodeField.d.ts → code-field.d.ts} +1 -1
- package/dist/components/forms/code-field.js +65 -0
- package/dist/components/forms/code-field.js.map +1 -0
- package/dist/components/forms/{FileUpload.d.ts → file-upload.d.ts} +1 -1
- package/dist/components/forms/{FileUpload.js → file-upload.js} +127 -111
- package/dist/components/forms/file-upload.js.map +1 -0
- package/dist/components/forms/index.d.ts +6 -6
- package/dist/components/forms/{Input.js → input.js} +3 -3
- package/dist/components/forms/input.js.map +1 -0
- package/dist/components/forms/internal.d.ts +0 -2
- package/dist/components/forms/internal.js +12 -17
- package/dist/components/forms/internal.js.map +1 -1
- package/dist/components/forms/number-field.js +73 -0
- package/dist/components/forms/number-field.js.map +1 -0
- package/dist/components/forms/otp-field.js +57 -0
- package/dist/components/forms/otp-field.js.map +1 -0
- package/dist/components/forms/{TextField.d.ts → text-field.d.ts} +5 -0
- package/dist/components/forms/text-field.js +200 -0
- package/dist/components/forms/text-field.js.map +1 -0
- package/dist/components/foundations/{Avatar.js → avatar.js} +3 -3
- package/dist/components/foundations/avatar.js.map +1 -0
- package/dist/components/foundations/{Badge.d.ts → badge.d.ts} +1 -1
- package/dist/components/foundations/{Badge.js → badge.js} +3 -3
- package/dist/components/foundations/badge.js.map +1 -0
- package/dist/components/foundations/{Button.js → button.js} +3 -3
- package/dist/components/foundations/button.js.map +1 -0
- package/dist/components/foundations/{Card.d.ts → card.d.ts} +9 -2
- package/dist/components/foundations/{Card.js → card.js} +5 -5
- package/dist/components/foundations/card.js.map +1 -0
- package/dist/components/foundations/{IconButton.d.ts → icon-button.d.ts} +2 -8
- package/dist/components/foundations/{IconButton.js → icon-button.js} +4 -4
- package/dist/components/foundations/icon-button.js.map +1 -0
- package/dist/components/foundations/index.d.ts +9 -9
- package/dist/components/foundations/{Link.d.ts → link.d.ts} +1 -1
- package/dist/components/foundations/link.js +46 -0
- package/dist/components/foundations/link.js.map +1 -0
- package/dist/components/foundations/{ListCell.d.ts → list-cell.d.ts} +1 -8
- package/dist/components/foundations/{ListCell.js → list-cell.js} +3 -3
- package/dist/components/foundations/list-cell.js.map +1 -0
- package/dist/components/foundations/{SectionHeading.d.ts → section-heading.d.ts} +5 -2
- package/dist/components/foundations/{SectionHeading.js → section-heading.js} +3 -3
- package/dist/components/foundations/section-heading.js.map +1 -0
- package/dist/components/foundations/{Separator.js → separator.js} +3 -3
- package/dist/components/foundations/separator.js.map +1 -0
- package/dist/components/navigation-data/breadcrumb-pagination.js +88 -81
- package/dist/components/navigation-data/breadcrumb-pagination.js.map +1 -1
- package/dist/components/navigation-data/command-palette.d.ts +26 -0
- package/dist/components/navigation-data/command-palette.js +100 -72
- package/dist/components/navigation-data/command-palette.js.map +1 -1
- package/dist/components/navigation-data/header-tab-bar.js +49 -46
- package/dist/components/navigation-data/header-tab-bar.js.map +1 -1
- package/dist/components/navigation-data/index.d.ts +7 -7
- package/dist/components/navigation-data/menubar-toolbar.js +1 -1
- package/dist/components/navigation-data/menubar-toolbar.js.map +1 -1
- package/dist/components/navigation-data/navigation-menu.js +1 -1
- package/dist/components/navigation-data/navigation-menu.js.map +1 -1
- package/dist/components/navigation-data/scroll-area.js +1 -1
- package/dist/components/navigation-data/scroll-area.js.map +1 -1
- package/dist/components/navigation-data/table-collection.d.ts +12 -3
- package/dist/components/navigation-data/table-collection.js +11 -9
- package/dist/components/navigation-data/table-collection.js.map +1 -1
- package/dist/components/overlays/dialog.d.ts +13 -2
- package/dist/components/overlays/dialog.js +136 -131
- package/dist/components/overlays/dialog.js.map +1 -1
- package/dist/components/overlays/disclosure.js +1 -1
- package/dist/components/overlays/disclosure.js.map +1 -1
- package/dist/components/overlays/drawer.d.ts +5 -1
- package/dist/components/overlays/drawer.js +156 -152
- package/dist/components/overlays/drawer.js.map +1 -1
- package/dist/components/overlays/floating.js +115 -113
- package/dist/components/overlays/floating.js.map +1 -1
- package/dist/components/overlays/index.d.ts +4 -4
- package/dist/components/selection/combobox.js +93 -93
- package/dist/components/selection/combobox.js.map +1 -1
- package/dist/components/selection/controls.d.ts +4 -1
- package/dist/components/selection/controls.js +140 -118
- package/dist/components/selection/controls.js.map +1 -1
- package/dist/components/selection/menu.js +120 -121
- package/dist/components/selection/menu.js.map +1 -1
- package/dist/components/selection/select.js +107 -107
- package/dist/components/selection/select.js.map +1 -1
- package/dist/fonts.css +13 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +37 -33
- package/dist/internal/accessible-name.d.ts +12 -0
- package/dist/internal/class-names.d.ts +12 -0
- package/dist/{components/selection/classnames.js → internal/class-names.js} +3 -3
- package/dist/internal/class-names.js.map +1 -0
- package/dist/internal/index.d.ts +3 -0
- package/dist/{components/foundations/shared.d.ts → internal/render.d.ts} +2 -1
- package/dist/intl/index.d.ts +2 -0
- package/dist/intl/messages.d.ts +48 -0
- package/dist/intl/messages.js +80 -0
- package/dist/intl/messages.js.map +1 -0
- package/dist/intl/provider.d.ts +18 -0
- package/dist/intl/provider.js +22 -0
- package/dist/intl/provider.js.map +1 -0
- package/dist/styles.css +1 -1
- package/package.json +6 -4
- package/dist/components/feedback/feedback.module.js +0 -42
- package/dist/components/feedback/feedback.module.js.map +0 -1
- package/dist/components/forms/CodeField.js +0 -63
- package/dist/components/forms/CodeField.js.map +0 -1
- package/dist/components/forms/FileUpload.js.map +0 -1
- package/dist/components/forms/Input.js.map +0 -1
- package/dist/components/forms/NumberField.js +0 -71
- package/dist/components/forms/NumberField.js.map +0 -1
- package/dist/components/forms/OTPField.js +0 -54
- package/dist/components/forms/OTPField.js.map +0 -1
- package/dist/components/forms/TextField.js +0 -199
- package/dist/components/forms/TextField.js.map +0 -1
- package/dist/components/foundations/Avatar.js.map +0 -1
- package/dist/components/foundations/Badge.js.map +0 -1
- package/dist/components/foundations/Button.js.map +0 -1
- package/dist/components/foundations/Card.js.map +0 -1
- package/dist/components/foundations/IconButton.js.map +0 -1
- package/dist/components/foundations/Link.js +0 -40
- package/dist/components/foundations/Link.js.map +0 -1
- package/dist/components/foundations/ListCell.js.map +0 -1
- package/dist/components/foundations/SectionHeading.js.map +0 -1
- package/dist/components/foundations/Separator.js.map +0 -1
- package/dist/components/foundations/shared.js +0 -8
- package/dist/components/foundations/shared.js.map +0 -1
- package/dist/components/navigation-data/utils.d.ts +0 -2
- package/dist/components/navigation-data/utils.js +0 -11
- package/dist/components/navigation-data/utils.js.map +0 -1
- package/dist/components/overlays/class-names.d.ts +0 -6
- package/dist/components/overlays/class-names.js +0 -11
- package/dist/components/overlays/class-names.js.map +0 -1
- package/dist/components/selection/classnames.d.ts +0 -4
- package/dist/components/selection/classnames.js.map +0 -1
- package/dist/components/selection/selection.module.js +0 -51
- package/dist/components/selection/selection.module.js.map +0 -1
- /package/dist/components/forms/{Input.d.ts → input.d.ts} +0 -0
- /package/dist/components/forms/{NumberField.d.ts → number-field.d.ts} +0 -0
- /package/dist/components/forms/{OTPField.d.ts → otp-field.d.ts} +0 -0
- /package/dist/components/foundations/{Avatar.d.ts → avatar.d.ts} +0 -0
- /package/dist/components/foundations/{Button.d.ts → button.d.ts} +0 -0
- /package/dist/components/foundations/{Separator.d.ts → separator.d.ts} +0 -0
package/dist/fonts.css
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Optional hosted brand typefaces. This entry is separate from styles.css because it makes three
|
|
3
|
+
* cross-origin requests that a consumer may not be able to accept: a Content Security Policy has to
|
|
4
|
+
* allow font.emtech.cc and fonts.gstatic.com, CSS @import serialises and blocks rendering, and an
|
|
5
|
+
* offline or air-gapped build cannot reach either host at all.
|
|
6
|
+
*
|
|
7
|
+
* Import it for a quick start. For production, self-host the same families and point
|
|
8
|
+
* --font-family-sans, --font-family-serif and --font-family-mono at your own @font-face rules; the
|
|
9
|
+
* design tokens already carry system fallbacks, so the components render correctly either way.
|
|
10
|
+
*/
|
|
11
|
+
@import url("https://font.emtech.cc/css/GenKiGothicTW.css");
|
|
12
|
+
@import url("https://font.emtech.cc/css/GenKiMinTW.css");
|
|
13
|
+
@import url("https://fonts.googleapis.com/css2?family=Geist+Mono:ital,wght@0,100..900;1,100..900&display=swap");
|
package/dist/index.d.ts
CHANGED
|
@@ -5,3 +5,4 @@ export * from './components/foundations/index.js';
|
|
|
5
5
|
export * from './components/navigation-data/index.js';
|
|
6
6
|
export * from './components/overlays/index.js';
|
|
7
7
|
export * from './components/selection/index.js';
|
|
8
|
+
export { MessagesProvider, enUSMessages, useMessages, zhTWMessages, type ComponentMessages, type MessagesProviderProps } from './intl/index.js';
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
/* empty css */
|
|
1
2
|
/* empty css */
|
|
3
|
+
/* empty css */
|
|
2
4
|
/* empty css */
|
|
3
5
|
/* empty css */
|
|
4
6
|
/* empty css */
|
|
5
7
|
/* empty css */
|
|
6
|
-
/* empty css
|
|
8
|
+
/* empty css */
|
|
7
9
|
import { Calendar as e } from "./components/date-time/calendar.js";
|
|
8
10
|
import { DateField as t } from "./components/date-time/date-field.js";
|
|
9
11
|
import { DatePicker as n, DateTimePicker as r } from "./components/date-time/date-picker.js";
|
|
@@ -18,35 +20,37 @@ import { Meter as k } from "./components/feedback/meter.js";
|
|
|
18
20
|
import { Progress as A } from "./components/feedback/progress.js";
|
|
19
21
|
import { Skeleton as j } from "./components/feedback/skeleton.js";
|
|
20
22
|
import { Loader as M, Spinner as N } from "./components/feedback/spinner.js";
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
|
|
23
|
+
import { enUSMessages as P, zhTWMessages as F } from "./intl/messages.js";
|
|
24
|
+
import { MessagesProvider as I, useMessages as L } from "./intl/provider.js";
|
|
25
|
+
import { ToastProvider as R, ToastRoot as z, ToastViewport as B, createToastManager as V, useToastManager as H } from "./components/feedback/toast.js";
|
|
26
|
+
import { CodeField as U } from "./components/forms/code-field.js";
|
|
27
|
+
import { DropZone as W, FileUpload as G } from "./components/forms/file-upload.js";
|
|
28
|
+
import { Input as K } from "./components/forms/input.js";
|
|
29
|
+
import { NumberField as q } from "./components/forms/number-field.js";
|
|
30
|
+
import { OTPField as J } from "./components/forms/otp-field.js";
|
|
31
|
+
import { PasswordField as Y, PhoneField as X, SearchField as Z, TextField as Q, TextView as $, Textarea as ee } from "./components/forms/text-field.js";
|
|
32
|
+
import { Avatar as te } from "./components/foundations/avatar.js";
|
|
33
|
+
import { Badge as ne } from "./components/foundations/badge.js";
|
|
34
|
+
import { Button as re } from "./components/foundations/button.js";
|
|
35
|
+
import { Card as ie, CardBody as ae, CardDescription as oe, CardFooter as se, CardHeader as ce, CardTitle as le, CloudBox as ue } from "./components/foundations/card.js";
|
|
36
|
+
import { IconButton as de } from "./components/foundations/icon-button.js";
|
|
37
|
+
import { Link as fe } from "./components/foundations/link.js";
|
|
38
|
+
import { ListCell as pe, ListCellAction as me, ListCellContent as he, ListCellDescription as ge, ListCellLeading as _e, ListCellMetadata as ve, ListCellTitle as ye, ListCellTrailing as be } from "./components/foundations/list-cell.js";
|
|
39
|
+
import { SectionHeading as xe } from "./components/foundations/section-heading.js";
|
|
40
|
+
import { Separator as Se } from "./components/foundations/separator.js";
|
|
41
|
+
import { Breadcrumb as Ce, BreadcrumbEllipsis as we, BreadcrumbItem as Te, BreadcrumbLink as Ee, BreadcrumbList as De, BreadcrumbPage as Oe, BreadcrumbSeparator as ke, Pagination as Ae, PaginationButton as je, PaginationEllipsis as Me, PaginationItem as Ne, PaginationLink as Pe, PaginationList as Fe, PaginationNext as Ie, PaginationPrevious as Le } from "./components/navigation-data/breadcrumb-pagination.js";
|
|
42
|
+
import { CommandPaletteBackdrop as Re, CommandPaletteClose as ze, CommandPaletteDescription as Be, CommandPaletteEmpty as Ve, CommandPaletteGroup as He, CommandPaletteGroupLabel as Ue, CommandPaletteInput as We, CommandPaletteItem as Ge, CommandPaletteItemIndicator as Ke, CommandPaletteLabel as qe, CommandPaletteList as Je, CommandPaletteNamespace as Ye, CommandPalettePopup as Xe, CommandPalettePortal as Ze, CommandPaletteSeparator as Qe, CommandPaletteShortcut as $e, CommandPaletteStatus as et, CommandPaletteTitle as tt, CommandPaletteTrigger as nt, CommandPaletteViewport as rt } from "./components/navigation-data/command-palette.js";
|
|
43
|
+
import { Header as it, HeaderActions as at, HeaderBrand as ot, HeaderNav as st, HeaderRail as ct, HeaderStatus as lt, TabBar as ut, TabBarIcon as dt, TabBarItem as ft, TabBarLabel as pt, TabBarLink as mt, TabBarList as ht } from "./components/navigation-data/header-tab-bar.js";
|
|
44
|
+
import { Menubar as gt, MenubarCheckboxItem as _t, MenubarCheckboxItemIndicator as vt, MenubarGroup as yt, MenubarGroupLabel as bt, MenubarItem as xt, MenubarLinkItem as St, MenubarMenu as Ct, MenubarPopup as wt, MenubarPortal as Tt, MenubarPositioner as Et, MenubarRadioGroup as Dt, MenubarRadioItem as Ot, MenubarRadioItemIndicator as kt, MenubarSeparator as At, MenubarSubmenu as jt, MenubarSubmenuTrigger as Mt, MenubarTrigger as Nt, Toolbar as Pt, ToolbarButton as Ft, ToolbarGroup as It, ToolbarInput as Lt, ToolbarLink as Rt, ToolbarSeparator as zt } from "./components/navigation-data/menubar-toolbar.js";
|
|
45
|
+
import { NavigationMenu as Bt, NavigationMenuArrow as Vt, NavigationMenuContent as Ht, NavigationMenuIcon as Ut, NavigationMenuItem as Wt, NavigationMenuLink as Gt, NavigationMenuList as Kt, NavigationMenuPopup as qt, NavigationMenuPortal as Jt, NavigationMenuPositioner as Yt, NavigationMenuTrigger as Xt, NavigationMenuViewport as Zt } from "./components/navigation-data/navigation-menu.js";
|
|
46
|
+
import { ScrollArea as Qt, ScrollAreaContent as $t, ScrollAreaCorner as en, ScrollAreaScrollbar as tn, ScrollAreaThumb as nn, ScrollAreaViewport as rn } from "./components/navigation-data/scroll-area.js";
|
|
47
|
+
import { Collection as an, CollectionActions as on, CollectionButton as sn, CollectionContent as cn, CollectionDescription as ln, CollectionHeading as un, CollectionItem as dn, CollectionLink as fn, CollectionMeta as pn, DataTable as mn, DataTableControls as hn, DataTableDescription as gn, DataTableHeader as _n, DataTableRegion as vn, DataTableStatus as yn, DataTableTitle as bn, List as xn, ListActions as Sn, ListButton as Cn, ListContent as wn, ListDescription as Tn, ListHeading as En, ListItem as Dn, ListLink as On, ListMeta as kn, OrderedCollection as An, OrderedList as jn, Table as Mn, TableBody as Nn, TableCaption as Pn, TableCell as Fn, TableFooter as In, TableFrame as Ln, TableHead as Rn, TableHeader as zn, TableRow as Bn } from "./components/navigation-data/table-collection.js";
|
|
48
|
+
import { AlertDialog as Vn, AlertDialogActions as Hn, AlertDialogClose as Un, AlertDialogPopup as Wn, AlertDialogRoot as Gn, AlertDialogTrigger as Kn, Dialog as qn, DialogBackdrop as Jn, DialogBody as Yn, DialogClose as Xn, DialogDescription as Zn, DialogFooter as Qn, DialogHeader as $n, DialogPopup as er, DialogPortal as tr, DialogRoot as nr, DialogTitle as rr, DialogTrigger as ir, DialogViewport as ar, Modal as or } from "./components/overlays/dialog.js";
|
|
49
|
+
import { Accordion as sr, AccordionHeader as cr, AccordionItem as lr, AccordionPanel as ur, AccordionRoot as dr, AccordionTrigger as fr, Collapsible as pr, CollapsiblePanel as mr, CollapsibleRoot as hr, CollapsibleTrigger as gr, Tabs as _r, TabsIndicator as vr, TabsList as yr, TabsPanel as br, TabsRoot as xr, TabsTab as Sr } from "./components/overlays/disclosure.js";
|
|
50
|
+
import { BottomSheet as Cr, BottomSheetBody as wr, BottomSheetFooter as Tr, BottomSheetHandle as Er, BottomSheetHeader as Dr, BottomSheetPopup as Or, BottomSheetRoot as kr, Drawer as Ar, DrawerBackdrop as jr, DrawerBody as Mr, DrawerClose as Nr, DrawerContent as Pr, DrawerDescription as Fr, DrawerFooter as Ir, DrawerHeader as Lr, DrawerPopup as Rr, DrawerPortal as zr, DrawerRoot as Br, DrawerSwipeArea as Vr, DrawerTitle as Hr, DrawerTrigger as Ur, DrawerViewport as Wr } from "./components/overlays/drawer.js";
|
|
51
|
+
import { Popover as Gr, PopoverArrow as Kr, PopoverBackdrop as qr, PopoverClose as Jr, PopoverDescription as Yr, PopoverPopup as Xr, PopoverPortal as Zr, PopoverPositioner as Qr, PopoverRoot as $r, PopoverTitle as ei, PopoverTrigger as ti, PopoverViewport as ni, PreviewCard as ri, PreviewCardArrow as ii, PreviewCardBackdrop as ai, PreviewCardPopup as oi, PreviewCardPortal as si, PreviewCardPositioner as ci, PreviewCardRoot as li, PreviewCardTrigger as ui, PreviewCardViewport as di, Tooltip as fi, TooltipArrow as pi, TooltipPopup as mi, TooltipPortal as hi, TooltipPositioner as gi, TooltipProvider as _i, TooltipRoot as vi, TooltipTrigger as yi, TooltipViewport as bi } from "./components/overlays/floating.js";
|
|
52
|
+
import { Autocomplete as xi, AutocompleteInputGroup as Si, AutocompleteItem as Ci, Combobox as wi, ComboboxClear as Ti, ComboboxEmpty as Ei, ComboboxInput as Di, ComboboxInputGroup as Oi, ComboboxItem as ki, ComboboxItemIndicator as Ai, ComboboxList as ji, ComboboxPopup as Mi, ComboboxPositioner as Ni, ComboboxTrigger as Pi } from "./components/selection/combobox.js";
|
|
53
|
+
import { Checkbox as Fi, CheckboxGroup as Ii, CheckboxItem as Li, Radio as Ri, RadioGroup as zi, RadioItem as Bi, SegmentedControl as Vi, SegmentedControlItem as Hi, Slider as Ui, Switch as Wi, Toggle as Gi, ToggleGroup as Ki } from "./components/selection/controls.js";
|
|
54
|
+
import { ContextMenu as qi, ContextMenuTrigger as Ji, DropdownMenu as Yi, Menu as Xi, MenuCheckboxItem as Zi, MenuCheckboxItemIndicator as Qi, MenuGroupLabel as $i, MenuItem as ea, MenuLinkItem as ta, MenuPopup as na, MenuPositioner as ra, MenuRadioItem as ia, MenuRadioItemIndicator as aa, MenuSeparator as oa, MenuSubmenuTrigger as sa, MenuTrigger as ca } from "./components/selection/menu.js";
|
|
55
|
+
import { Select as la, SelectGroupLabel as ua, SelectItem as da, SelectItemIndicator as fa, SelectItemText as pa, SelectList as ma, SelectPopup as ha, SelectPositioner as ga, SelectSeparator as _a, SelectTrigger as va, SelectValue as ya } from "./components/selection/select.js";
|
|
56
|
+
export { sr as Accordion, cr as AccordionHeader, lr as AccordionItem, ur as AccordionPanel, dr as AccordionRoot, fr as AccordionTrigger, x as Alert, S as AlertActions, C as AlertContent, w as AlertDescription, Vn as AlertDialog, Hn as AlertDialogActions, Un as AlertDialogClose, Wn as AlertDialogPopup, Gn as AlertDialogRoot, Kn as AlertDialogTrigger, T as AlertTitle, E as AlertView, xi as Autocomplete, Si as AutocompleteInputGroup, Ci as AutocompleteItem, te as Avatar, ne as Badge, D as Banner, Cr as BottomSheet, wr as BottomSheetBody, Tr as BottomSheetFooter, Er as BottomSheetHandle, Dr as BottomSheetHeader, Or as BottomSheetPopup, kr as BottomSheetRoot, Ce as Breadcrumb, we as BreadcrumbEllipsis, Te as BreadcrumbItem, Ee as BreadcrumbLink, De as BreadcrumbList, Oe as BreadcrumbPage, ke as BreadcrumbSeparator, re as Button, e as Calendar, s as CalendarDate, c as CalendarDateTime, ie as Card, ae as CardBody, oe as CardDescription, se as CardFooter, ce as CardHeader, le as CardTitle, Fi as Checkbox, Ii as CheckboxGroup, Li as CheckboxItem, ue as CloudBox, U as CodeField, pr as Collapsible, mr as CollapsiblePanel, hr as CollapsibleRoot, gr as CollapsibleTrigger, an as Collection, on as CollectionActions, sn as CollectionButton, cn as CollectionContent, ln as CollectionDescription, un as CollectionHeading, dn as CollectionItem, fn as CollectionLink, pn as CollectionMeta, wi as Combobox, Ti as ComboboxClear, Ei as ComboboxEmpty, Di as ComboboxInput, Oi as ComboboxInputGroup, ki as ComboboxItem, Ai as ComboboxItemIndicator, ji as ComboboxList, Mi as ComboboxPopup, Ni as ComboboxPositioner, Pi as ComboboxTrigger, Ye as CommandPalette, Re as CommandPaletteBackdrop, ze as CommandPaletteClose, Be as CommandPaletteDescription, Ve as CommandPaletteEmpty, He as CommandPaletteGroup, Ue as CommandPaletteGroupLabel, We as CommandPaletteInput, Ge as CommandPaletteItem, Ke as CommandPaletteItemIndicator, qe as CommandPaletteLabel, Je as CommandPaletteList, Xe as CommandPalettePopup, Ze as CommandPalettePortal, Qe as CommandPaletteSeparator, $e as CommandPaletteShortcut, et as CommandPaletteStatus, tt as CommandPaletteTitle, nt as CommandPaletteTrigger, rt as CommandPaletteViewport, qi as ContextMenu, Ji as ContextMenuTrigger, mn as DataTable, hn as DataTableControls, gn as DataTableDescription, _n as DataTableHeader, vn as DataTableRegion, yn as DataTableStatus, bn as DataTableTitle, t as DateField, n as DatePicker, i as DateRangePicker, r as DateTimePicker, qn as Dialog, Jn as DialogBackdrop, Yn as DialogBody, Xn as DialogClose, Zn as DialogDescription, Qn as DialogFooter, $n as DialogHeader, er as DialogPopup, tr as DialogPortal, nr as DialogRoot, rr as DialogTitle, ir as DialogTrigger, ar as DialogViewport, Ar as Drawer, jr as DrawerBackdrop, Mr as DrawerBody, Nr as DrawerClose, Pr as DrawerContent, Fr as DrawerDescription, Ir as DrawerFooter, Lr as DrawerHeader, Rr as DrawerPopup, zr as DrawerPortal, Br as DrawerRoot, Vr as DrawerSwipeArea, Hr as DrawerTitle, Ur as DrawerTrigger, Wr as DrawerViewport, W as DropZone, Yi as DropdownMenu, O as EmptyState, b as FEEDBACK_STATUSES, G as FileUpload, it as Header, at as HeaderActions, ot as HeaderBrand, st as HeaderNav, ct as HeaderRail, lt as HeaderStatus, de as IconButton, K as Input, fe as Link, xn as List, Sn as ListActions, Cn as ListButton, pe as ListCell, me as ListCellAction, he as ListCellContent, ge as ListCellDescription, _e as ListCellLeading, ve as ListCellMetadata, ye as ListCellTitle, be as ListCellTrailing, wn as ListContent, Tn as ListDescription, En as ListHeading, Dn as ListItem, On as ListLink, kn as ListMeta, M as Loader, Xi as Menu, Zi as MenuCheckboxItem, Qi as MenuCheckboxItemIndicator, $i as MenuGroupLabel, ea as MenuItem, ta as MenuLinkItem, na as MenuPopup, ra as MenuPositioner, ia as MenuRadioItem, aa as MenuRadioItemIndicator, oa as MenuSeparator, sa as MenuSubmenuTrigger, ca as MenuTrigger, gt as Menubar, _t as MenubarCheckboxItem, vt as MenubarCheckboxItemIndicator, yt as MenubarGroup, bt as MenubarGroupLabel, xt as MenubarItem, St as MenubarLinkItem, Ct as MenubarMenu, wt as MenubarPopup, Tt as MenubarPortal, Et as MenubarPositioner, Dt as MenubarRadioGroup, Ot as MenubarRadioItem, kt as MenubarRadioItemIndicator, At as MenubarSeparator, jt as MenubarSubmenu, Mt as MenubarSubmenuTrigger, Nt as MenubarTrigger, I as MessagesProvider, k as Meter, or as Modal, Bt as NavigationMenu, Vt as NavigationMenuArrow, Ht as NavigationMenuContent, Ut as NavigationMenuIcon, Wt as NavigationMenuItem, Gt as NavigationMenuLink, Kt as NavigationMenuList, qt as NavigationMenuPopup, Jt as NavigationMenuPortal, Yt as NavigationMenuPositioner, Xt as NavigationMenuTrigger, Zt as NavigationMenuViewport, q as NumberField, J as OTPField, An as OrderedCollection, jn as OrderedList, Ae as Pagination, je as PaginationButton, Me as PaginationEllipsis, Ne as PaginationItem, Pe as PaginationLink, Fe as PaginationList, Ie as PaginationNext, Le as PaginationPrevious, Y as PasswordField, X as PhoneField, Gr as Popover, Kr as PopoverArrow, qr as PopoverBackdrop, Jr as PopoverClose, Yr as PopoverDescription, Xr as PopoverPopup, Zr as PopoverPortal, Qr as PopoverPositioner, $r as PopoverRoot, ei as PopoverTitle, ti as PopoverTrigger, ni as PopoverViewport, ri as PreviewCard, ii as PreviewCardArrow, ai as PreviewCardBackdrop, oi as PreviewCardPopup, si as PreviewCardPortal, ci as PreviewCardPositioner, li as PreviewCardRoot, ui as PreviewCardTrigger, di as PreviewCardViewport, A as Progress, Ri as Radio, zi as RadioGroup, Bi as RadioItem, Qt as ScrollArea, $t as ScrollAreaContent, en as ScrollAreaCorner, tn as ScrollAreaScrollbar, nn as ScrollAreaThumb, rn as ScrollAreaViewport, Z as SearchField, xe as SectionHeading, Vi as SegmentedControl, Hi as SegmentedControlItem, la as Select, ua as SelectGroupLabel, da as SelectItem, fa as SelectItemIndicator, pa as SelectItemText, ma as SelectList, ha as SelectPopup, ga as SelectPositioner, _a as SelectSeparator, va as SelectTrigger, ya as SelectValue, Se as Separator, j as Skeleton, Ui as Slider, N as Spinner, Wi as Switch, ut as TabBar, dt as TabBarIcon, ft as TabBarItem, pt as TabBarLabel, mt as TabBarLink, ht as TabBarList, Mn as Table, Nn as TableBody, Pn as TableCaption, Fn as TableCell, In as TableFooter, Ln as TableFrame, Rn as TableHead, zn as TableHeader, Bn as TableRow, _r as Tabs, vr as TabsIndicator, yr as TabsList, br as TabsPanel, xr as TabsRoot, Sr as TabsTab, Q as TextField, $ as TextView, ee as Textarea, l as Time, a as TimeField, o as TimePicker, R as ToastProvider, z as ToastRoot, B as ToastViewport, Gi as Toggle, Ki as ToggleGroup, Pt as Toolbar, Ft as ToolbarButton, It as ToolbarGroup, Lt as ToolbarInput, Rt as ToolbarLink, zt as ToolbarSeparator, fi as Tooltip, pi as TooltipArrow, mi as TooltipPopup, hi as TooltipPortal, gi as TooltipPositioner, _i as TooltipProvider, vi as TooltipRoot, yi as TooltipTrigger, bi as TooltipViewport, u as ZonedDateTime, V as createToastManager, P as enUSMessages, d as getLocalTimeZone, f as now, p as parseAbsolute, m as parseAbsoluteToLocal, h as parseDate, g as parseDateTime, _ as parseTime, v as parseZonedDateTime, y as today, L as useMessages, H as useToastManager, F as zhTWMessages };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A control whose visible content cannot serve as its name — an icon-only button, a group of
|
|
3
|
+
* segments — still needs one, so the type asks for exactly one of the two ARIA attributes that
|
|
4
|
+
* can supply it rather than leaving both optional.
|
|
5
|
+
*/
|
|
6
|
+
export type AccessibleName = {
|
|
7
|
+
"aria-label": string;
|
|
8
|
+
"aria-labelledby"?: string;
|
|
9
|
+
} | {
|
|
10
|
+
"aria-label"?: string;
|
|
11
|
+
"aria-labelledby": string;
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Base UI `className` value: either a static string, or a function that receives the
|
|
3
|
+
* component's state. Every Linyao Design System wrapper preserves the function form so
|
|
4
|
+
* consumers can keep styling from state after the design system class has been applied.
|
|
5
|
+
*/
|
|
6
|
+
export type StateClassName<State> = string | ((state: State) => string | undefined) | undefined;
|
|
7
|
+
/** Joins the truthy class names with a single space. */
|
|
8
|
+
export declare function cx(...values: Array<string | false | null | undefined>): string;
|
|
9
|
+
/** Prefixes a Linyao Design System class onto a consumer `className`, keeping the state-function form. */
|
|
10
|
+
export declare function withStateClassName<State>(baseClassName: string, className?: StateClassName<State>): string | ((state: State) => string);
|
|
11
|
+
/** Merges two consumer `className` values, either of which may be a state function. */
|
|
12
|
+
export declare function combineStateClassNames<State>(first?: StateClassName<State>, second?: StateClassName<State>): StateClassName<State>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region src/
|
|
1
|
+
//#region src/internal/class-names.ts
|
|
2
2
|
function e(...e) {
|
|
3
3
|
return e.filter(Boolean).join(" ");
|
|
4
4
|
}
|
|
@@ -9,6 +9,6 @@ function n(t, n) {
|
|
|
9
9
|
return typeof t == "function" || typeof n == "function" ? (r) => e(typeof t == "function" ? t(r) : t, typeof n == "function" ? n(r) : n) : e(t, n);
|
|
10
10
|
}
|
|
11
11
|
//#endregion
|
|
12
|
-
export { n as combineStateClassNames, e as cx, t as
|
|
12
|
+
export { n as combineStateClassNames, e as cx, t as withStateClassName };
|
|
13
13
|
|
|
14
|
-
//# sourceMappingURL=
|
|
14
|
+
//# sourceMappingURL=class-names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"class-names.js","names":[],"sources":["../../src/internal/class-names.ts"],"sourcesContent":["/**\n * A Base UI `className` value: either a static string, or a function that receives the\n * component's state. Every Linyao Design System wrapper preserves the function form so\n * consumers can keep styling from state after the design system class has been applied.\n */\nexport type StateClassName<State> = string | ((state: State) => string | undefined) | undefined;\n\n/** Joins the truthy class names with a single space. */\nexport function cx(...values: Array<string | false | null | undefined>): string {\n\treturn values.filter(Boolean).join(\" \");\n}\n\n/** Prefixes a Linyao Design System class onto a consumer `className`, keeping the state-function form. */\nexport function withStateClassName<State>(baseClassName: string, className?: StateClassName<State>): string | ((state: State) => string) {\n\tif (typeof className === \"function\") {\n\t\treturn state => cx(baseClassName, className(state));\n\t}\n\n\treturn cx(baseClassName, className);\n}\n\n/** Merges two consumer `className` values, either of which may be a state function. */\nexport function combineStateClassNames<State>(first?: StateClassName<State>, second?: StateClassName<State>): StateClassName<State> {\n\tif (typeof first === \"function\" || typeof second === \"function\") {\n\t\treturn state => cx(typeof first === \"function\" ? first(state) : first, typeof second === \"function\" ? second(state) : second);\n\t}\n\n\treturn cx(first, second);\n}\n"],"mappings":";AAQA,SAAgB,EAAG,GAAG,GAA0D;CAC/E,OAAO,EAAO,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;AACvC;AAGA,SAAgB,EAA0B,GAAuB,GAAwE;CAKxI,OAJI,OAAO,KAAc,cACjB,MAAS,EAAG,GAAe,EAAU,CAAK,CAAC,IAG5C,EAAG,GAAe,CAAS;AACnC;AAGA,SAAgB,EAA8B,GAA+B,GAAuD;CAKnI,OAJI,OAAO,KAAU,cAAc,OAAO,KAAW,cAC7C,MAAS,EAAG,OAAO,KAAU,aAAa,EAAM,CAAK,IAAI,GAAO,OAAO,KAAW,aAAa,EAAO,CAAK,IAAI,CAAM,IAGtH,EAAG,GAAO,CAAM;AACxB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useRender } from '@base-ui/react/use-render';
|
|
2
2
|
import type * as React from "react";
|
|
3
|
+
/** The polymorphic `render` prop shared by components built on Base UI's `useRender`. */
|
|
3
4
|
export type ComponentRenderProp<State extends Record<string, unknown>> = useRender.RenderProp<State>;
|
|
5
|
+
/** Intrinsic element props with the legacy presentational `color` attribute removed. */
|
|
4
6
|
export type ElementProps<ElementType extends React.ElementType> = Omit<React.ComponentPropsWithoutRef<ElementType>, "color">;
|
|
5
|
-
export declare function mergeClassNames(...classNames: Array<string | undefined | false>): string;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every user-visible string the components fall back to when the consumer does not pass one.
|
|
3
|
+
* Each of these also remains overridable per instance through the matching prop; the bundle is
|
|
4
|
+
* the default, not a lock.
|
|
5
|
+
*/
|
|
6
|
+
export interface ComponentMessages {
|
|
7
|
+
alertDialogClose: string;
|
|
8
|
+
autocompleteClear: string;
|
|
9
|
+
autocompleteEmpty: string;
|
|
10
|
+
autocompleteTrigger: string;
|
|
11
|
+
bottomSheetClose: string;
|
|
12
|
+
breadcrumbLabel: string;
|
|
13
|
+
breadcrumbMore: string;
|
|
14
|
+
comboboxClear: string;
|
|
15
|
+
comboboxEmpty: string;
|
|
16
|
+
comboboxTrigger: string;
|
|
17
|
+
commandPaletteClose: string;
|
|
18
|
+
commandPalettePlaceholder: string;
|
|
19
|
+
dialogClose: string;
|
|
20
|
+
drawerClose: string;
|
|
21
|
+
dropZoneBrowse: string;
|
|
22
|
+
dropZonePrimary: string;
|
|
23
|
+
dropZoneSecondary: string;
|
|
24
|
+
fileSelectionLabel: string;
|
|
25
|
+
fileUploadInvalidFile: string;
|
|
26
|
+
fileUploadTrigger: string;
|
|
27
|
+
headerNavLabel: string;
|
|
28
|
+
/** Appended to a link's accessible name when it opens in a new window. */
|
|
29
|
+
linkOpensInNewWindow: string;
|
|
30
|
+
numberFieldDecrement: string;
|
|
31
|
+
numberFieldIncrement: string;
|
|
32
|
+
paginationLabel: string;
|
|
33
|
+
paginationMore: string;
|
|
34
|
+
paginationNext: string;
|
|
35
|
+
paginationPrevious: string;
|
|
36
|
+
passwordFieldHide: string;
|
|
37
|
+
passwordFieldShow: string;
|
|
38
|
+
popoverClose: string;
|
|
39
|
+
selectPlaceholder: string;
|
|
40
|
+
tabBarLabel: string;
|
|
41
|
+
toastClose: string;
|
|
42
|
+
/** Announced for the second and later code slots, which have no visible label of their own. */
|
|
43
|
+
codeSlotLabel: (position: number, length: number) => string;
|
|
44
|
+
/** Announced by the file selection status region after a picker or drop changes the selection. */
|
|
45
|
+
fileSelectionSummary: (count: number) => string;
|
|
46
|
+
}
|
|
47
|
+
export declare const zhTWMessages: ComponentMessages;
|
|
48
|
+
export declare const enUSMessages: ComponentMessages;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
//#region src/intl/messages.ts
|
|
2
|
+
var e = {
|
|
3
|
+
alertDialogClose: "取消並關閉警示",
|
|
4
|
+
autocompleteClear: "清除搜尋內容",
|
|
5
|
+
autocompleteEmpty: "找不到建議項目",
|
|
6
|
+
autocompleteTrigger: "顯示建議項目",
|
|
7
|
+
bottomSheetClose: "關閉底部面板",
|
|
8
|
+
breadcrumbLabel: "麵包屑導覽",
|
|
9
|
+
breadcrumbMore: "更多頁面",
|
|
10
|
+
comboboxClear: "清除選取",
|
|
11
|
+
comboboxEmpty: "找不到符合的選項",
|
|
12
|
+
comboboxTrigger: "顯示選項",
|
|
13
|
+
commandPaletteClose: "關閉",
|
|
14
|
+
commandPalettePlaceholder: "輸入指令…",
|
|
15
|
+
dialogClose: "關閉對話框",
|
|
16
|
+
drawerClose: "關閉側欄",
|
|
17
|
+
dropZoneBrowse: "選擇檔案",
|
|
18
|
+
dropZonePrimary: "將檔案拖曳至此",
|
|
19
|
+
dropZoneSecondary: "或從裝置選擇檔案",
|
|
20
|
+
fileSelectionLabel: "已選擇的檔案",
|
|
21
|
+
fileUploadInvalidFile: "不支援的檔案類型",
|
|
22
|
+
fileUploadTrigger: "選擇檔案",
|
|
23
|
+
headerNavLabel: "主要導覽",
|
|
24
|
+
linkOpensInNewWindow: "(在新視窗開啟)",
|
|
25
|
+
numberFieldDecrement: "減少數值",
|
|
26
|
+
numberFieldIncrement: "增加數值",
|
|
27
|
+
paginationLabel: "分頁導覽",
|
|
28
|
+
paginationMore: "更多頁面",
|
|
29
|
+
paginationNext: "下一頁",
|
|
30
|
+
paginationPrevious: "上一頁",
|
|
31
|
+
passwordFieldHide: "隱藏密碼",
|
|
32
|
+
passwordFieldShow: "顯示密碼",
|
|
33
|
+
popoverClose: "關閉彈出視窗",
|
|
34
|
+
selectPlaceholder: "請選擇",
|
|
35
|
+
tabBarLabel: "應用程式區段",
|
|
36
|
+
toastClose: "關閉通知",
|
|
37
|
+
codeSlotLabel: (e, t) => `第 ${e} 個字元,共 ${t} 個`,
|
|
38
|
+
fileSelectionSummary: (e) => `已選擇 ${e} 個檔案`
|
|
39
|
+
}, t = {
|
|
40
|
+
alertDialogClose: "Cancel and close alert",
|
|
41
|
+
autocompleteClear: "Clear search",
|
|
42
|
+
autocompleteEmpty: "No suggestions found",
|
|
43
|
+
autocompleteTrigger: "Show suggestions",
|
|
44
|
+
bottomSheetClose: "Close sheet",
|
|
45
|
+
breadcrumbLabel: "Breadcrumb",
|
|
46
|
+
breadcrumbMore: "More pages",
|
|
47
|
+
comboboxClear: "Clear selection",
|
|
48
|
+
comboboxEmpty: "No matching options",
|
|
49
|
+
comboboxTrigger: "Show options",
|
|
50
|
+
commandPaletteClose: "Close",
|
|
51
|
+
commandPalettePlaceholder: "Type a command…",
|
|
52
|
+
dialogClose: "Close dialog",
|
|
53
|
+
drawerClose: "Close drawer",
|
|
54
|
+
dropZoneBrowse: "Choose files",
|
|
55
|
+
dropZonePrimary: "Drop files here",
|
|
56
|
+
dropZoneSecondary: "or choose them from your device",
|
|
57
|
+
fileSelectionLabel: "Selected files",
|
|
58
|
+
fileUploadInvalidFile: "Unsupported file type",
|
|
59
|
+
fileUploadTrigger: "Choose files",
|
|
60
|
+
headerNavLabel: "Main",
|
|
61
|
+
linkOpensInNewWindow: "(opens in a new window)",
|
|
62
|
+
numberFieldDecrement: "Decrease value",
|
|
63
|
+
numberFieldIncrement: "Increase value",
|
|
64
|
+
paginationLabel: "Pagination",
|
|
65
|
+
paginationMore: "More pages",
|
|
66
|
+
paginationNext: "Next page",
|
|
67
|
+
paginationPrevious: "Previous page",
|
|
68
|
+
passwordFieldHide: "Hide password",
|
|
69
|
+
passwordFieldShow: "Show password",
|
|
70
|
+
popoverClose: "Close popover",
|
|
71
|
+
selectPlaceholder: "Select an option",
|
|
72
|
+
tabBarLabel: "Sections",
|
|
73
|
+
toastClose: "Close notification",
|
|
74
|
+
codeSlotLabel: (e, t) => `Character ${e} of ${t}`,
|
|
75
|
+
fileSelectionSummary: (e) => e === 1 ? "1 file selected" : `${e} files selected`
|
|
76
|
+
};
|
|
77
|
+
//#endregion
|
|
78
|
+
export { t as enUSMessages, e as zhTWMessages };
|
|
79
|
+
|
|
80
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","names":[],"sources":["../../src/intl/messages.ts"],"sourcesContent":["/**\n * Every user-visible string the components fall back to when the consumer does not pass one.\n * Each of these also remains overridable per instance through the matching prop; the bundle is\n * the default, not a lock.\n */\nexport interface ComponentMessages {\n\talertDialogClose: string;\n\tautocompleteClear: string;\n\tautocompleteEmpty: string;\n\tautocompleteTrigger: string;\n\tbottomSheetClose: string;\n\tbreadcrumbLabel: string;\n\tbreadcrumbMore: string;\n\tcomboboxClear: string;\n\tcomboboxEmpty: string;\n\tcomboboxTrigger: string;\n\tcommandPaletteClose: string;\n\tcommandPalettePlaceholder: string;\n\tdialogClose: string;\n\tdrawerClose: string;\n\tdropZoneBrowse: string;\n\tdropZonePrimary: string;\n\tdropZoneSecondary: string;\n\tfileSelectionLabel: string;\n\tfileUploadInvalidFile: string;\n\tfileUploadTrigger: string;\n\theaderNavLabel: string;\n\t/** Appended to a link's accessible name when it opens in a new window. */\n\tlinkOpensInNewWindow: string;\n\tnumberFieldDecrement: string;\n\tnumberFieldIncrement: string;\n\tpaginationLabel: string;\n\tpaginationMore: string;\n\tpaginationNext: string;\n\tpaginationPrevious: string;\n\tpasswordFieldHide: string;\n\tpasswordFieldShow: string;\n\tpopoverClose: string;\n\tselectPlaceholder: string;\n\ttabBarLabel: string;\n\ttoastClose: string;\n\t/** Announced for the second and later code slots, which have no visible label of their own. */\n\tcodeSlotLabel: (position: number, length: number) => string;\n\t/** Announced by the file selection status region after a picker or drop changes the selection. */\n\tfileSelectionSummary: (count: number) => string;\n}\n\nexport const zhTWMessages: ComponentMessages = {\n\talertDialogClose: \"取消並關閉警示\",\n\tautocompleteClear: \"清除搜尋內容\",\n\tautocompleteEmpty: \"找不到建議項目\",\n\tautocompleteTrigger: \"顯示建議項目\",\n\tbottomSheetClose: \"關閉底部面板\",\n\tbreadcrumbLabel: \"麵包屑導覽\",\n\tbreadcrumbMore: \"更多頁面\",\n\tcomboboxClear: \"清除選取\",\n\tcomboboxEmpty: \"找不到符合的選項\",\n\tcomboboxTrigger: \"顯示選項\",\n\tcommandPaletteClose: \"關閉\",\n\tcommandPalettePlaceholder: \"輸入指令…\",\n\tdialogClose: \"關閉對話框\",\n\tdrawerClose: \"關閉側欄\",\n\tdropZoneBrowse: \"選擇檔案\",\n\tdropZonePrimary: \"將檔案拖曳至此\",\n\tdropZoneSecondary: \"或從裝置選擇檔案\",\n\tfileSelectionLabel: \"已選擇的檔案\",\n\tfileUploadInvalidFile: \"不支援的檔案類型\",\n\tfileUploadTrigger: \"選擇檔案\",\n\theaderNavLabel: \"主要導覽\",\n\tlinkOpensInNewWindow: \"(在新視窗開啟)\",\n\tnumberFieldDecrement: \"減少數值\",\n\tnumberFieldIncrement: \"增加數值\",\n\tpaginationLabel: \"分頁導覽\",\n\tpaginationMore: \"更多頁面\",\n\tpaginationNext: \"下一頁\",\n\tpaginationPrevious: \"上一頁\",\n\tpasswordFieldHide: \"隱藏密碼\",\n\tpasswordFieldShow: \"顯示密碼\",\n\tpopoverClose: \"關閉彈出視窗\",\n\tselectPlaceholder: \"請選擇\",\n\ttabBarLabel: \"應用程式區段\",\n\ttoastClose: \"關閉通知\",\n\tcodeSlotLabel: (position, length) => `第 ${position} 個字元,共 ${length} 個`,\n\tfileSelectionSummary: count => `已選擇 ${count} 個檔案`\n};\n\nexport const enUSMessages: ComponentMessages = {\n\talertDialogClose: \"Cancel and close alert\",\n\tautocompleteClear: \"Clear search\",\n\tautocompleteEmpty: \"No suggestions found\",\n\tautocompleteTrigger: \"Show suggestions\",\n\tbottomSheetClose: \"Close sheet\",\n\tbreadcrumbLabel: \"Breadcrumb\",\n\tbreadcrumbMore: \"More pages\",\n\tcomboboxClear: \"Clear selection\",\n\tcomboboxEmpty: \"No matching options\",\n\tcomboboxTrigger: \"Show options\",\n\tcommandPaletteClose: \"Close\",\n\tcommandPalettePlaceholder: \"Type a command…\",\n\tdialogClose: \"Close dialog\",\n\tdrawerClose: \"Close drawer\",\n\tdropZoneBrowse: \"Choose files\",\n\tdropZonePrimary: \"Drop files here\",\n\tdropZoneSecondary: \"or choose them from your device\",\n\tfileSelectionLabel: \"Selected files\",\n\tfileUploadInvalidFile: \"Unsupported file type\",\n\tfileUploadTrigger: \"Choose files\",\n\theaderNavLabel: \"Main\",\n\tlinkOpensInNewWindow: \"(opens in a new window)\",\n\tnumberFieldDecrement: \"Decrease value\",\n\tnumberFieldIncrement: \"Increase value\",\n\tpaginationLabel: \"Pagination\",\n\tpaginationMore: \"More pages\",\n\tpaginationNext: \"Next page\",\n\tpaginationPrevious: \"Previous page\",\n\tpasswordFieldHide: \"Hide password\",\n\tpasswordFieldShow: \"Show password\",\n\tpopoverClose: \"Close popover\",\n\tselectPlaceholder: \"Select an option\",\n\ttabBarLabel: \"Sections\",\n\ttoastClose: \"Close notification\",\n\tcodeSlotLabel: (position, length) => `Character ${position} of ${length}`,\n\tfileSelectionSummary: count => (count === 1 ? \"1 file selected\" : `${count} files selected`)\n};\n"],"mappings":";AA+CA,IAAa,IAAkC;CAC9C,kBAAkB;CAClB,mBAAmB;CACnB,mBAAmB;CACnB,qBAAqB;CACrB,kBAAkB;CAClB,iBAAiB;CACjB,gBAAgB;CAChB,eAAe;CACf,eAAe;CACf,iBAAiB;CACjB,qBAAqB;CACrB,2BAA2B;CAC3B,aAAa;CACb,aAAa;CACb,gBAAgB;CAChB,iBAAiB;CACjB,mBAAmB;CACnB,oBAAoB;CACpB,uBAAuB;CACvB,mBAAmB;CACnB,gBAAgB;CAChB,sBAAsB;CACtB,sBAAsB;CACtB,sBAAsB;CACtB,iBAAiB;CACjB,gBAAgB;CAChB,gBAAgB;CAChB,oBAAoB;CACpB,mBAAmB;CACnB,mBAAmB;CACnB,cAAc;CACd,mBAAmB;CACnB,aAAa;CACb,YAAY;CACZ,gBAAgB,GAAU,MAAW,KAAK,EAAS,SAAS,EAAO;CACnE,uBAAsB,MAAS,OAAO,EAAM;AAC7C,GAEa,IAAkC;CAC9C,kBAAkB;CAClB,mBAAmB;CACnB,mBAAmB;CACnB,qBAAqB;CACrB,kBAAkB;CAClB,iBAAiB;CACjB,gBAAgB;CAChB,eAAe;CACf,eAAe;CACf,iBAAiB;CACjB,qBAAqB;CACrB,2BAA2B;CAC3B,aAAa;CACb,aAAa;CACb,gBAAgB;CAChB,iBAAiB;CACjB,mBAAmB;CACnB,oBAAoB;CACpB,uBAAuB;CACvB,mBAAmB;CACnB,gBAAgB;CAChB,sBAAsB;CACtB,sBAAsB;CACtB,sBAAsB;CACtB,iBAAiB;CACjB,gBAAgB;CAChB,gBAAgB;CAChB,oBAAoB;CACpB,mBAAmB;CACnB,mBAAmB;CACnB,cAAc;CACd,mBAAmB;CACnB,aAAa;CACb,YAAY;CACZ,gBAAgB,GAAU,MAAW,aAAa,EAAS,MAAM;CACjE,uBAAsB,MAAU,MAAU,IAAI,oBAAoB,GAAG,EAAM;AAC5E"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ComponentMessages } from './messages.js';
|
|
3
|
+
export interface MessagesProviderProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* Strings to use in place of the inherited bundle. Partial objects are merged over the bundle
|
|
7
|
+
* already in scope, so a provider can translate the whole system or correct a single string.
|
|
8
|
+
*/
|
|
9
|
+
messages: Partial<ComponentMessages>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Supplies the default strings the components fall back to. Without a provider the components use
|
|
13
|
+
* the Traditional Chinese bundle, which is what they shipped with; wrap the tree in a provider to
|
|
14
|
+
* swap in `enUSMessages` or a bundle of your own.
|
|
15
|
+
*/
|
|
16
|
+
export declare function MessagesProvider({ children, messages }: MessagesProviderProps): import("react").JSX.Element;
|
|
17
|
+
/** Reads the strings in scope. Component props still take precedence over whatever this returns. */
|
|
18
|
+
export declare function useMessages(): ComponentMessages;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { zhTWMessages as e } from "./messages.js";
|
|
2
|
+
import { createContext as t, useContext as n, useMemo as r } from "react";
|
|
3
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
4
|
+
//#region src/intl/provider.tsx
|
|
5
|
+
var a = t(e);
|
|
6
|
+
function o({ children: e, messages: t }) {
|
|
7
|
+
let o = n(a), s = r(() => ({
|
|
8
|
+
...o,
|
|
9
|
+
...t
|
|
10
|
+
}), [o, t]);
|
|
11
|
+
return /* @__PURE__ */ i(a, {
|
|
12
|
+
value: s,
|
|
13
|
+
children: e
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function s() {
|
|
17
|
+
return n(a);
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { o as MessagesProvider, s as useMessages };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.js","names":[],"sources":["../../src/intl/provider.tsx"],"sourcesContent":["import { createContext, useContext, useMemo, type ReactNode } from \"react\";\n\nimport { zhTWMessages, type ComponentMessages } from \"./messages\";\n\nconst MessagesContext = createContext<ComponentMessages>(zhTWMessages);\n\nexport interface MessagesProviderProps {\n\tchildren: ReactNode;\n\t/**\n\t * Strings to use in place of the inherited bundle. Partial objects are merged over the bundle\n\t * already in scope, so a provider can translate the whole system or correct a single string.\n\t */\n\tmessages: Partial<ComponentMessages>;\n}\n\n/**\n * Supplies the default strings the components fall back to. Without a provider the components use\n * the Traditional Chinese bundle, which is what they shipped with; wrap the tree in a provider to\n * swap in `enUSMessages` or a bundle of your own.\n */\nexport function MessagesProvider({ children, messages }: MessagesProviderProps) {\n\tconst inherited = useContext(MessagesContext);\n\tconst value = useMemo(() => ({ ...inherited, ...messages }), [inherited, messages]);\n\n\treturn <MessagesContext value={value}>{children}</MessagesContext>;\n}\n\n/** Reads the strings in scope. Component props still take precedence over whatever this returns. */\nexport function useMessages(): ComponentMessages {\n\treturn useContext(MessagesContext);\n}\n"],"mappings":";;;;AAIA,IAAM,IAAkB,EAAiC,CAAY;AAgBrE,SAAgB,EAAiB,EAAE,aAAU,eAAmC;CAC/E,IAAM,IAAY,EAAW,CAAe,GACtC,IAAQ,SAAe;EAAE,GAAG;EAAW,GAAG;CAAS,IAAI,CAAC,GAAW,CAAQ,CAAC;CAElF,OAAO,kBAAC,GAAD;EAAwB;EAAQ;CAA0B,CAAA;AAClE;AAGA,SAAgB,IAAiC;CAChD,OAAO,EAAW,CAAe;AAClC"}
|