@rokkit/core 1.0.0-next.15 → 1.0.0-next.151

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.
Files changed (93) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +121 -1
  3. package/dist/calendar.d.ts +10 -0
  4. package/dist/colors/index.d.ts +47 -0
  5. package/dist/connector.d.ts +8 -0
  6. package/dist/constants.d.ts +80 -0
  7. package/dist/events.d.ts +12 -0
  8. package/dist/field-mapper.d.ts +60 -0
  9. package/dist/index.d.ts +13 -0
  10. package/dist/key-event-map.d.ts +18 -0
  11. package/dist/mapped-items.d.ts +14 -0
  12. package/dist/mapping.d.ts +14 -0
  13. package/dist/nested.d.ts +9 -0
  14. package/dist/string.d.ts +59 -0
  15. package/dist/theme.d.ts +96 -0
  16. package/dist/ticks.d.ts +10 -0
  17. package/dist/types.d.ts +300 -0
  18. package/dist/utils.d.ts +104 -0
  19. package/dist/vite/icon-collections.d.ts +32 -0
  20. package/dist/vite/index.d.ts +1 -0
  21. package/package.json +31 -39
  22. package/src/calendar.js +44 -0
  23. package/src/colors/extra.json +16 -0
  24. package/src/colors/index.ts +24 -0
  25. package/src/colors/syntax.json +42 -0
  26. package/src/colors/tailwind.json +275 -0
  27. package/src/connector.js +34 -0
  28. package/src/constants.js +163 -107
  29. package/src/events.js +32 -0
  30. package/src/field-mapper.js +147 -0
  31. package/src/index.js +19 -27
  32. package/src/key-event-map.js +35 -0
  33. package/src/mapped-items.js +22 -0
  34. package/src/mapping.js +21 -0
  35. package/src/nested.js +28 -0
  36. package/src/string.js +97 -0
  37. package/src/theme.ts +208 -0
  38. package/src/ticks.js +26 -0
  39. package/src/types.js +160 -0
  40. package/src/utils.js +272 -0
  41. package/src/vite/icon-collections.js +73 -0
  42. package/src/vite/index.js +1 -0
  43. package/src/Accordion.svelte +0 -80
  44. package/src/Alerts.svelte +0 -39
  45. package/src/DropDown.svelte +0 -82
  46. package/src/DropSearch.svelte +0 -67
  47. package/src/EditableTabs.svelte +0 -31
  48. package/src/Icon.svelte +0 -15
  49. package/src/List-Discard.svelte +0 -48
  50. package/src/List.svelte +0 -65
  51. package/src/ListActions.svelte +0 -35
  52. package/src/NavTabs.svelte +0 -0
  53. package/src/NestedList.svelte +0 -77
  54. package/src/Overlay.svelte +0 -4
  55. package/src/PageNavigator.svelte +0 -94
  56. package/src/ResponsiveGrid.svelte +0 -73
  57. package/src/Scrollable.svelte +0 -8
  58. package/src/Searchable.svelte +0 -19
  59. package/src/Sidebar.svelte +0 -5
  60. package/src/Slider.svelte +0 -17
  61. package/src/SpinList.svelte +0 -48
  62. package/src/SplitPane.svelte +0 -109
  63. package/src/SplitView.svelte +0 -44
  64. package/src/Splitter.svelte +0 -95
  65. package/src/TabItem.svelte +0 -27
  66. package/src/TabItems.svelte +0 -34
  67. package/src/Tabs.svelte +0 -49
  68. package/src/Tree.svelte +0 -45
  69. package/src/actions/dismissable.js +0 -24
  70. package/src/actions/fillable.js +0 -114
  71. package/src/actions/hierarchy.js +0 -180
  72. package/src/actions/index.js +0 -7
  73. package/src/actions/navigable.js +0 -43
  74. package/src/actions/navigator.js +0 -179
  75. package/src/actions/pannable.js +0 -50
  76. package/src/actions/swipeable.js +0 -56
  77. package/src/actions/themeable.js +0 -23
  78. package/src/items/Collapsible.svelte +0 -51
  79. package/src/items/Connector.svelte +0 -26
  80. package/src/items/Link.svelte +0 -18
  81. package/src/items/Node.svelte +0 -52
  82. package/src/items/Pill.svelte +0 -33
  83. package/src/items/Separator.svelte +0 -1
  84. package/src/items/Summary.svelte +0 -27
  85. package/src/items/Text.svelte +0 -21
  86. package/src/items/index.js +0 -8
  87. package/src/list.js +0 -14
  88. package/src/mocks/Custom.svelte +0 -7
  89. package/src/mocks/index.js +0 -10
  90. package/src/stores/alerts.js +0 -3
  91. package/src/stores/index.js +0 -6
  92. package/src/stores/persist.js +0 -63
  93. package/src/stores/theme.js +0 -34
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2022 Jerry Thomas
3
+ Copyright (c) 2025 Jerry Thomas
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1 +1,121 @@
1
- # Core Components
1
+ # @rokkit/core
2
+
3
+ Core utilities for the Rokkit design system — field mapping, constants, calendar, color palette, and event utilities.
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ npm install @rokkit/core
9
+ # or
10
+ bun add @rokkit/core
11
+ ```
12
+
13
+ ## Overview
14
+
15
+ `@rokkit/core` is the foundation layer shared across all Rokkit packages. It provides:
16
+
17
+ - **Field mapping** — map arbitrary data object shapes to semantic field names
18
+ - **Constants** — `BASE_FIELDS`, `DEFAULT_STATE_ICONS`, `DEFAULT_KEYMAP`, and more
19
+ - **Color palette** — default colors, shades, and theme color mapping
20
+ - **Calendar utilities** — calendar day generation and weekday labels
21
+ - **Event utilities** — lightweight emitter factory
22
+ - **Direction detection** — RTL/LTR helpers
23
+ - **Tick generation** — axis tick utilities for chart packages
24
+
25
+ No runtime dependencies on other `@rokkit/*` packages.
26
+
27
+ ## Usage
28
+
29
+ ### Field mapping
30
+
31
+ `FieldMapper` maps semantic field names (`label`, `value`, `icon`, etc.) to the actual keys present in your data objects. Pass a fields override to adapt any data shape.
32
+
33
+ ```js
34
+ import { FieldMapper } from '@rokkit/core'
35
+
36
+ const mapper = new FieldMapper({ label: 'name', value: 'id', icon: 'iconClass' })
37
+
38
+ const item = { id: 42, name: 'Settings', iconClass: 'i-settings' }
39
+
40
+ mapper.get('label', item) // 'Settings'
41
+ mapper.get('value', item) // 42
42
+ mapper.get('icon', item) // 'i-settings'
43
+ ```
44
+
45
+ ### normalizeFields
46
+
47
+ Merge user-supplied field overrides with `BASE_FIELDS` defaults, remapping any legacy key names automatically.
48
+
49
+ ```js
50
+ import { normalizeFields, BASE_FIELDS } from '@rokkit/core'
51
+
52
+ const fields = normalizeFields({ label: 'title', value: 'slug' })
53
+ // { label: 'title', value: 'slug', icon: 'icon', children: 'children', ... }
54
+ ```
55
+
56
+ ### BASE_FIELDS reference
57
+
58
+ ```js
59
+ import { BASE_FIELDS } from '@rokkit/core'
60
+
61
+ // {
62
+ // id: 'id', value: 'value', label: 'label',
63
+ // icon: 'icon', avatar: 'image', subtext: 'description',
64
+ // tooltip: 'title', badge: 'badge', shortcut: 'shortcut',
65
+ // children: 'children', type: 'type', snippet: 'snippet',
66
+ // href: 'href', hrefTarget: 'target',
67
+ // disabled: 'disabled', expanded: 'expanded', selected: 'selected'
68
+ // }
69
+ ```
70
+
71
+ ### Event emitter
72
+
73
+ ```js
74
+ import { createEmitter } from '@rokkit/core'
75
+
76
+ const emitter = createEmitter()
77
+ emitter.on('select', (item) => console.log('selected', item))
78
+ emitter.emit('select', myItem)
79
+ ```
80
+
81
+ ### Calendar utilities
82
+
83
+ ```js
84
+ import { getCalendarDays, weekdays } from '@rokkit/core'
85
+
86
+ const days = getCalendarDays(2025, 2) // February 2025
87
+ // weekdays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
88
+ ```
89
+
90
+ ### Tick generation
91
+
92
+ ```js
93
+ import { generateTicks } from '@rokkit/core'
94
+
95
+ const ticks = generateTicks(0, 100, 5)
96
+ // [0, 25, 50, 75, 100]
97
+ ```
98
+
99
+ ## API
100
+
101
+ | Export | Description |
102
+ | -------------------------------- | ------------------------------------------------------------- |
103
+ | `BASE_FIELDS` | Canonical semantic-to-data-key field mapping |
104
+ | `normalizeFields(fields)` | Merge overrides with BASE_FIELDS defaults |
105
+ | `FieldMapper` | Class that resolves semantic field reads from data objects |
106
+ | `DEFAULT_STATE_ICONS` | Icon name map grouped by category (action, state, sort, etc.) |
107
+ | `DEFAULT_KEYMAP` | Default keyboard navigation key mapping |
108
+ | `DEFAULT_THEME_MAPPING` | Default semantic color → palette color mapping |
109
+ | `createEmitter()` | Lightweight event emitter factory |
110
+ | `getCalendarDays(year, month)` | Calendar day array for a given month |
111
+ | `weekdays` | Localized weekday label array |
112
+ | `generateTicks(min, max, count)` | Evenly spaced axis tick values |
113
+ | `defaultColors` | Default color palette array |
114
+ | `shades` | Available shade scale values |
115
+ | `ITEM_SNIPPET` | Constant: default item snippet key (`'itemContent'`) |
116
+ | `GROUP_SNIPPET` | Constant: default group snippet key (`'groupContent'`) |
117
+ | `stateIconsFromNames(names)` | Build a state icon map from an array of icon name strings |
118
+
119
+ ---
120
+
121
+ Part of [Rokkit](https://github.com/jerrythomas/rokkit) — a Svelte 5 component library and design system.
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Get the days in the month.
3
+ *
4
+ * @param {Date} value
5
+ * @param {Array} holidays
6
+ * @param {boolean} fixed
7
+ * @returns {import('./types').CalendarDay[]}
8
+ */
9
+ export function getCalendarDays(value: Date, holidays?: any[], fixed?: boolean): import("./types").CalendarDay[];
10
+ export const weekdays: string[];
@@ -0,0 +1,47 @@
1
+ import type { PresetMiniColors } from '@unocss/preset-mini/colors';
2
+ import extraColors from './extra.json';
3
+ export declare const shades: number[];
4
+ export declare const defaultPalette: string[];
5
+ export declare const syntaxColors: {
6
+ "one-dark": {
7
+ dark: {
8
+ "--tab-size": string;
9
+ "--code-fill": string;
10
+ "--code-normal": string;
11
+ "--code-string": string;
12
+ "--code-number": string;
13
+ "--code-atrule": string;
14
+ "--code-keyword": string;
15
+ "--code-comment": string;
16
+ "--code-property": string;
17
+ "--code-selector": string;
18
+ "--code-operator": string;
19
+ "--code-function": string;
20
+ "--code-gutter-marker": string;
21
+ "--code-gutter-z2": string;
22
+ "--code-cursor": string;
23
+ "--code-cursor-block": string;
24
+ "--code-linenumbers": string;
25
+ };
26
+ light: {
27
+ "--tab-size": string;
28
+ "--code-fill": string;
29
+ "--code-normal": string;
30
+ "--code-string": string;
31
+ "--code-number": string;
32
+ "--code-atrule": string;
33
+ "--code-keyword": string;
34
+ "--code-comment": string;
35
+ "--code-property": string;
36
+ "--code-selector": string;
37
+ "--code-operator": string;
38
+ "--code-function": string;
39
+ "--code-gutter-marker": string;
40
+ "--code-gutter-z2": string;
41
+ "--code-cursor": string;
42
+ "--code-cursor-block": string;
43
+ "--code-linenumbers": string;
44
+ };
45
+ };
46
+ };
47
+ export declare const defaultColors: PresetMiniColors & typeof extraColors;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Constructs an array of line types for tree visualization
3
+ * @param {boolean} hasChildren - Whether the node has children
4
+ * @param {import('./types').LineType[]} parentTypes - Types from parent nodes
5
+ * @param {import('./types').LineType} position - Current position type
6
+ * @returns {import('./types').LineType[]} Array of line types
7
+ */
8
+ export function getLineTypes(hasChildren?: boolean, parentTypes?: import("./types").LineType[], position?: import("./types").LineType): import("./types").LineType[];
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Generate a state icon mapping from a list of icon names
3
+ *
4
+ * @param {string[]} icons
5
+ * @returns {import('./types').StateIcons}
6
+ */
7
+ export function stateIconsFromNames(icons: string[]): import("./types").StateIcons;
8
+ export const DATA_IMAGE_REGEX: RegExp;
9
+ export const ITEM_SNIPPET: "itemContent";
10
+ export const GROUP_SNIPPET: "groupContent";
11
+ /**
12
+ * @deprecated Use BASE_FIELDS from @rokkit/core instead.
13
+ * Retained for legacy ListController/FieldMapper/Proxy consumers (Toolbar, Table).
14
+ * Will be removed when those components migrate to Wrapper+Navigator.
15
+ * @type {import('./types).FieldMapping} Fields
16
+ */
17
+ export const DEFAULT_FIELDS: any;
18
+ export namespace BASE_FIELDS {
19
+ let id: string;
20
+ let value: string;
21
+ let label: string;
22
+ let icon: string;
23
+ let avatar: string;
24
+ let subtext: string;
25
+ let tooltip: string;
26
+ let badge: string;
27
+ let shortcut: string;
28
+ let children: string;
29
+ let type: string;
30
+ let snippet: string;
31
+ let href: string;
32
+ let hrefTarget: string;
33
+ let disabled: string;
34
+ let expanded: string;
35
+ let selected: string;
36
+ }
37
+ export const DEFAULT_ICONS: string[];
38
+ export namespace DEFAULT_OPTIONS {
39
+ let id_1: string;
40
+ export { id_1 as id };
41
+ let label_1: string;
42
+ export { label_1 as label };
43
+ let value_1: string;
44
+ export { value_1 as value };
45
+ export let checked: string;
46
+ }
47
+ export namespace DEFAULT_KEYMAP {
48
+ let ArrowRight: string;
49
+ let ArrowLeft: string;
50
+ let ArrowDown: string;
51
+ let ArrowUp: string;
52
+ let Enter: string;
53
+ let Escape: string;
54
+ }
55
+ export namespace DEFAULT_THEME_MAPPING {
56
+ let surface: string;
57
+ let primary: string;
58
+ let secondary: string;
59
+ let accent: string;
60
+ let success: string;
61
+ let warning: string;
62
+ let danger: string;
63
+ let error: string;
64
+ let info: string;
65
+ }
66
+ export namespace TONE_MAP {
67
+ let z0: number;
68
+ let z1: number;
69
+ let z2: number;
70
+ let z3: number;
71
+ let z4: number;
72
+ let z5: number;
73
+ let z6: number;
74
+ let z7: number;
75
+ let z8: number;
76
+ let z9: number;
77
+ let z10: number;
78
+ }
79
+ export const DEFAULT_STATE_ICONS: any;
80
+ export { defaultColors, syntaxColors, shades, defaultPalette } from "./colors/index";
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Creates an emitter object from the given properties.
3
+ *
4
+ * - Filters attributes that start with 'on' and are functions,
5
+ * - Returns an object with keys that are the event names (without the 'on' prefix)
6
+ * - If a default event is not present in the props, it will be set to a no-op function.
7
+ *
8
+ * @param {Object} props - The properties object to filter.
9
+ * @param {Array<string>} defaults - An array of default events.
10
+ * @returns {import('./types.js').EventHandlers} The emitter object.
11
+ */
12
+ export function createEmitter(props: Object, defaults?: Array<string>): import("./types.js").EventHandlers;
@@ -0,0 +1,60 @@
1
+ export class FieldMapper {
2
+ constructor(fields?: any);
3
+ hasIcon: ((obj: unknown) => obj is {
4
+ [x: string]: unknown;
5
+ }) | undefined;
6
+ hasImage: ((obj: unknown) => obj is {
7
+ [x: string]: unknown;
8
+ }) | undefined;
9
+ hasValue: ((obj: unknown) => obj is {
10
+ [x: string]: unknown;
11
+ }) | undefined;
12
+ hasLabel: ((obj: unknown) => obj is {
13
+ [x: string]: unknown;
14
+ }) | undefined;
15
+ hasComponent: ((obj: unknown) => obj is {
16
+ [x: string]: unknown;
17
+ }) | undefined;
18
+ hasCurrency: ((obj: unknown) => obj is {
19
+ [x: string]: unknown;
20
+ }) | undefined;
21
+ withPrefix: ((x: any) => string) | undefined;
22
+ excludeFlags: (<U extends Partial<Record<any, any>>>(obj: any extends keyof U ? U : never) => any extends keyof U ? Omit<U, any> : never) | undefined;
23
+ getChildMapper(): null;
24
+ /**
25
+ * @private
26
+ */
27
+ private prop;
28
+ /**
29
+ * Gets a mapped attribute from the original item
30
+ *
31
+ * @param {string} fieldName - Name of the field to get
32
+ * @returns {any|null} - The attribute value or null if not found
33
+ */
34
+ get(fieldName: string, value: any, defaultValue?: null): any | null;
35
+ set fields(fields: any);
36
+ get fields(): any;
37
+ getIcon(value: any): string | null;
38
+ getValue(value: any): any;
39
+ getFormattedText(value: any, formatter: any): any;
40
+ hasChildren(item: any): item is never;
41
+ isNested(items: any): boolean;
42
+ getChildren(item: any): never[];
43
+ /**
44
+ * Finds children by an index path
45
+ *
46
+ * @param {Array<Object>} items
47
+ * @param {Array<number>} path
48
+ * @returns {Array<Object>}
49
+ */
50
+ getChildrenByPath(items: Array<Object>, path?: Array<number>): Array<Object>;
51
+ /**
52
+ * Finds an item by an index path
53
+ *
54
+ * @param {Array<Object>} items
55
+ * @param {Array<number>} path
56
+ * @returns {Object|null}
57
+ */
58
+ getItemByPath(items: Array<Object>, path?: Array<number>): Object | null;
59
+ #private;
60
+ }
@@ -0,0 +1,13 @@
1
+ export * from "./types.js";
2
+ export * from "./constants.js";
3
+ export * from "./utils.js";
4
+ export * from "./nested.js";
5
+ export * from "./string.js";
6
+ export * from "./theme.js";
7
+ export { FieldMapper } from "./field-mapper.js";
8
+ export { createEmitter } from "./events.js";
9
+ export { getLineTypes } from "./connector.js";
10
+ export { generateTicks } from "./ticks.js";
11
+ export { getNestedFields } from "./mapping.js";
12
+ export { getItemAtIndex, getIndexForItem } from "./mapped-items.js";
13
+ export { weekdays, getCalendarDays } from "./calendar.js";
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Class to manage key event mappings.
3
+ */
4
+ export class KeyEventMap {
5
+ mapping: {};
6
+ /**
7
+ * Add a new key mapping.
8
+ * @param {string} eventName - The event name.
9
+ * @param {Array<string>|RegExp} keys - The keys to match.
10
+ */
11
+ add(eventName: string, keys: Array<string> | RegExp): void;
12
+ /**
13
+ * Get the event name for a given key.
14
+ * @param {string} key - The key to match.
15
+ * @returns {string|null} - The event name or null if no match is found.
16
+ */
17
+ getEventForKey(key: string): string | null;
18
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Get an item at a specific index
3
+ * @param {Array<any>} items
4
+ * @param {any} index
5
+ * @returns
6
+ */
7
+ export function getItemAtIndex(items: Array<any>, index: any): any;
8
+ /**
9
+ * Get the index for an item in an array
10
+ * @param {Array<any} items
11
+ * @param {any} item
12
+ * @returns
13
+ */
14
+ export function getIndexForItem(items: Array<any>, item: any): number;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Gets the attribute from the node
3
+ * @param {*} node
4
+ * @param {string} attr
5
+ * @returns {*}
6
+ */
7
+ export function getAttribute(node: any, attr: string): any;
8
+ /**
9
+ * Fetches the fieldmapping for a child node
10
+ *
11
+ * @param {import('./types').FieldMapping} fields
12
+ * @returns {import('./types').FieldMapping}
13
+ */
14
+ export function getNestedFields(fields: import("./types").FieldMapping): import("./types").FieldMapping;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Flattens a nested list of items
3
+ *
4
+ * @param {Array} items
5
+ * @param {import('./types).FieldMapping} fields
6
+ * @param {number} level
7
+ * @returns {Array}
8
+ */
9
+ export function flattenNestedList(items: any[], fields?: any, level?: number): any[];
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Capitalizes the first letter of input string
3
+ *
4
+ * @param {String} str
5
+ * @returns {String}
6
+ */
7
+ export function toInitCapCase(text: any): string;
8
+ /**
9
+ * Convert a hyphen separated string to PascalCase
10
+ *
11
+ * @param {String} text
12
+ * @returns
13
+ */
14
+ export function toPascalCase(text: string): string;
15
+ /**
16
+ * Convert a PascalCase string to snake case with separator as hyphen
17
+ *
18
+ * @param {string} text
19
+ * @returns {string}
20
+ */
21
+ export function toHyphenCase(text: string): string;
22
+ /**
23
+ * Simple comparison for two strings
24
+ *
25
+ * @param {String} a
26
+ * @param {String} b
27
+ * @returns
28
+ */
29
+ export function compareStrings(a: string, b: string): 1 | 0 | -1;
30
+ /**
31
+ * Sort by splitting hyphen separated strings while keeping strings with same number of parts together
32
+ *
33
+ * @param {String} a hyphen separates string
34
+ * @param {String} b hyphen separates string
35
+ * @param {string} separator - separator to split the string
36
+ * @returns {Number} -1, 0, 1 based on comparison
37
+ */
38
+ export function sortByParts(a: string, b: string, separator?: string): number;
39
+ /**
40
+ * Generates a unique id from current timestamp
41
+ *
42
+ * @returns {String} timestamp based unique id
43
+ */
44
+ export function uniqueId(prefix?: string, separator?: string): string;
45
+ /**
46
+ * Removes undefined and null values from the input object.
47
+ *
48
+ * @param {Object} obj
49
+ * @returns {Object}
50
+ */
51
+ export function compact(obj: Object): Object;
52
+ /**
53
+ * Converts an input number into it's hexadecimal representation, with optional left padded zeroes based on the `size`
54
+ *
55
+ * @param {number} value
56
+ * @param {number} size
57
+ * @returns
58
+ */
59
+ export function toHexString(value: number, size?: number): string;
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Generate shades for a color using css varuable
3
+ *
4
+ * @param {string} name
5
+ * @param {string} modifier
6
+ * @returns
7
+ */
8
+ export declare function shadesOf(name: any, modifier?: string): {
9
+ DEFAULT: any;
10
+ };
11
+ /**
12
+ * Constructs and returns the light and dark theme variants based on provided color mapping and color definitions.
13
+ *
14
+ * @param {Object} [mapping=DEFAULT_THEME_MAPPING] - An object mapping variant names to color property names.
15
+ * @param {Object} [colors=defaultColors] - The object containing default color definitions.
16
+ * @returns {Array<Array>} An array containing two arrays, one for the light theme variant and another for the dark theme.
17
+ */
18
+ export declare function themeRules(mapping?: {
19
+ surface: string;
20
+ primary: string;
21
+ secondary: string;
22
+ accent: string;
23
+ success: string;
24
+ warning: string;
25
+ danger: string;
26
+ error: string;
27
+ info: string;
28
+ }, colors?: any): {};
29
+ /**
30
+ * Generates UnoCSS shortcut definitions for semantic tones with bg, border, text.
31
+ * @param {string} name - Color name (e.g., 'primary')
32
+ * @returns {Array} Array of shortcut definitions
33
+ */
34
+ export declare function semanticShortcuts(name: any): (string[] | (RegExp | (([, variant, end]: [any, any, any]) => string))[] | (RegExp | (([, end]: [any, any]) => string))[])[];
35
+ /**
36
+ * Generates "on-color" text shortcuts for readable text on colored backgrounds.
37
+ *
38
+ * - `text-on-{name}` → high contrast text for use on z5+ backgrounds (always light text)
39
+ * - `text-on-{name}-muted` → slightly muted but still readable on z5+ backgrounds
40
+ *
41
+ * @param {string} name - Color name (e.g., 'primary', 'surface')
42
+ * @returns {Array} Array of shortcut definitions
43
+ */
44
+ export declare function contrastShortcuts(name: any): string[][];
45
+ /**
46
+ * Theme class for managing color palettes, mappings, and semantic shortcuts.
47
+ */
48
+ export declare class Theme {
49
+ #private;
50
+ /**
51
+ *
52
+ * @param {import('./types.js').ColorTheme} param0
53
+ */
54
+ constructor({ colors, mapping }?: {
55
+ colors?: any;
56
+ mapping?: {
57
+ surface: string;
58
+ primary: string;
59
+ secondary: string;
60
+ accent: string;
61
+ success: string;
62
+ warning: string;
63
+ danger: string;
64
+ error: string;
65
+ info: string;
66
+ } | undefined;
67
+ });
68
+ get colors(): any;
69
+ set colors(colors: any);
70
+ get mapping(): {
71
+ surface: string;
72
+ primary: string;
73
+ secondary: string;
74
+ accent: string;
75
+ success: string;
76
+ warning: string;
77
+ danger: string;
78
+ error: string;
79
+ info: string;
80
+ };
81
+ set mapping(mapping: {
82
+ surface: string;
83
+ primary: string;
84
+ secondary: string;
85
+ accent: string;
86
+ success: string;
87
+ warning: string;
88
+ danger: string;
89
+ error: string;
90
+ info: string;
91
+ });
92
+ mapVariant(color: any, variant: any): {};
93
+ getColorRules(mapping?: null): {};
94
+ getPalette(mapping?: null): {};
95
+ getShortcuts(name: any): (string[] | (RegExp | (([, variant, end]: [any, any, any]) => string))[] | (RegExp | (([, end]: [any, any]) => string))[])[];
96
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Generates an array of tick marks for a range of values.
3
+ *
4
+ * @param {number} lowerBound - The lower bound of the range.
5
+ * @param {number} upperBound - The upper bound of the range.
6
+ * @param {number} [minorTickStep=upperBound-lowerBound] - The step size for minor ticks.
7
+ * @param {number} [majorTickStep=1] - The step size for major ticks.
8
+ * @returns {import('./types').TickMark[]>} An array of tick mark objects.
9
+ */
10
+ export function generateTicks(lowerBound: number, upperBound: number, minorTickStep?: number, majorTickStep?: number): import("./types").TickMark[];