@linyao.tw/ui 1.0.0 → 1.2.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 +8 -6
- package/dist/components/date-time/calendar.js.map +1 -1
- package/dist/components/date-time/date-field.js +10 -8
- package/dist/components/date-time/date-field.js.map +1 -1
- package/dist/components/date-time/date-picker.js +8 -6
- package/dist/components/date-time/date-picker.js.map +1 -1
- package/dist/components/date-time/date-range-picker.js +8 -6
- package/dist/components/date-time/date-range-picker.js.map +1 -1
- package/dist/components/date-time/index.js +1 -1
- package/dist/components/date-time/shared.d.ts +0 -1
- package/dist/components/date-time/shared.js +7 -9
- package/dist/components/date-time/shared.js.map +1 -1
- package/dist/components/date-time/time-field.js +8 -6
- package/dist/components/date-time/time-field.js.map +1 -1
- package/dist/components/feedback/alert.js +35 -34
- package/dist/components/feedback/alert.js.map +1 -1
- package/dist/components/feedback/banner.js +15 -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 +31 -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 +3 -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 +21 -21
- package/dist/components/feedback/meter.js.map +1 -1
- package/dist/components/feedback/progress.js +21 -21
- package/dist/components/feedback/progress.js.map +1 -1
- package/dist/components/feedback/skeleton.js +11 -11
- package/dist/components/feedback/skeleton.js.map +1 -1
- package/dist/components/feedback/spinner.js +25 -25
- package/dist/components/feedback/spinner.js.map +1 -1
- package/dist/components/feedback/toast.js +23 -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 +66 -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} +128 -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} +4 -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 +22 -25
- package/dist/components/forms/internal.js.map +1 -1
- package/dist/components/forms/number-field.js +74 -0
- package/dist/components/forms/number-field.js.map +1 -0
- package/dist/components/forms/otp-field.js +58 -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 +201 -0
- package/dist/components/forms/text-field.js.map +1 -0
- package/dist/components/foundations/{Avatar.js → avatar.js} +13 -10
- 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} +4 -3
- package/dist/components/foundations/badge.js.map +1 -0
- package/dist/components/foundations/{Button.js → button.js} +4 -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} +6 -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} +5 -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 +47 -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} +4 -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} +4 -3
- package/dist/components/foundations/section-heading.js.map +1 -0
- package/dist/components/foundations/{Separator.js → separator.js} +4 -3
- package/dist/components/foundations/separator.js.map +1 -0
- package/dist/components/navigation-data/breadcrumb-pagination.js +89 -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 +101 -72
- package/dist/components/navigation-data/command-palette.js.map +1 -1
- package/dist/components/navigation-data/header-tab-bar.js +50 -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 +2 -1
- package/dist/components/navigation-data/menubar-toolbar.js.map +1 -1
- package/dist/components/navigation-data/navigation-menu.js +2 -1
- package/dist/components/navigation-data/navigation-menu.js.map +1 -1
- package/dist/components/navigation-data/scroll-area.js +2 -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 +12 -9
- package/dist/components/navigation-data/table-collection.js.map +1 -1
- package/dist/components/overlays/dialog.d.ts +23 -3
- package/dist/components/overlays/dialog.js +138 -130
- package/dist/components/overlays/dialog.js.map +1 -1
- package/dist/components/overlays/disclosure.js +2 -1
- package/dist/components/overlays/disclosure.js.map +1 -1
- package/dist/components/overlays/drawer.d.ts +9 -2
- package/dist/components/overlays/drawer.js +158 -151
- package/dist/components/overlays/drawer.js.map +1 -1
- package/dist/components/overlays/floating.js +116 -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 +94 -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 +141 -118
- package/dist/components/selection/controls.js.map +1 -1
- package/dist/components/selection/menu.js +121 -121
- package/dist/components/selection/menu.js.map +1 -1
- package/dist/components/selection/select.js +108 -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 +39 -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} +4 -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 +3 -0
- package/dist/intl/linyao-provider.d.ts +38 -0
- package/dist/intl/linyao-provider.js +27 -0
- package/dist/intl/linyao-provider.js.map +1 -0
- package/dist/intl/messages.d.ts +48 -0
- package/dist/intl/messages.js +81 -0
- package/dist/intl/messages.js.map +1 -0
- package/dist/intl/provider.d.ts +18 -0
- package/dist/intl/provider.js +31 -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 { LinyaoProvider, MessagesProvider, enUSMessages, getMessagesForLocale, useMessages, zhTWMessages, type ComponentMessages, type LinyaoProviderProps, type MessagesProviderProps } from './intl/index.js';
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
/* empty css */
|
|
1
3
|
/* empty css */
|
|
4
|
+
/* empty css */
|
|
2
5
|
/* empty css */
|
|
3
6
|
/* empty css */
|
|
4
7
|
/* empty css */
|
|
5
8
|
/* empty css */
|
|
6
|
-
/* empty css
|
|
9
|
+
/* empty css */
|
|
7
10
|
import { Calendar as e } from "./components/date-time/calendar.js";
|
|
8
11
|
import { DateField as t } from "./components/date-time/date-field.js";
|
|
9
12
|
import { DatePicker as n, DateTimePicker as r } from "./components/date-time/date-picker.js";
|
|
@@ -18,35 +21,38 @@ import { Meter as k } from "./components/feedback/meter.js";
|
|
|
18
21
|
import { Progress as A } from "./components/feedback/progress.js";
|
|
19
22
|
import { Skeleton as j } from "./components/feedback/skeleton.js";
|
|
20
23
|
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
|
-
|
|
24
|
+
import { enUSMessages as P, zhTWMessages as F } from "./intl/messages.js";
|
|
25
|
+
import { MessagesProvider as I, useMessages as L } from "./intl/provider.js";
|
|
26
|
+
import { LinyaoProvider as R, getMessagesForLocale as z } from "./intl/linyao-provider.js";
|
|
27
|
+
import { ToastProvider as B, ToastRoot as V, ToastViewport as H, createToastManager as U, useToastManager as W } from "./components/feedback/toast.js";
|
|
28
|
+
import { CodeField as G } from "./components/forms/code-field.js";
|
|
29
|
+
import { DropZone as K, FileUpload as q } from "./components/forms/file-upload.js";
|
|
30
|
+
import { Input as J } from "./components/forms/input.js";
|
|
31
|
+
import { NumberField as Y } from "./components/forms/number-field.js";
|
|
32
|
+
import { OTPField as X } from "./components/forms/otp-field.js";
|
|
33
|
+
import { PasswordField as Z, PhoneField as Q, SearchField as $, TextField as ee, TextView as te, Textarea as ne } from "./components/forms/text-field.js";
|
|
34
|
+
import { Avatar as re } from "./components/foundations/avatar.js";
|
|
35
|
+
import { Badge as ie } from "./components/foundations/badge.js";
|
|
36
|
+
import { Button as ae } from "./components/foundations/button.js";
|
|
37
|
+
import { Card as oe, CardBody as se, CardDescription as ce, CardFooter as le, CardHeader as ue, CardTitle as de, CloudBox as fe } from "./components/foundations/card.js";
|
|
38
|
+
import { IconButton as pe } from "./components/foundations/icon-button.js";
|
|
39
|
+
import { Link as me } from "./components/foundations/link.js";
|
|
40
|
+
import { ListCell as he, ListCellAction as ge, ListCellContent as _e, ListCellDescription as ve, ListCellLeading as ye, ListCellMetadata as be, ListCellTitle as xe, ListCellTrailing as Se } from "./components/foundations/list-cell.js";
|
|
41
|
+
import { SectionHeading as Ce } from "./components/foundations/section-heading.js";
|
|
42
|
+
import { Separator as we } from "./components/foundations/separator.js";
|
|
43
|
+
import { Breadcrumb as Te, BreadcrumbEllipsis as Ee, BreadcrumbItem as De, BreadcrumbLink as Oe, BreadcrumbList as ke, BreadcrumbPage as Ae, BreadcrumbSeparator as je, Pagination as Me, PaginationButton as Ne, PaginationEllipsis as Pe, PaginationItem as Fe, PaginationLink as Ie, PaginationList as Le, PaginationNext as Re, PaginationPrevious as ze } from "./components/navigation-data/breadcrumb-pagination.js";
|
|
44
|
+
import { CommandPaletteBackdrop as Be, CommandPaletteClose as Ve, CommandPaletteDescription as He, CommandPaletteEmpty as Ue, CommandPaletteGroup as We, CommandPaletteGroupLabel as Ge, CommandPaletteInput as Ke, CommandPaletteItem as qe, CommandPaletteItemIndicator as Je, CommandPaletteLabel as Ye, CommandPaletteList as Xe, CommandPaletteNamespace as Ze, CommandPalettePopup as Qe, CommandPalettePortal as $e, CommandPaletteSeparator as et, CommandPaletteShortcut as tt, CommandPaletteStatus as nt, CommandPaletteTitle as rt, CommandPaletteTrigger as it, CommandPaletteViewport as at } from "./components/navigation-data/command-palette.js";
|
|
45
|
+
import { Header as ot, HeaderActions as st, HeaderBrand as ct, HeaderNav as lt, HeaderRail as ut, HeaderStatus as dt, TabBar as ft, TabBarIcon as pt, TabBarItem as mt, TabBarLabel as ht, TabBarLink as gt, TabBarList as _t } from "./components/navigation-data/header-tab-bar.js";
|
|
46
|
+
import { Menubar as vt, MenubarCheckboxItem as yt, MenubarCheckboxItemIndicator as bt, MenubarGroup as xt, MenubarGroupLabel as St, MenubarItem as Ct, MenubarLinkItem as wt, MenubarMenu as Tt, MenubarPopup as Et, MenubarPortal as Dt, MenubarPositioner as Ot, MenubarRadioGroup as kt, MenubarRadioItem as At, MenubarRadioItemIndicator as jt, MenubarSeparator as Mt, MenubarSubmenu as Nt, MenubarSubmenuTrigger as Pt, MenubarTrigger as Ft, Toolbar as It, ToolbarButton as Lt, ToolbarGroup as Rt, ToolbarInput as zt, ToolbarLink as Bt, ToolbarSeparator as Vt } from "./components/navigation-data/menubar-toolbar.js";
|
|
47
|
+
import { NavigationMenu as Ht, NavigationMenuArrow as Ut, NavigationMenuContent as Wt, NavigationMenuIcon as Gt, NavigationMenuItem as Kt, NavigationMenuLink as qt, NavigationMenuList as Jt, NavigationMenuPopup as Yt, NavigationMenuPortal as Xt, NavigationMenuPositioner as Zt, NavigationMenuTrigger as Qt, NavigationMenuViewport as $t } from "./components/navigation-data/navigation-menu.js";
|
|
48
|
+
import { ScrollArea as en, ScrollAreaContent as tn, ScrollAreaCorner as nn, ScrollAreaScrollbar as rn, ScrollAreaThumb as an, ScrollAreaViewport as on } from "./components/navigation-data/scroll-area.js";
|
|
49
|
+
import { Collection as sn, CollectionActions as cn, CollectionButton as ln, CollectionContent as un, CollectionDescription as dn, CollectionHeading as fn, CollectionItem as pn, CollectionLink as mn, CollectionMeta as hn, DataTable as gn, DataTableControls as _n, DataTableDescription as vn, DataTableHeader as yn, DataTableRegion as bn, DataTableStatus as xn, DataTableTitle as Sn, List as Cn, ListActions as wn, ListButton as Tn, ListContent as En, ListDescription as Dn, ListHeading as On, ListItem as kn, ListLink as An, ListMeta as jn, OrderedCollection as Mn, OrderedList as Nn, Table as Pn, TableBody as Fn, TableCaption as In, TableCell as Ln, TableFooter as Rn, TableFrame as zn, TableHead as Bn, TableHeader as Vn, TableRow as Hn } from "./components/navigation-data/table-collection.js";
|
|
50
|
+
import { AlertDialog as Un, AlertDialogActions as Wn, AlertDialogClose as Gn, AlertDialogPopup as Kn, AlertDialogRoot as qn, AlertDialogTrigger as Jn, Dialog as Yn, DialogBackdrop as Xn, DialogBody as Zn, DialogClose as Qn, DialogDescription as $n, DialogFooter as er, DialogHeader as tr, DialogPopup as nr, DialogPortal as rr, DialogRoot as ir, DialogTitle as ar, DialogTrigger as or, DialogViewport as sr, Modal as cr } from "./components/overlays/dialog.js";
|
|
51
|
+
import { Accordion as lr, AccordionHeader as ur, AccordionItem as dr, AccordionPanel as fr, AccordionRoot as pr, AccordionTrigger as mr, Collapsible as hr, CollapsiblePanel as gr, CollapsibleRoot as _r, CollapsibleTrigger as vr, Tabs as yr, TabsIndicator as br, TabsList as xr, TabsPanel as Sr, TabsRoot as Cr, TabsTab as wr } from "./components/overlays/disclosure.js";
|
|
52
|
+
import { BottomSheet as Tr, BottomSheetBody as Er, BottomSheetFooter as Dr, BottomSheetHandle as Or, BottomSheetHeader as kr, BottomSheetPopup as Ar, BottomSheetRoot as jr, Drawer as Mr, DrawerBackdrop as Nr, DrawerBody as Pr, DrawerClose as Fr, DrawerContent as Ir, DrawerDescription as Lr, DrawerFooter as Rr, DrawerHeader as zr, DrawerPopup as Br, DrawerPortal as Vr, DrawerRoot as Hr, DrawerSwipeArea as Ur, DrawerTitle as Wr, DrawerTrigger as Gr, DrawerViewport as Kr } from "./components/overlays/drawer.js";
|
|
53
|
+
import { Popover as qr, PopoverArrow as Jr, PopoverBackdrop as Yr, PopoverClose as Xr, PopoverDescription as Zr, PopoverPopup as Qr, PopoverPortal as $r, PopoverPositioner as ei, PopoverRoot as ti, PopoverTitle as ni, PopoverTrigger as ri, PopoverViewport as ii, PreviewCard as ai, PreviewCardArrow as oi, PreviewCardBackdrop as si, PreviewCardPopup as ci, PreviewCardPortal as li, PreviewCardPositioner as ui, PreviewCardRoot as di, PreviewCardTrigger as fi, PreviewCardViewport as pi, Tooltip as mi, TooltipArrow as hi, TooltipPopup as gi, TooltipPortal as _i, TooltipPositioner as vi, TooltipProvider as yi, TooltipRoot as bi, TooltipTrigger as xi, TooltipViewport as Si } from "./components/overlays/floating.js";
|
|
54
|
+
import { Autocomplete as Ci, AutocompleteInputGroup as wi, AutocompleteItem as Ti, Combobox as Ei, ComboboxClear as Di, ComboboxEmpty as Oi, ComboboxInput as ki, ComboboxInputGroup as Ai, ComboboxItem as ji, ComboboxItemIndicator as Mi, ComboboxList as Ni, ComboboxPopup as Pi, ComboboxPositioner as Fi, ComboboxTrigger as Ii } from "./components/selection/combobox.js";
|
|
55
|
+
import { Checkbox as Li, CheckboxGroup as Ri, CheckboxItem as zi, Radio as Bi, RadioGroup as Vi, RadioItem as Hi, SegmentedControl as Ui, SegmentedControlItem as Wi, Slider as Gi, Switch as Ki, Toggle as qi, ToggleGroup as Ji } from "./components/selection/controls.js";
|
|
56
|
+
import { ContextMenu as Yi, ContextMenuTrigger as Xi, DropdownMenu as Zi, Menu as Qi, MenuCheckboxItem as $i, MenuCheckboxItemIndicator as ea, MenuGroupLabel as ta, MenuItem as na, MenuLinkItem as ra, MenuPopup as ia, MenuPositioner as aa, MenuRadioItem as oa, MenuRadioItemIndicator as sa, MenuSeparator as ca, MenuSubmenuTrigger as la, MenuTrigger as ua } from "./components/selection/menu.js";
|
|
57
|
+
import { Select as da, SelectGroupLabel as fa, SelectItem as pa, SelectItemIndicator as ma, SelectItemText as ha, SelectList as ga, SelectPopup as _a, SelectPositioner as va, SelectSeparator as ya, SelectTrigger as ba, SelectValue as xa } from "./components/selection/select.js";
|
|
58
|
+
export { lr as Accordion, ur as AccordionHeader, dr as AccordionItem, fr as AccordionPanel, pr as AccordionRoot, mr as AccordionTrigger, x as Alert, S as AlertActions, C as AlertContent, w as AlertDescription, Un as AlertDialog, Wn as AlertDialogActions, Gn as AlertDialogClose, Kn as AlertDialogPopup, qn as AlertDialogRoot, Jn as AlertDialogTrigger, T as AlertTitle, E as AlertView, Ci as Autocomplete, wi as AutocompleteInputGroup, Ti as AutocompleteItem, re as Avatar, ie as Badge, D as Banner, Tr as BottomSheet, Er as BottomSheetBody, Dr as BottomSheetFooter, Or as BottomSheetHandle, kr as BottomSheetHeader, Ar as BottomSheetPopup, jr as BottomSheetRoot, Te as Breadcrumb, Ee as BreadcrumbEllipsis, De as BreadcrumbItem, Oe as BreadcrumbLink, ke as BreadcrumbList, Ae as BreadcrumbPage, je as BreadcrumbSeparator, ae as Button, e as Calendar, s as CalendarDate, c as CalendarDateTime, oe as Card, se as CardBody, ce as CardDescription, le as CardFooter, ue as CardHeader, de as CardTitle, Li as Checkbox, Ri as CheckboxGroup, zi as CheckboxItem, fe as CloudBox, G as CodeField, hr as Collapsible, gr as CollapsiblePanel, _r as CollapsibleRoot, vr as CollapsibleTrigger, sn as Collection, cn as CollectionActions, ln as CollectionButton, un as CollectionContent, dn as CollectionDescription, fn as CollectionHeading, pn as CollectionItem, mn as CollectionLink, hn as CollectionMeta, Ei as Combobox, Di as ComboboxClear, Oi as ComboboxEmpty, ki as ComboboxInput, Ai as ComboboxInputGroup, ji as ComboboxItem, Mi as ComboboxItemIndicator, Ni as ComboboxList, Pi as ComboboxPopup, Fi as ComboboxPositioner, Ii as ComboboxTrigger, Ze as CommandPalette, Be as CommandPaletteBackdrop, Ve as CommandPaletteClose, He as CommandPaletteDescription, Ue as CommandPaletteEmpty, We as CommandPaletteGroup, Ge as CommandPaletteGroupLabel, Ke as CommandPaletteInput, qe as CommandPaletteItem, Je as CommandPaletteItemIndicator, Ye as CommandPaletteLabel, Xe as CommandPaletteList, Qe as CommandPalettePopup, $e as CommandPalettePortal, et as CommandPaletteSeparator, tt as CommandPaletteShortcut, nt as CommandPaletteStatus, rt as CommandPaletteTitle, it as CommandPaletteTrigger, at as CommandPaletteViewport, Yi as ContextMenu, Xi as ContextMenuTrigger, gn as DataTable, _n as DataTableControls, vn as DataTableDescription, yn as DataTableHeader, bn as DataTableRegion, xn as DataTableStatus, Sn as DataTableTitle, t as DateField, n as DatePicker, i as DateRangePicker, r as DateTimePicker, Yn as Dialog, Xn as DialogBackdrop, Zn as DialogBody, Qn as DialogClose, $n as DialogDescription, er as DialogFooter, tr as DialogHeader, nr as DialogPopup, rr as DialogPortal, ir as DialogRoot, ar as DialogTitle, or as DialogTrigger, sr as DialogViewport, Mr as Drawer, Nr as DrawerBackdrop, Pr as DrawerBody, Fr as DrawerClose, Ir as DrawerContent, Lr as DrawerDescription, Rr as DrawerFooter, zr as DrawerHeader, Br as DrawerPopup, Vr as DrawerPortal, Hr as DrawerRoot, Ur as DrawerSwipeArea, Wr as DrawerTitle, Gr as DrawerTrigger, Kr as DrawerViewport, K as DropZone, Zi as DropdownMenu, O as EmptyState, b as FEEDBACK_STATUSES, q as FileUpload, ot as Header, st as HeaderActions, ct as HeaderBrand, lt as HeaderNav, ut as HeaderRail, dt as HeaderStatus, pe as IconButton, J as Input, me as Link, R as LinyaoProvider, Cn as List, wn as ListActions, Tn as ListButton, he as ListCell, ge as ListCellAction, _e as ListCellContent, ve as ListCellDescription, ye as ListCellLeading, be as ListCellMetadata, xe as ListCellTitle, Se as ListCellTrailing, En as ListContent, Dn as ListDescription, On as ListHeading, kn as ListItem, An as ListLink, jn as ListMeta, M as Loader, Qi as Menu, $i as MenuCheckboxItem, ea as MenuCheckboxItemIndicator, ta as MenuGroupLabel, na as MenuItem, ra as MenuLinkItem, ia as MenuPopup, aa as MenuPositioner, oa as MenuRadioItem, sa as MenuRadioItemIndicator, ca as MenuSeparator, la as MenuSubmenuTrigger, ua as MenuTrigger, vt as Menubar, yt as MenubarCheckboxItem, bt as MenubarCheckboxItemIndicator, xt as MenubarGroup, St as MenubarGroupLabel, Ct as MenubarItem, wt as MenubarLinkItem, Tt as MenubarMenu, Et as MenubarPopup, Dt as MenubarPortal, Ot as MenubarPositioner, kt as MenubarRadioGroup, At as MenubarRadioItem, jt as MenubarRadioItemIndicator, Mt as MenubarSeparator, Nt as MenubarSubmenu, Pt as MenubarSubmenuTrigger, Ft as MenubarTrigger, I as MessagesProvider, k as Meter, cr as Modal, Ht as NavigationMenu, Ut as NavigationMenuArrow, Wt as NavigationMenuContent, Gt as NavigationMenuIcon, Kt as NavigationMenuItem, qt as NavigationMenuLink, Jt as NavigationMenuList, Yt as NavigationMenuPopup, Xt as NavigationMenuPortal, Zt as NavigationMenuPositioner, Qt as NavigationMenuTrigger, $t as NavigationMenuViewport, Y as NumberField, X as OTPField, Mn as OrderedCollection, Nn as OrderedList, Me as Pagination, Ne as PaginationButton, Pe as PaginationEllipsis, Fe as PaginationItem, Ie as PaginationLink, Le as PaginationList, Re as PaginationNext, ze as PaginationPrevious, Z as PasswordField, Q as PhoneField, qr as Popover, Jr as PopoverArrow, Yr as PopoverBackdrop, Xr as PopoverClose, Zr as PopoverDescription, Qr as PopoverPopup, $r as PopoverPortal, ei as PopoverPositioner, ti as PopoverRoot, ni as PopoverTitle, ri as PopoverTrigger, ii as PopoverViewport, ai as PreviewCard, oi as PreviewCardArrow, si as PreviewCardBackdrop, ci as PreviewCardPopup, li as PreviewCardPortal, ui as PreviewCardPositioner, di as PreviewCardRoot, fi as PreviewCardTrigger, pi as PreviewCardViewport, A as Progress, Bi as Radio, Vi as RadioGroup, Hi as RadioItem, en as ScrollArea, tn as ScrollAreaContent, nn as ScrollAreaCorner, rn as ScrollAreaScrollbar, an as ScrollAreaThumb, on as ScrollAreaViewport, $ as SearchField, Ce as SectionHeading, Ui as SegmentedControl, Wi as SegmentedControlItem, da as Select, fa as SelectGroupLabel, pa as SelectItem, ma as SelectItemIndicator, ha as SelectItemText, ga as SelectList, _a as SelectPopup, va as SelectPositioner, ya as SelectSeparator, ba as SelectTrigger, xa as SelectValue, we as Separator, j as Skeleton, Gi as Slider, N as Spinner, Ki as Switch, ft as TabBar, pt as TabBarIcon, mt as TabBarItem, ht as TabBarLabel, gt as TabBarLink, _t as TabBarList, Pn as Table, Fn as TableBody, In as TableCaption, Ln as TableCell, Rn as TableFooter, zn as TableFrame, Bn as TableHead, Vn as TableHeader, Hn as TableRow, yr as Tabs, br as TabsIndicator, xr as TabsList, Sr as TabsPanel, Cr as TabsRoot, wr as TabsTab, ee as TextField, te as TextView, ne as Textarea, l as Time, a as TimeField, o as TimePicker, B as ToastProvider, V as ToastRoot, H as ToastViewport, qi as Toggle, Ji as ToggleGroup, It as Toolbar, Lt as ToolbarButton, Rt as ToolbarGroup, zt as ToolbarInput, Bt as ToolbarLink, Vt as ToolbarSeparator, mi as Tooltip, hi as TooltipArrow, gi as TooltipPopup, _i as TooltipPortal, vi as TooltipPositioner, yi as TooltipProvider, bi as TooltipRoot, xi as TooltipTrigger, Si as TooltipViewport, u as ZonedDateTime, U as createToastManager, P as enUSMessages, d as getLocalTimeZone, z as getMessagesForLocale, 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, W 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,5 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/internal/class-names.ts
|
|
2
3
|
function e(...e) {
|
|
3
4
|
return e.filter(Boolean).join(" ");
|
|
4
5
|
}
|
|
@@ -9,6 +10,6 @@ function n(t, n) {
|
|
|
9
10
|
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
11
|
}
|
|
11
12
|
//#endregion
|
|
12
|
-
export { n as combineStateClassNames, e as cx, t as
|
|
13
|
+
export { n as combineStateClassNames, e as cx, t as withStateClassName };
|
|
13
14
|
|
|
14
|
-
//# sourceMappingURL=
|
|
15
|
+
//# 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,3 @@
|
|
|
1
|
+
export { LinyaoProvider, getMessagesForLocale, type LinyaoProviderProps } from './linyao-provider.js';
|
|
2
|
+
export { enUSMessages, zhTWMessages, type ComponentMessages } from './messages.js';
|
|
3
|
+
export { MessagesProvider, useMessages, type MessagesProviderProps } from './provider.js';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ComponentMessages } from './messages.js';
|
|
3
|
+
/**
|
|
4
|
+
* Picks the bundle that ships with the package for a BCP 47 tag. Only Traditional Chinese and
|
|
5
|
+
* English are built in; every other tag falls back to English, which is the bundle a reader of
|
|
6
|
+
* an unknown locale is most likely to understand. Pass `messages` to supply your own.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getMessagesForLocale(locale: string): ComponentMessages;
|
|
9
|
+
export interface LinyaoProviderProps {
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* BCP 47 locale. It selects the built-in message bundle *and* drives the date and time
|
|
13
|
+
* components' segment order, weekday names, numbering and default hour cycle, so the two
|
|
14
|
+
* cannot drift apart. Omit it to keep the Traditional Chinese default.
|
|
15
|
+
*/
|
|
16
|
+
locale?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Strings to use in place of the bundle the locale selected. Partial objects are merged over
|
|
19
|
+
* it, so this can translate a locale the package does not ship or correct a single string.
|
|
20
|
+
*/
|
|
21
|
+
messages?: Partial<ComponentMessages>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Wires both halves of the system's localisation from one place: the component strings that
|
|
25
|
+
* Base UI components fall back to, and the locale React Aria uses for dates and times. Set it
|
|
26
|
+
* once at the root of the application.
|
|
27
|
+
*
|
|
28
|
+
* ```tsx
|
|
29
|
+
* <LinyaoProvider locale="en-US">
|
|
30
|
+
* <App />
|
|
31
|
+
* </LinyaoProvider>
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* Writing direction is not part of this: `dir` belongs on the document alongside
|
|
35
|
+
* `data-lyds-theme`, because both have to be correct in the server-rendered markup before the
|
|
36
|
+
* first paint. Set `<html lang="ar" dir="rtl">` and the components' logical properties follow.
|
|
37
|
+
*/
|
|
38
|
+
export declare function LinyaoProvider({ children, locale, messages }: LinyaoProviderProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { enUSMessages as e, zhTWMessages as t } from "./messages.js";
|
|
3
|
+
import { MessagesProvider as n } from "./provider.js";
|
|
4
|
+
import { I18nProvider as r } from "react-aria-components/I18nProvider";
|
|
5
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
6
|
+
//#region src/intl/linyao-provider.tsx
|
|
7
|
+
function a(n) {
|
|
8
|
+
return /^zh\b/iu.test(n) ? t : e;
|
|
9
|
+
}
|
|
10
|
+
var o = {};
|
|
11
|
+
function s({ children: e, locale: t, messages: s = o }) {
|
|
12
|
+
let c = t === void 0 ? s : {
|
|
13
|
+
...a(t),
|
|
14
|
+
...s
|
|
15
|
+
}, l = /* @__PURE__ */ i(n, {
|
|
16
|
+
messages: c,
|
|
17
|
+
children: e
|
|
18
|
+
});
|
|
19
|
+
return t === void 0 ? l : /* @__PURE__ */ i(r, {
|
|
20
|
+
locale: t,
|
|
21
|
+
children: l
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { s as LinyaoProvider, a as getMessagesForLocale };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=linyao-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linyao-provider.js","names":[],"sources":["../../src/intl/linyao-provider.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { I18nProvider } from \"react-aria-components/I18nProvider\";\n\nimport { enUSMessages, zhTWMessages, type ComponentMessages } from \"./messages\";\nimport { MessagesProvider } from \"./provider\";\n\n/**\n * Picks the bundle that ships with the package for a BCP 47 tag. Only Traditional Chinese and\n * English are built in; every other tag falls back to English, which is the bundle a reader of\n * an unknown locale is most likely to understand. Pass `messages` to supply your own.\n */\nexport function getMessagesForLocale(locale: string): ComponentMessages {\n\treturn /^zh\\b/iu.test(locale) ? zhTWMessages : enUSMessages;\n}\n\nexport interface LinyaoProviderProps {\n\tchildren: ReactNode;\n\t/**\n\t * BCP 47 locale. It selects the built-in message bundle *and* drives the date and time\n\t * components' segment order, weekday names, numbering and default hour cycle, so the two\n\t * cannot drift apart. Omit it to keep the Traditional Chinese default.\n\t */\n\tlocale?: string;\n\t/**\n\t * Strings to use in place of the bundle the locale selected. Partial objects are merged over\n\t * it, so this can translate a locale the package does not ship or correct a single string.\n\t */\n\tmessages?: Partial<ComponentMessages>;\n}\n\nconst NO_OVERRIDES: Partial<ComponentMessages> = {};\n\n/**\n * Wires both halves of the system's localisation from one place: the component strings that\n * Base UI components fall back to, and the locale React Aria uses for dates and times. Set it\n * once at the root of the application.\n *\n * ```tsx\n * <LinyaoProvider locale=\"en-US\">\n * \t<App />\n * </LinyaoProvider>\n * ```\n *\n * Writing direction is not part of this: `dir` belongs on the document alongside\n * `data-lyds-theme`, because both have to be correct in the server-rendered markup before the\n * first paint. Set `<html lang=\"ar\" dir=\"rtl\">` and the components' logical properties follow.\n */\nexport function LinyaoProvider({ children, locale, messages = NO_OVERRIDES }: LinyaoProviderProps) {\n\tconst resolved = locale === undefined ? messages : { ...getMessagesForLocale(locale), ...messages };\n\tconst localised = <MessagesProvider messages={resolved}>{children}</MessagesProvider>;\n\n\treturn locale === undefined ? localised : <I18nProvider locale={locale}>{localised}</I18nProvider>;\n}\n"],"mappings":";;;;;;AAWA,SAAgB,EAAqB,GAAmC;CACvE,OAAO,UAAU,KAAK,CAAM,IAAI,IAAe;AAChD;AAiBA,IAAM,IAA2C,CAAC;AAiBlD,SAAgB,EAAe,EAAE,aAAU,WAAQ,cAAW,KAAqC;CAClG,IAAM,IAAW,MAAW,KAAA,IAAY,IAAW;EAAE,GAAG,EAAqB,CAAM;EAAG,GAAG;CAAS,GAC5F,IAAY,kBAAC,GAAD;EAAkB,UAAU;EAAW;CAA2B,CAAA;CAEpF,OAAO,MAAW,KAAA,IAAY,IAAY,kBAAC,GAAD;EAAsB;EAAS,UAAA;CAAwB,CAAA;AAClG"}
|
|
@@ -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,81 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/intl/messages.ts
|
|
3
|
+
var e = {
|
|
4
|
+
alertDialogClose: "取消並關閉警示",
|
|
5
|
+
autocompleteClear: "清除搜尋內容",
|
|
6
|
+
autocompleteEmpty: "找不到建議項目",
|
|
7
|
+
autocompleteTrigger: "顯示建議項目",
|
|
8
|
+
bottomSheetClose: "關閉底部面板",
|
|
9
|
+
breadcrumbLabel: "麵包屑導覽",
|
|
10
|
+
breadcrumbMore: "更多頁面",
|
|
11
|
+
comboboxClear: "清除選取",
|
|
12
|
+
comboboxEmpty: "找不到符合的選項",
|
|
13
|
+
comboboxTrigger: "顯示選項",
|
|
14
|
+
commandPaletteClose: "關閉",
|
|
15
|
+
commandPalettePlaceholder: "輸入指令…",
|
|
16
|
+
dialogClose: "關閉對話框",
|
|
17
|
+
drawerClose: "關閉側欄",
|
|
18
|
+
dropZoneBrowse: "選擇檔案",
|
|
19
|
+
dropZonePrimary: "將檔案拖曳至此",
|
|
20
|
+
dropZoneSecondary: "或從裝置選擇檔案",
|
|
21
|
+
fileSelectionLabel: "已選擇的檔案",
|
|
22
|
+
fileUploadInvalidFile: "不支援的檔案類型",
|
|
23
|
+
fileUploadTrigger: "選擇檔案",
|
|
24
|
+
headerNavLabel: "主要導覽",
|
|
25
|
+
linkOpensInNewWindow: "(在新視窗開啟)",
|
|
26
|
+
numberFieldDecrement: "減少數值",
|
|
27
|
+
numberFieldIncrement: "增加數值",
|
|
28
|
+
paginationLabel: "分頁導覽",
|
|
29
|
+
paginationMore: "更多頁面",
|
|
30
|
+
paginationNext: "下一頁",
|
|
31
|
+
paginationPrevious: "上一頁",
|
|
32
|
+
passwordFieldHide: "隱藏密碼",
|
|
33
|
+
passwordFieldShow: "顯示密碼",
|
|
34
|
+
popoverClose: "關閉彈出視窗",
|
|
35
|
+
selectPlaceholder: "請選擇",
|
|
36
|
+
tabBarLabel: "應用程式區段",
|
|
37
|
+
toastClose: "關閉通知",
|
|
38
|
+
codeSlotLabel: (e, t) => `第 ${e} 個字元,共 ${t} 個`,
|
|
39
|
+
fileSelectionSummary: (e) => `已選擇 ${e} 個檔案`
|
|
40
|
+
}, t = {
|
|
41
|
+
alertDialogClose: "Cancel and close alert",
|
|
42
|
+
autocompleteClear: "Clear search",
|
|
43
|
+
autocompleteEmpty: "No suggestions found",
|
|
44
|
+
autocompleteTrigger: "Show suggestions",
|
|
45
|
+
bottomSheetClose: "Close sheet",
|
|
46
|
+
breadcrumbLabel: "Breadcrumb",
|
|
47
|
+
breadcrumbMore: "More pages",
|
|
48
|
+
comboboxClear: "Clear selection",
|
|
49
|
+
comboboxEmpty: "No matching options",
|
|
50
|
+
comboboxTrigger: "Show options",
|
|
51
|
+
commandPaletteClose: "Close",
|
|
52
|
+
commandPalettePlaceholder: "Type a command…",
|
|
53
|
+
dialogClose: "Close dialog",
|
|
54
|
+
drawerClose: "Close drawer",
|
|
55
|
+
dropZoneBrowse: "Choose files",
|
|
56
|
+
dropZonePrimary: "Drop files here",
|
|
57
|
+
dropZoneSecondary: "or choose them from your device",
|
|
58
|
+
fileSelectionLabel: "Selected files",
|
|
59
|
+
fileUploadInvalidFile: "Unsupported file type",
|
|
60
|
+
fileUploadTrigger: "Choose files",
|
|
61
|
+
headerNavLabel: "Main",
|
|
62
|
+
linkOpensInNewWindow: "(opens in a new window)",
|
|
63
|
+
numberFieldDecrement: "Decrease value",
|
|
64
|
+
numberFieldIncrement: "Increase value",
|
|
65
|
+
paginationLabel: "Pagination",
|
|
66
|
+
paginationMore: "More pages",
|
|
67
|
+
paginationNext: "Next page",
|
|
68
|
+
paginationPrevious: "Previous page",
|
|
69
|
+
passwordFieldHide: "Hide password",
|
|
70
|
+
passwordFieldShow: "Show password",
|
|
71
|
+
popoverClose: "Close popover",
|
|
72
|
+
selectPlaceholder: "Select an option",
|
|
73
|
+
tabBarLabel: "Sections",
|
|
74
|
+
toastClose: "Close notification",
|
|
75
|
+
codeSlotLabel: (e, t) => `Character ${e} of ${t}`,
|
|
76
|
+
fileSelectionSummary: (e) => e === 1 ? "1 file selected" : `${e} files selected`
|
|
77
|
+
};
|
|
78
|
+
//#endregion
|
|
79
|
+
export { t as enUSMessages, e as zhTWMessages };
|
|
80
|
+
|
|
81
|
+
//# 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,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { zhTWMessages as e } from "./messages.js";
|
|
3
|
+
import { createContext as t, useContext as n, useState as r } from "react";
|
|
4
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
5
|
+
//#region src/intl/provider.tsx
|
|
6
|
+
var a = t(e);
|
|
7
|
+
function o(e, t) {
|
|
8
|
+
for (let n of Object.keys(t)) if (e[n] !== t[n]) return !1;
|
|
9
|
+
return !0;
|
|
10
|
+
}
|
|
11
|
+
function s(e, t) {
|
|
12
|
+
let n = {
|
|
13
|
+
...e,
|
|
14
|
+
...t
|
|
15
|
+
}, [i, a] = r(n);
|
|
16
|
+
return o(i, n) ? i : (a(n), n);
|
|
17
|
+
}
|
|
18
|
+
function c({ children: e, messages: t }) {
|
|
19
|
+
let r = s(n(a), t);
|
|
20
|
+
return /* @__PURE__ */ i(a, {
|
|
21
|
+
value: r,
|
|
22
|
+
children: e
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function l() {
|
|
26
|
+
return n(a);
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { c as MessagesProvider, l as useMessages };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.js","names":[],"sources":["../../src/intl/provider.tsx"],"sourcesContent":["import { createContext, useContext, useState, type ReactNode } from \"react\";\n\nimport { zhTWMessages, type ComponentMessages } from \"./messages\";\n\nconst MessagesContext = createContext<ComponentMessages>(zhTWMessages);\n\nfunction sameStrings(left: ComponentMessages, right: ComponentMessages): boolean {\n\tfor (const key of Object.keys(right) as Array<keyof ComponentMessages>) {\n\t\tif (left[key] !== right[key]) return false;\n\t}\n\n\treturn true;\n}\n\n/**\n * Call sites pass `messages` as an object literal, which is a new reference on every render, so\n * memoising on its identity would publish a new context value every time the provider renders and\n * re-render every component that reads a string. Comparing the merged result keeps the value\n * stable until a string actually changes; storing it in state rather than a ref is what lets the\n * comparison happen during render, which is React's documented way to adjust state from props.\n */\nfunction useStableMessages(inherited: ComponentMessages, overrides: Partial<ComponentMessages>): ComponentMessages {\n\tconst next = { ...inherited, ...overrides };\n\tconst [published, setPublished] = useState(next);\n\n\tif (!sameStrings(published, next)) {\n\t\tsetPublished(next);\n\t\treturn next;\n\t}\n\n\treturn published;\n}\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 value = useStableMessages(useContext(MessagesContext), 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;AAErE,SAAS,EAAY,GAAyB,GAAmC;CAChF,KAAK,IAAM,KAAO,OAAO,KAAK,CAAK,GAClC,IAAI,EAAK,OAAS,EAAM,IAAM,OAAO;CAGtC,OAAO;AACR;AASA,SAAS,EAAkB,GAA8B,GAA0D;CAClH,IAAM,IAAO;EAAE,GAAG;EAAW,GAAG;CAAU,GACpC,CAAC,GAAW,KAAgB,EAAS,CAAI;CAO/C,OALK,EAAY,GAAW,CAAI,IAKzB,KAJN,EAAa,CAAI,GACV;AAIT;AAgBA,SAAgB,EAAiB,EAAE,aAAU,eAAmC;CAC/E,IAAM,IAAQ,EAAkB,EAAW,CAAe,GAAG,CAAQ;CAErE,OAAO,kBAAC,GAAD;EAAwB;EAAQ;CAA0B,CAAA;AAClE;AAGA,SAAgB,IAAiC;CAChD,OAAO,EAAW,CAAe;AAClC"}
|