@santi020k/lumen-core 1.2.0 → 1.4.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 +29 -0
- package/dist/components.d.ts +17 -2
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +7 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/language.d.ts +12 -0
- package/dist/language.d.ts.map +1 -0
- package/dist/language.js +29 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,6 +12,35 @@ Cross-platform foundations originate in `tokens/lumen.tokens.json` and are publi
|
|
|
12
12
|
numeric spacing, radius, typography, duration, easing, and elevation values. The legacy
|
|
13
13
|
`lumenColors` export retains CSS-ready HSL values.
|
|
14
14
|
|
|
15
|
+
## Language Helpers
|
|
16
|
+
|
|
17
|
+
The root entry exports the shared locale contract used by the Astro, React, and Elements language
|
|
18
|
+
controls. `normalizeLumenLocales` trims labels and values, removes duplicate or invalid values, and
|
|
19
|
+
falls back to `lumenDefaultLocales`. `getLumenLocalePair` resolves the current locale and the next
|
|
20
|
+
cyclic option, while `formatLumenLanguageLabel` fills the `{current}` and `{next}` placeholders in
|
|
21
|
+
an accessible-label template.
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import {
|
|
25
|
+
formatLumenLanguageLabel,
|
|
26
|
+
getLumenLocalePair,
|
|
27
|
+
type LumenLocaleOption,
|
|
28
|
+
normalizeLumenLocales
|
|
29
|
+
} from '@santi020k/lumen-core'
|
|
30
|
+
|
|
31
|
+
const locales: readonly LumenLocaleOption[] = normalizeLumenLocales([
|
|
32
|
+
{ label: 'English', value: 'en' },
|
|
33
|
+
{ label: 'Español', value: 'es' }
|
|
34
|
+
])
|
|
35
|
+
|
|
36
|
+
const { current, next } = getLumenLocalePair(locales, 'en')
|
|
37
|
+
const label = formatLumenLanguageLabel(
|
|
38
|
+
'Change language from {current} to {next}',
|
|
39
|
+
current,
|
|
40
|
+
next
|
|
41
|
+
)
|
|
42
|
+
```
|
|
43
|
+
|
|
15
44
|
## Chart Helpers
|
|
16
45
|
|
|
17
46
|
`@santi020k/lumen-core/charts` exports the shared `LumenChartSeries` contract plus deterministic
|
package/dist/components.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const lumenComponentNames: readonly ["Accordion", "Alert", "AlertDialog", "Agenda", "AspectRatio", "Attachment", "Autocomplete", "Avatar", "BackToTop", "Badge", "BarChart", "Breadcrumb", "Bubble", "Button", "ButtonGroup", "Calendar", "Callout", "Card", "CardContent", "CardDescription", "CardFooter", "CardHeader", "CardTitle", "Carousel", "Chart", "Checkbox", "CheckboxGroup", "Collapsible", "Code", "CodeTabs", "Combobox", "Container", "CopyButton", "Command", "ContextNavigation", "ContextMenu", "ColorPicker", "DataTable", "DatePicker", "DateRangePicker", "Dialog", "Direction", "Drawer", "DropdownMenu", "Empty", "ErrorSummary", "Eyebrow", "Field", "FieldError", "FloatingBadge", "Form", "FormattedDate", "HoverCard", "Icon", "Image", "Input", "InputGroup", "InputOTP", "Item", "KanbanBoard", "KanbanColumn", "Kbd", "Label", "Link", "LineChart", "ListBox", "Marker", "Menubar", "Message", "MessageScroller", "NativeSelect", "NavigationMenu", "NumberField", "Pagination", "PasswordField", "PhoneInput", "PieChart", "Pill", "Popover", "Progress", "Prose", "RadioGroup", "Resizable", "RichTextEditor", "ScrollArea", "ScrollProgress", "Schedule", "SearchField", "Select", "Separator", "Sheet", "Sidebar", "Skeleton", "SkipLink", "Slider", "Sonner", "Sparkline", "Spinner", "Switch", "Table", "Tabs", "TagGroup", "Textarea", "ThemeBuilder", "ThemeToggle", "TimeField", "Toast", "Toggle", "ToggleGroup", "Tooltip", "Tree", "TreeGrid", "Typography", "VirtualList", "LanguageToggle", "Particles", "AnimatedNumber", "RevealGroup", "ScrollReveal", "Stat", "StatDescription", "StatIcon", "StatLabel", "StatTrend", "StatValue", "Stack", "Meter", "Note", "Rating", "Timeline", "AnimatedLogo", "AnimatedPortrait", "ButtonLink", "CoverImage", "GradientDivider", "Stepper", "FileUpload", "Tour", "Anchor", "Segmented", "Toolbar", "Descriptions", "Popconfirm", "Transfer", "Cascader", "TreeSelect", "Mentions", "QRCode", "Watermark", "Affix", "SpeedDial", "Grid", "VisuallyHidden"];
|
|
1
|
+
export declare const lumenComponentNames: readonly ["Accordion", "Alert", "AlertDialog", "Agenda", "AspectRatio", "Attachment", "Autocomplete", "Avatar", "Backdrop", "BackToTop", "Badge", "BarChart", "Breadcrumb", "Bubble", "Button", "ButtonGroup", "Calendar", "Callout", "Card", "CardContent", "CardDescription", "CardFooter", "CardHeader", "CardTitle", "Carousel", "Chart", "Checkbox", "CheckboxGroup", "Collapsible", "Code", "CodeTabs", "Combobox", "Container", "CopyButton", "Command", "ContextNavigation", "ContextMenu", "ColorPicker", "DataTable", "DatePicker", "DateRangePicker", "Dialog", "Direction", "Drawer", "DropdownMenu", "Empty", "ErrorSummary", "Eyebrow", "Field", "FieldError", "FloatingBadge", "Form", "FormattedDate", "Graphic", "HoverCard", "Icon", "Image", "Illustration", "Input", "InputGroup", "InputOTP", "Item", "KanbanBoard", "KanbanColumn", "Kbd", "Label", "Link", "LineChart", "ListBox", "Marker", "Menubar", "Message", "MessageScroller", "NativeSelect", "NavigationMenu", "NumberField", "Pagination", "PasswordField", "PhoneInput", "PieChart", "Pill", "Popover", "Progress", "Prose", "RadioGroup", "Resizable", "RichTextEditor", "ScrollArea", "ScrollProgress", "Schedule", "SearchField", "Select", "Separator", "Sheet", "Sidebar", "Skeleton", "SkipLink", "Slider", "Sonner", "Sparkline", "Spinner", "Switch", "Table", "Tabs", "TagGroup", "Textarea", "ThemeBuilder", "ThemeToggle", "TimeField", "Toast", "Toggle", "ToggleGroup", "Tooltip", "Tree", "TreeGrid", "Typography", "VirtualList", "LanguageToggle", "Particles", "AnimatedNumber", "RevealGroup", "ScrollReveal", "Stat", "StatDescription", "StatIcon", "StatLabel", "StatTrend", "StatValue", "Stack", "Meter", "Note", "Rating", "Timeline", "AnimatedLogo", "AnimatedPortrait", "ButtonLink", "CoverImage", "GradientDivider", "Stepper", "FileUpload", "Tour", "Anchor", "Segmented", "Toolbar", "Descriptions", "Popconfirm", "Transfer", "Cascader", "TreeSelect", "Mentions", "QRCode", "Watermark", "Affix", "SpeedDial", "Grid", "VisuallyHidden"];
|
|
2
2
|
export type LumenComponentName = typeof lumenComponentNames[number];
|
|
3
3
|
export interface LumenComponentBehavior {
|
|
4
4
|
astro: 'none' | 'ui-primitives';
|
|
@@ -72,6 +72,11 @@ export declare const lumenComponentBehavior: {
|
|
|
72
72
|
readonly elements: "registered-element";
|
|
73
73
|
readonly react: "component";
|
|
74
74
|
};
|
|
75
|
+
readonly Backdrop: {
|
|
76
|
+
readonly astro: "none";
|
|
77
|
+
readonly elements: "registered-element";
|
|
78
|
+
readonly react: "component";
|
|
79
|
+
};
|
|
75
80
|
readonly BackToTop: {
|
|
76
81
|
readonly astro: "none";
|
|
77
82
|
readonly elements: "registered-element";
|
|
@@ -317,6 +322,11 @@ export declare const lumenComponentBehavior: {
|
|
|
317
322
|
readonly elements: "registered-element";
|
|
318
323
|
readonly react: "component";
|
|
319
324
|
};
|
|
325
|
+
readonly Graphic: {
|
|
326
|
+
readonly astro: "none";
|
|
327
|
+
readonly elements: "registered-element";
|
|
328
|
+
readonly react: "component";
|
|
329
|
+
};
|
|
320
330
|
readonly GradientDivider: {
|
|
321
331
|
readonly astro: "none";
|
|
322
332
|
readonly elements: "registered-element";
|
|
@@ -342,6 +352,11 @@ export declare const lumenComponentBehavior: {
|
|
|
342
352
|
readonly elements: "registered-element";
|
|
343
353
|
readonly react: "component";
|
|
344
354
|
};
|
|
355
|
+
readonly Illustration: {
|
|
356
|
+
readonly astro: "none";
|
|
357
|
+
readonly elements: "registered-element";
|
|
358
|
+
readonly react: "component";
|
|
359
|
+
};
|
|
345
360
|
readonly Input: {
|
|
346
361
|
readonly astro: "none";
|
|
347
362
|
readonly elements: "registered-element";
|
|
@@ -383,7 +398,7 @@ export declare const lumenComponentBehavior: {
|
|
|
383
398
|
readonly react: "component";
|
|
384
399
|
};
|
|
385
400
|
readonly LanguageToggle: {
|
|
386
|
-
readonly astro: "
|
|
401
|
+
readonly astro: "ui-primitives";
|
|
387
402
|
readonly elements: "registered-element";
|
|
388
403
|
readonly react: "component";
|
|
389
404
|
};
|
package/dist/components.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,+7DA6JtB,CAAA;AAEV,MAAM,MAAM,kBAAkB,GAAG,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAA;AAEnE,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,GAAG,eAAe,CAAA;IAC/B,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,EAAE,MAAM,GAAG,oBAAoB,CAAA;IACvC,KAAK,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,CAAA;CACrC;AAED,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,OAAO,GACd,SAAS,GACT,MAAM,GACN,UAAU,GACV,OAAO,GACP,OAAO,GACP,cAAc,GACd,OAAO,GACP,QAAQ,GACR,UAAU,CAAA;CACb;AAED,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BwB,CAAA"}
|
package/dist/components.js
CHANGED
|
@@ -7,6 +7,7 @@ export const lumenComponentNames = [
|
|
|
7
7
|
'Attachment',
|
|
8
8
|
'Autocomplete',
|
|
9
9
|
'Avatar',
|
|
10
|
+
'Backdrop',
|
|
10
11
|
'BackToTop',
|
|
11
12
|
'Badge',
|
|
12
13
|
'BarChart',
|
|
@@ -51,9 +52,11 @@ export const lumenComponentNames = [
|
|
|
51
52
|
'FloatingBadge',
|
|
52
53
|
'Form',
|
|
53
54
|
'FormattedDate',
|
|
55
|
+
'Graphic',
|
|
54
56
|
'HoverCard',
|
|
55
57
|
'Icon',
|
|
56
58
|
'Image',
|
|
59
|
+
'Illustration',
|
|
57
60
|
'Input',
|
|
58
61
|
'InputGroup',
|
|
59
62
|
'InputOTP',
|
|
@@ -167,6 +170,7 @@ export const lumenComponentBehavior = {
|
|
|
167
170
|
Attachment: { astro: 'none', elements: 'registered-element', react: 'component' },
|
|
168
171
|
Autocomplete: { astro: 'none', elements: 'registered-element', react: 'component' },
|
|
169
172
|
Avatar: { astro: 'none', elements: 'registered-element', react: 'component' },
|
|
173
|
+
Backdrop: { astro: 'none', elements: 'registered-element', react: 'component' },
|
|
170
174
|
BackToTop: { astro: 'none', elements: 'registered-element', react: 'component' },
|
|
171
175
|
Badge: { astro: 'none', elements: 'registered-element', react: 'component' },
|
|
172
176
|
BarChart: { astro: 'none', elements: 'registered-element', react: 'component' },
|
|
@@ -216,11 +220,13 @@ export const lumenComponentBehavior = {
|
|
|
216
220
|
FloatingBadge: { astro: 'none', elements: 'registered-element', react: 'component' },
|
|
217
221
|
Form: { astro: 'ui-primitives', elements: 'none', react: 'hook' },
|
|
218
222
|
FormattedDate: { astro: 'none', elements: 'registered-element', react: 'component' },
|
|
223
|
+
Graphic: { astro: 'none', elements: 'registered-element', react: 'component' },
|
|
219
224
|
GradientDivider: { astro: 'none', elements: 'registered-element', react: 'component' },
|
|
220
225
|
Grid: { astro: 'none', elements: 'registered-element', react: 'component' },
|
|
221
226
|
HoverCard: { astro: 'ui-primitives', elements: 'registered-element', react: 'hook' },
|
|
222
227
|
Icon: { astro: 'none', elements: 'registered-element', react: 'component' },
|
|
223
228
|
Image: { astro: 'none', elements: 'registered-element', react: 'component' },
|
|
229
|
+
Illustration: { astro: 'none', elements: 'registered-element', react: 'component' },
|
|
224
230
|
Input: { astro: 'none', elements: 'registered-element', react: 'component' },
|
|
225
231
|
InputGroup: { astro: 'none', elements: 'registered-element', react: 'component' },
|
|
226
232
|
InputOTP: { astro: 'ui-primitives', elements: 'registered-element', react: 'hook' },
|
|
@@ -229,7 +235,7 @@ export const lumenComponentBehavior = {
|
|
|
229
235
|
KanbanColumn: { astro: 'none', elements: 'registered-element', react: 'component' },
|
|
230
236
|
Kbd: { astro: 'none', elements: 'registered-element', react: 'component' },
|
|
231
237
|
Label: { astro: 'none', elements: 'registered-element', react: 'component' },
|
|
232
|
-
LanguageToggle: { astro: '
|
|
238
|
+
LanguageToggle: { astro: 'ui-primitives', elements: 'registered-element', react: 'component' },
|
|
233
239
|
LineChart: { astro: 'none', elements: 'registered-element', react: 'component' },
|
|
234
240
|
Link: { astro: 'none', elements: 'registered-element', react: 'component' },
|
|
235
241
|
ListBox: { astro: 'ui-primitives', elements: 'registered-element', react: 'hook' },
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { createFigmaVariableName, exportThemeDesignTokens, exportThemeFigmaVaria
|
|
|
6
6
|
export { createLumenFormFailure, createLumenFormSuccess, getLumenFieldErrors, type LumenFieldError, type LumenFormErrorInput, type LumenFormErrors, type LumenFormFailure, type LumenFormResult, type LumenFormStatus, lumenFormStatuses, type LumenFormSuccess, normalizeLumenFormErrors } from './forms.js';
|
|
7
7
|
export { getLumenIcon, getLumenIconPack, getRegisteredLumenIconNames, type LumenIconData, type LumenIconName, lumenIconNames, type LumenIconNode, type LumenIconPack, lumenIcons, type LumenIconStyle, registerLumenIconPack, renderLumenIconSvg, resolveLumenIconName } from './icons.js';
|
|
8
8
|
export { createLumenKanbanMoveDetail, getAdjacentKanbanColumn, type LumenKanbanMoveDetail, type LumenKanbanMoveInput } from './kanban.js';
|
|
9
|
+
export { formatLumenLanguageLabel, getLumenLocalePair, lumenDefaultLocales, type LumenLocaleOption, normalizeLumenLocales } from './language.js';
|
|
9
10
|
export { type LumenAstroPropsResult, type LumenClassValue, type LumenGlass, resolveLumenAstroProps, resolveLumenGlass } from './props.js';
|
|
10
11
|
export { getLumenRichTextShortcut, isLumenRichTextToggleCommand, type LumenRichTextChangeDetail, type LumenRichTextCommandDetail, type LumenRichTextShortcutEvent, type LumenRichTextToggleCommand, lumenRichTextToggleCommands } from './rich-text.js';
|
|
11
12
|
export { canPlaceScheduleEvent, createScheduleSlots, createScheduleStorageKey, expandRecurringScheduleEvent, getScheduleConflicts, loadScheduleEvents, type LumenScheduleConflict, type LumenScheduleEvent, type LumenScheduleKeyValueReader, type LumenScheduleKeyValueStorage, type LumenScheduleKeyValueWriter, type LumenScheduleResizeEdge, type LumenScheduleResizeOptions, type LumenScheduleResource, type LumenScheduleSlot, moveScheduleEvent, parseScheduleEvents, resizeScheduleEvent, resizeScheduleEvents, saveScheduleEvents, scheduleEventsOverlap, serializeScheduleEvents } from './schedule.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,E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BAAuB,EAC5B,wBAAwB,EACxB,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,KAAK,gBAAgB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,cAAc,EACd,YAAY,EACZ,cAAc,EACd,SAAS,EACT,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,WAAW,EACX,UAAU,EACV,WAAW,EACX,KAAK,kBAAkB,EACvB,WAAW,EACX,YAAY,EACZ,mBAAmB,EACpB,MAAM,aAAa,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,EAC1B,uBAAuB,EACvB,gCAAgC,EAChC,iBAAiB,EACjB,eAAe,EACf,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,eAAe,EACf,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,KAAK,cAAc,EACnB,wBAAwB,EACxB,KAAK,kBAAkB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,WAAW,CAAA;AAClB,OAAO,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AwB,EAC7B,yBAAyB,EACzB,KAAK,yBAAyB,EAC9B,0BAA0B,EAC1B,KAAK,mBAAmB,EACxB,oBAAoB,EACpB,KAAK,oBAAoB,EACzB,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,qBAAqB,EACrB,KAAK,2BAA2B,EAChC,4BAA4B,EAC5B,KAAK,oBAAoB,EACzB,qBAAqB,EACrB,KAAK,uBAAuB,EAC5B,wBAAwB,EACxB,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,eAAe,EACf,KAAK,wBAAwB,EAC7B,yBAAyB,EACzB,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,8BAA8B,EAC9B,sBAAsB,EACtB,wBAAwB,EACxB,wBAAwB,EACxB,qBAAqB,EACrB,uBAAuB,EACvB,KAAK,6BAA6B,EAClC,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,wBAAwB,EACxB,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,KAAK,gBAAgB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,cAAc,EACd,YAAY,EACZ,cAAc,EACd,SAAS,EACT,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,WAAW,EACX,UAAU,EACV,WAAW,EACX,KAAK,kBAAkB,EACvB,WAAW,EACX,YAAY,EACZ,mBAAmB,EACpB,MAAM,aAAa,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export { createFigmaVariableName, exportThemeDesignTokens, exportThemeFigmaVaria
|
|
|
6
6
|
export { createLumenFormFailure, createLumenFormSuccess, getLumenFieldErrors, lumenFormStatuses, normalizeLumenFormErrors } from './forms.js';
|
|
7
7
|
export { getLumenIcon, getLumenIconPack, getRegisteredLumenIconNames, lumenIconNames, lumenIcons, registerLumenIconPack, renderLumenIconSvg, resolveLumenIconName } from './icons.js';
|
|
8
8
|
export { createLumenKanbanMoveDetail, getAdjacentKanbanColumn } from './kanban.js';
|
|
9
|
+
export { formatLumenLanguageLabel, getLumenLocalePair, lumenDefaultLocales, normalizeLumenLocales } from './language.js';
|
|
9
10
|
export { resolveLumenAstroProps, resolveLumenGlass } from './props.js';
|
|
10
11
|
export { getLumenRichTextShortcut, isLumenRichTextToggleCommand, lumenRichTextToggleCommands } from './rich-text.js';
|
|
11
12
|
export { canPlaceScheduleEvent, createScheduleSlots, createScheduleStorageKey, expandRecurringScheduleEvent, getScheduleConflicts, loadScheduleEvents, moveScheduleEvent, parseScheduleEvents, resizeScheduleEvent, resizeScheduleEvents, saveScheduleEvents, scheduleEventsOverlap, serializeScheduleEvents } from './schedule.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface LumenLocaleOption {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const lumenDefaultLocales: readonly LumenLocaleOption[];
|
|
6
|
+
export declare const normalizeLumenLocales: (locales: readonly LumenLocaleOption[] | undefined) => readonly LumenLocaleOption[];
|
|
7
|
+
export declare const getLumenLocalePair: (locales: readonly LumenLocaleOption[], value: string | undefined) => {
|
|
8
|
+
current: LumenLocaleOption;
|
|
9
|
+
next: LumenLocaleOption;
|
|
10
|
+
};
|
|
11
|
+
export declare const formatLumenLanguageLabel: (template: string, current: LumenLocaleOption, next: LumenLocaleOption) => string;
|
|
12
|
+
//# sourceMappingURL=language.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language.d.ts","sourceRoot":"","sources":["../src/language.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd;AAID,eAAO,MAAM,mBAAmB,EAAE,SAAS,iBAAiB,EAG3D,CAAA;AAED,eAAO,MAAM,qBAAqB,GAChC,SAAS,SAAS,iBAAiB,EAAE,GAAG,SAAS,KAChD,SAAS,iBAAiB,EAkB5B,CAAA;AAED,eAAO,MAAM,kBAAkB,GAC7B,SAAS,SAAS,iBAAiB,EAAE,EACrC,OAAO,MAAM,GAAG,SAAS,KACxB;IAAE,OAAO,EAAE,iBAAiB,CAAC;IAAC,IAAI,EAAE,iBAAiB,CAAA;CAMvD,CAAA;AAED,eAAO,MAAM,wBAAwB,GACnC,UAAU,MAAM,EAChB,SAAS,iBAAiB,EAC1B,MAAM,iBAAiB,KACtB,MAEgC,CAAA"}
|
package/dist/language.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const lumenDefaultLocale = { label: 'English', value: 'en' };
|
|
2
|
+
export const lumenDefaultLocales = [
|
|
3
|
+
lumenDefaultLocale,
|
|
4
|
+
{ label: 'Español', value: 'es' }
|
|
5
|
+
];
|
|
6
|
+
export const normalizeLumenLocales = (locales) => {
|
|
7
|
+
if (!locales?.length)
|
|
8
|
+
return lumenDefaultLocales;
|
|
9
|
+
const normalized = [];
|
|
10
|
+
const values = new Set();
|
|
11
|
+
for (const locale of locales) {
|
|
12
|
+
const label = locale.label.trim();
|
|
13
|
+
const value = locale.value.trim();
|
|
14
|
+
if (!label || !value || values.has(value))
|
|
15
|
+
continue;
|
|
16
|
+
normalized.push({ label, value });
|
|
17
|
+
values.add(value);
|
|
18
|
+
}
|
|
19
|
+
return normalized.length > 0 ? normalized : lumenDefaultLocales;
|
|
20
|
+
};
|
|
21
|
+
export const getLumenLocalePair = (locales, value) => {
|
|
22
|
+
const currentIndex = Math.max(0, locales.findIndex(locale => locale.value === value));
|
|
23
|
+
const current = locales[currentIndex] ?? lumenDefaultLocale;
|
|
24
|
+
const next = locales[(currentIndex + 1) % locales.length] ?? current;
|
|
25
|
+
return { current, next };
|
|
26
|
+
};
|
|
27
|
+
export const formatLumenLanguageLabel = (template, current, next) => template
|
|
28
|
+
.replaceAll('{current}', current.label)
|
|
29
|
+
.replaceAll('{next}', next.label);
|