tyrell-components 1.0.0-RC10
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/LICENSE +21 -0
- package/README.md +221 -0
- package/css/tyrell-brand.css +767 -0
- package/css/tyrell.css +1679 -0
- package/dist/tyrell-brand.css +767 -0
- package/dist/tyrell.css +1679 -0
- package/dist/tyrell.js +2 -0
- package/lib/base/ty-component.d.ts +133 -0
- package/lib/base/ty-component.d.ts.map +1 -0
- package/lib/base/ty-component.js +297 -0
- package/lib/base/ty-component.js.map +1 -0
- package/lib/components/button.d.ts +135 -0
- package/lib/components/button.d.ts.map +1 -0
- package/lib/components/button.js +277 -0
- package/lib/components/button.js.map +1 -0
- package/lib/components/calendar-month.d.ts +132 -0
- package/lib/components/calendar-month.d.ts.map +1 -0
- package/lib/components/calendar-month.js +440 -0
- package/lib/components/calendar-month.js.map +1 -0
- package/lib/components/calendar-navigation.d.ts +137 -0
- package/lib/components/calendar-navigation.d.ts.map +1 -0
- package/lib/components/calendar-navigation.js +366 -0
- package/lib/components/calendar-navigation.js.map +1 -0
- package/lib/components/calendar.d.ts +166 -0
- package/lib/components/calendar.d.ts.map +1 -0
- package/lib/components/calendar.js +774 -0
- package/lib/components/calendar.js.map +1 -0
- package/lib/components/checkbox.d.ts +189 -0
- package/lib/components/checkbox.d.ts.map +1 -0
- package/lib/components/checkbox.js +400 -0
- package/lib/components/checkbox.js.map +1 -0
- package/lib/components/copy.d.ts +180 -0
- package/lib/components/copy.d.ts.map +1 -0
- package/lib/components/copy.js +393 -0
- package/lib/components/copy.js.map +1 -0
- package/lib/components/date-picker.d.ts +379 -0
- package/lib/components/date-picker.d.ts.map +1 -0
- package/lib/components/date-picker.js +1586 -0
- package/lib/components/date-picker.js.map +1 -0
- package/lib/components/dropdown.d.ts +424 -0
- package/lib/components/dropdown.d.ts.map +1 -0
- package/lib/components/dropdown.js +1640 -0
- package/lib/components/dropdown.js.map +1 -0
- package/lib/components/file-upload.d.ts +121 -0
- package/lib/components/file-upload.d.ts.map +1 -0
- package/lib/components/file-upload.js +441 -0
- package/lib/components/file-upload.js.map +1 -0
- package/lib/components/icon.d.ts +118 -0
- package/lib/components/icon.d.ts.map +1 -0
- package/lib/components/icon.js +245 -0
- package/lib/components/icon.js.map +1 -0
- package/lib/components/input.d.ts +270 -0
- package/lib/components/input.d.ts.map +1 -0
- package/lib/components/input.js +721 -0
- package/lib/components/input.js.map +1 -0
- package/lib/components/modal.d.ts +78 -0
- package/lib/components/modal.d.ts.map +1 -0
- package/lib/components/modal.js +497 -0
- package/lib/components/modal.js.map +1 -0
- package/lib/components/multiselect.d.ts +397 -0
- package/lib/components/multiselect.d.ts.map +1 -0
- package/lib/components/multiselect.js +1595 -0
- package/lib/components/multiselect.js.map +1 -0
- package/lib/components/option.d.ts +66 -0
- package/lib/components/option.d.ts.map +1 -0
- package/lib/components/option.js +314 -0
- package/lib/components/option.js.map +1 -0
- package/lib/components/popup.d.ts +43 -0
- package/lib/components/popup.d.ts.map +1 -0
- package/lib/components/popup.js +380 -0
- package/lib/components/popup.js.map +1 -0
- package/lib/components/radio.d.ts +198 -0
- package/lib/components/radio.d.ts.map +1 -0
- package/lib/components/radio.js +437 -0
- package/lib/components/radio.js.map +1 -0
- package/lib/components/resize-observer.d.ts +48 -0
- package/lib/components/resize-observer.d.ts.map +1 -0
- package/lib/components/resize-observer.js +108 -0
- package/lib/components/resize-observer.js.map +1 -0
- package/lib/components/scroll-container.d.ts +51 -0
- package/lib/components/scroll-container.d.ts.map +1 -0
- package/lib/components/scroll-container.js +239 -0
- package/lib/components/scroll-container.js.map +1 -0
- package/lib/components/step.d.ts +26 -0
- package/lib/components/step.d.ts.map +1 -0
- package/lib/components/step.js +75 -0
- package/lib/components/step.js.map +1 -0
- package/lib/components/switch.d.ts +111 -0
- package/lib/components/switch.d.ts.map +1 -0
- package/lib/components/switch.js +240 -0
- package/lib/components/switch.js.map +1 -0
- package/lib/components/tab.d.ts +23 -0
- package/lib/components/tab.d.ts.map +1 -0
- package/lib/components/tab.js +76 -0
- package/lib/components/tab.js.map +1 -0
- package/lib/components/tabs.d.ts +93 -0
- package/lib/components/tabs.d.ts.map +1 -0
- package/lib/components/tabs.js +653 -0
- package/lib/components/tabs.js.map +1 -0
- package/lib/components/tag.d.ts +144 -0
- package/lib/components/tag.d.ts.map +1 -0
- package/lib/components/tag.js +316 -0
- package/lib/components/tag.js.map +1 -0
- package/lib/components/textarea.d.ts +241 -0
- package/lib/components/textarea.d.ts.map +1 -0
- package/lib/components/textarea.js +585 -0
- package/lib/components/textarea.js.map +1 -0
- package/lib/components/tooltip.d.ts +40 -0
- package/lib/components/tooltip.d.ts.map +1 -0
- package/lib/components/tooltip.js +439 -0
- package/lib/components/tooltip.js.map +1 -0
- package/lib/components/wizard.d.ts +86 -0
- package/lib/components/wizard.d.ts.map +1 -0
- package/lib/components/wizard.js +636 -0
- package/lib/components/wizard.js.map +1 -0
- package/lib/icons/fontawesome/brands.d.ts +557 -0
- package/lib/icons/fontawesome/brands.d.ts.map +1 -0
- package/lib/icons/fontawesome/brands.js +557 -0
- package/lib/icons/fontawesome/brands.js.map +1 -0
- package/lib/icons/fontawesome/regular.d.ts +281 -0
- package/lib/icons/fontawesome/regular.d.ts.map +1 -0
- package/lib/icons/fontawesome/regular.js +281 -0
- package/lib/icons/fontawesome/regular.js.map +1 -0
- package/lib/icons/fontawesome/solid.d.ts +1992 -0
- package/lib/icons/fontawesome/solid.d.ts.map +1 -0
- package/lib/icons/fontawesome/solid.js +1992 -0
- package/lib/icons/fontawesome/solid.js.map +1 -0
- package/lib/icons/heroicons/micro.d.ts +324 -0
- package/lib/icons/heroicons/micro.d.ts.map +1 -0
- package/lib/icons/heroicons/micro.js +1032 -0
- package/lib/icons/heroicons/micro.js.map +1 -0
- package/lib/icons/heroicons/mini.d.ts +332 -0
- package/lib/icons/heroicons/mini.d.ts.map +1 -0
- package/lib/icons/heroicons/mini.js +1038 -0
- package/lib/icons/heroicons/mini.js.map +1 -0
- package/lib/icons/heroicons/outline.d.ts +332 -0
- package/lib/icons/heroicons/outline.d.ts.map +1 -0
- package/lib/icons/heroicons/outline.js +993 -0
- package/lib/icons/heroicons/outline.js.map +1 -0
- package/lib/icons/heroicons/solid.d.ts +332 -0
- package/lib/icons/heroicons/solid.d.ts.map +1 -0
- package/lib/icons/heroicons/solid.js +1063 -0
- package/lib/icons/heroicons/solid.js.map +1 -0
- package/lib/icons/lucide.d.ts +1872 -0
- package/lib/icons/lucide.d.ts.map +1 -0
- package/lib/icons/lucide.js +28212 -0
- package/lib/icons/lucide.js.map +1 -0
- package/lib/icons/material/filled.d.ts +2180 -0
- package/lib/icons/material/filled.d.ts.map +1 -0
- package/lib/icons/material/filled.js +14003 -0
- package/lib/icons/material/filled.js.map +1 -0
- package/lib/icons/material/outlined.d.ts +2142 -0
- package/lib/icons/material/outlined.d.ts.map +1 -0
- package/lib/icons/material/outlined.js +14545 -0
- package/lib/icons/material/outlined.js.map +1 -0
- package/lib/icons/material/round.d.ts +2147 -0
- package/lib/icons/material/round.d.ts.map +1 -0
- package/lib/icons/material/round.js +14779 -0
- package/lib/icons/material/round.js.map +1 -0
- package/lib/icons/material/sharp.d.ts +2147 -0
- package/lib/icons/material/sharp.d.ts.map +1 -0
- package/lib/icons/material/sharp.js +14189 -0
- package/lib/icons/material/sharp.js.map +1 -0
- package/lib/icons/material/two-tone.d.ts +2185 -0
- package/lib/icons/material/two-tone.d.ts.map +1 -0
- package/lib/icons/material/two-tone.js +17152 -0
- package/lib/icons/material/two-tone.js.map +1 -0
- package/lib/index.d.ts +86 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +78 -0
- package/lib/index.js.map +1 -0
- package/lib/styles/button.d.ts +14 -0
- package/lib/styles/button.d.ts.map +1 -0
- package/lib/styles/button.js +498 -0
- package/lib/styles/button.js.map +1 -0
- package/lib/styles/calendar-month.d.ts +6 -0
- package/lib/styles/calendar-month.d.ts.map +1 -0
- package/lib/styles/calendar-month.js +275 -0
- package/lib/styles/calendar-month.js.map +1 -0
- package/lib/styles/calendar-navigation.d.ts +6 -0
- package/lib/styles/calendar-navigation.d.ts.map +1 -0
- package/lib/styles/calendar-navigation.js +143 -0
- package/lib/styles/calendar-navigation.js.map +1 -0
- package/lib/styles/calendar.d.ts +6 -0
- package/lib/styles/calendar.d.ts.map +1 -0
- package/lib/styles/calendar.js +28 -0
- package/lib/styles/calendar.js.map +1 -0
- package/lib/styles/checkbox.d.ts +9 -0
- package/lib/styles/checkbox.d.ts.map +1 -0
- package/lib/styles/checkbox.js +19 -0
- package/lib/styles/checkbox.js.map +1 -0
- package/lib/styles/copy.d.ts +7 -0
- package/lib/styles/copy.d.ts.map +1 -0
- package/lib/styles/copy.js +94 -0
- package/lib/styles/copy.js.map +1 -0
- package/lib/styles/custom-scrollbar.d.ts +6 -0
- package/lib/styles/custom-scrollbar.d.ts.map +1 -0
- package/lib/styles/custom-scrollbar.js +157 -0
- package/lib/styles/custom-scrollbar.js.map +1 -0
- package/lib/styles/date-picker.d.ts +6 -0
- package/lib/styles/date-picker.d.ts.map +1 -0
- package/lib/styles/date-picker.js +438 -0
- package/lib/styles/date-picker.js.map +1 -0
- package/lib/styles/dropdown.d.ts +12 -0
- package/lib/styles/dropdown.d.ts.map +1 -0
- package/lib/styles/dropdown.js +1081 -0
- package/lib/styles/dropdown.js.map +1 -0
- package/lib/styles/file-upload.d.ts +2 -0
- package/lib/styles/file-upload.d.ts.map +1 -0
- package/lib/styles/file-upload.js +241 -0
- package/lib/styles/file-upload.js.map +1 -0
- package/lib/styles/icon.d.ts +6 -0
- package/lib/styles/icon.d.ts.map +1 -0
- package/lib/styles/icon.js +241 -0
- package/lib/styles/icon.js.map +1 -0
- package/lib/styles/input.d.ts +7 -0
- package/lib/styles/input.d.ts.map +1 -0
- package/lib/styles/input.js +685 -0
- package/lib/styles/input.js.map +1 -0
- package/lib/styles/modal.d.ts +8 -0
- package/lib/styles/modal.d.ts.map +1 -0
- package/lib/styles/modal.js +134 -0
- package/lib/styles/modal.js.map +1 -0
- package/lib/styles/multiselect.d.ts +6 -0
- package/lib/styles/multiselect.d.ts.map +1 -0
- package/lib/styles/multiselect.js +825 -0
- package/lib/styles/multiselect.js.map +1 -0
- package/lib/styles/option.d.ts +6 -0
- package/lib/styles/option.d.ts.map +1 -0
- package/lib/styles/option.js +116 -0
- package/lib/styles/option.js.map +1 -0
- package/lib/styles/popup.d.ts +8 -0
- package/lib/styles/popup.d.ts.map +1 -0
- package/lib/styles/popup.js +95 -0
- package/lib/styles/popup.js.map +1 -0
- package/lib/styles/radio.d.ts +8 -0
- package/lib/styles/radio.d.ts.map +1 -0
- package/lib/styles/radio.js +160 -0
- package/lib/styles/radio.js.map +1 -0
- package/lib/styles/resize-observer.d.ts +6 -0
- package/lib/styles/resize-observer.d.ts.map +1 -0
- package/lib/styles/resize-observer.js +18 -0
- package/lib/styles/resize-observer.js.map +1 -0
- package/lib/styles/scroll-container.d.ts +6 -0
- package/lib/styles/scroll-container.d.ts.map +1 -0
- package/lib/styles/scroll-container.js +198 -0
- package/lib/styles/scroll-container.js.map +1 -0
- package/lib/styles/step.d.ts +5 -0
- package/lib/styles/step.d.ts.map +1 -0
- package/lib/styles/step.js +50 -0
- package/lib/styles/step.js.map +1 -0
- package/lib/styles/switch.d.ts +9 -0
- package/lib/styles/switch.d.ts.map +1 -0
- package/lib/styles/switch.js +100 -0
- package/lib/styles/switch.js.map +1 -0
- package/lib/styles/tab.d.ts +5 -0
- package/lib/styles/tab.d.ts.map +1 -0
- package/lib/styles/tab.js +51 -0
- package/lib/styles/tab.js.map +1 -0
- package/lib/styles/tabs.d.ts +13 -0
- package/lib/styles/tabs.d.ts.map +1 -0
- package/lib/styles/tabs.js +184 -0
- package/lib/styles/tabs.js.map +1 -0
- package/lib/styles/tag.d.ts +6 -0
- package/lib/styles/tag.d.ts.map +1 -0
- package/lib/styles/tag.js +409 -0
- package/lib/styles/tag.js.map +1 -0
- package/lib/styles/textarea.d.ts +6 -0
- package/lib/styles/textarea.d.ts.map +1 -0
- package/lib/styles/textarea.js +350 -0
- package/lib/styles/textarea.js.map +1 -0
- package/lib/styles/tooltip.d.ts +9 -0
- package/lib/styles/tooltip.d.ts.map +1 -0
- package/lib/styles/tooltip.js +133 -0
- package/lib/styles/tooltip.js.map +1 -0
- package/lib/styles/wizard.d.ts +25 -0
- package/lib/styles/wizard.d.ts.map +1 -0
- package/lib/styles/wizard.js +348 -0
- package/lib/styles/wizard.js.map +1 -0
- package/lib/types/common.d.ts +143 -0
- package/lib/types/common.d.ts.map +1 -0
- package/lib/types/common.js +5 -0
- package/lib/types/common.js.map +1 -0
- package/lib/utils/calendar-utils.d.ts +176 -0
- package/lib/utils/calendar-utils.d.ts.map +1 -0
- package/lib/utils/calendar-utils.js +370 -0
- package/lib/utils/calendar-utils.js.map +1 -0
- package/lib/utils/custom-scrollbar.d.ts +82 -0
- package/lib/utils/custom-scrollbar.d.ts.map +1 -0
- package/lib/utils/custom-scrollbar.js +320 -0
- package/lib/utils/custom-scrollbar.js.map +1 -0
- package/lib/utils/icon-registry.d.ts +78 -0
- package/lib/utils/icon-registry.d.ts.map +1 -0
- package/lib/utils/icon-registry.js +304 -0
- package/lib/utils/icon-registry.js.map +1 -0
- package/lib/utils/loader-registry.d.ts +35 -0
- package/lib/utils/loader-registry.d.ts.map +1 -0
- package/lib/utils/loader-registry.js +43 -0
- package/lib/utils/loader-registry.js.map +1 -0
- package/lib/utils/locale.d.ts +136 -0
- package/lib/utils/locale.d.ts.map +1 -0
- package/lib/utils/locale.js +213 -0
- package/lib/utils/locale.js.map +1 -0
- package/lib/utils/mobile.d.ts +14 -0
- package/lib/utils/mobile.d.ts.map +1 -0
- package/lib/utils/mobile.js +21 -0
- package/lib/utils/mobile.js.map +1 -0
- package/lib/utils/number-format.d.ts +83 -0
- package/lib/utils/number-format.d.ts.map +1 -0
- package/lib/utils/number-format.js +143 -0
- package/lib/utils/number-format.js.map +1 -0
- package/lib/utils/parse-boolean.d.ts +39 -0
- package/lib/utils/parse-boolean.d.ts.map +1 -0
- package/lib/utils/parse-boolean.js +58 -0
- package/lib/utils/parse-boolean.js.map +1 -0
- package/lib/utils/positioning.d.ts +143 -0
- package/lib/utils/positioning.d.ts.map +1 -0
- package/lib/utils/positioning.js +308 -0
- package/lib/utils/positioning.js.map +1 -0
- package/lib/utils/property-capture.d.ts +132 -0
- package/lib/utils/property-capture.d.ts.map +1 -0
- package/lib/utils/property-capture.js +152 -0
- package/lib/utils/property-capture.js.map +1 -0
- package/lib/utils/property-manager.d.ts +90 -0
- package/lib/utils/property-manager.d.ts.map +1 -0
- package/lib/utils/property-manager.js +197 -0
- package/lib/utils/property-manager.js.map +1 -0
- package/lib/utils/resize-observer.d.ts +42 -0
- package/lib/utils/resize-observer.d.ts.map +1 -0
- package/lib/utils/resize-observer.js +71 -0
- package/lib/utils/resize-observer.js.map +1 -0
- package/lib/utils/scroll-lock.d.ts +79 -0
- package/lib/utils/scroll-lock.d.ts.map +1 -0
- package/lib/utils/scroll-lock.js +197 -0
- package/lib/utils/scroll-lock.js.map +1 -0
- package/lib/utils/styles.d.ts +27 -0
- package/lib/utils/styles.d.ts.map +1 -0
- package/lib/utils/styles.js +53 -0
- package/lib/utils/styles.js.map +1 -0
- package/lib/version.d.ts +8 -0
- package/lib/version.d.ts.map +1 -0
- package/lib/version.js +11 -0
- package/lib/version.js.map +1 -0
- package/package.json +163 -0
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wizard Component Styles
|
|
3
|
+
*
|
|
4
|
+
* CSS Parts (for styling via ::part):
|
|
5
|
+
* - indicators-wrapper: The header containing step indicators
|
|
6
|
+
* - progress-line: The background progress track
|
|
7
|
+
* - step-circle: Individual step circle indicators
|
|
8
|
+
* - panels-container: The content viewport
|
|
9
|
+
*
|
|
10
|
+
* Theming: four accent-alias knobs (one per state), four surface knobs
|
|
11
|
+
* (container chrome), and a small set of geometry/motion overrides.
|
|
12
|
+
*
|
|
13
|
+
* Per-state circles read their colors directly from the matching accent
|
|
14
|
+
* variable — no per-state `-bg` indirection. Override one of:
|
|
15
|
+
* --ty-wizard-active-accent (default: --ty-color-primary)
|
|
16
|
+
* --ty-wizard-completed-accent (default: --ty-color-success)
|
|
17
|
+
* --ty-wizard-error-accent (default: --ty-color-danger)
|
|
18
|
+
* --ty-wizard-pending-accent (default: --ty-color-neutral)
|
|
19
|
+
*
|
|
20
|
+
* For per-shade fine control, override the brand-layer's flavor seeds
|
|
21
|
+
* (--ty-color-primary, --ty-color-success-strong, etc.) — they cascade
|
|
22
|
+
* through here.
|
|
23
|
+
*/
|
|
24
|
+
export const wizardStyles = `
|
|
25
|
+
/* ============================================================================
|
|
26
|
+
Theming Tokens — see file header for the override surface.
|
|
27
|
+
Every default chains back to the brand layer / global scale tokens.
|
|
28
|
+
============================================================================ */
|
|
29
|
+
|
|
30
|
+
:host {
|
|
31
|
+
display: block;
|
|
32
|
+
width: var(--ty-wizard-width, 100%); /* set by width attribute — not a public token */
|
|
33
|
+
height: var(--ty-wizard-height, 700px); /* set by height attribute — not a public token */
|
|
34
|
+
box-sizing: border-box;
|
|
35
|
+
|
|
36
|
+
/* State accents — the primary override surface. One variable retints the
|
|
37
|
+
* matching circle background, border, and glow. */
|
|
38
|
+
--ty-wizard-active-accent: var(--ty-color-primary);
|
|
39
|
+
--ty-wizard-completed-accent: var(--ty-color-success);
|
|
40
|
+
--ty-wizard-error-accent: var(--ty-color-danger);
|
|
41
|
+
--ty-wizard-pending-accent: var(--ty-color-neutral);
|
|
42
|
+
|
|
43
|
+
/* Container chrome — routes through global scales. Override --ty-radius-lg
|
|
44
|
+
* or --ty-shadow-md app-wide and the wizard follows; override these locally
|
|
45
|
+
* to give the wizard a distinct look. */
|
|
46
|
+
--ty-wizard-bg: var(--ty-surface-floating);
|
|
47
|
+
--ty-wizard-border: var(--ty-border);
|
|
48
|
+
--ty-wizard-radius: var(--ty-radius-lg, 12px);
|
|
49
|
+
--ty-wizard-shadow: var(--ty-shadow-md, 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1));
|
|
50
|
+
|
|
51
|
+
/* Header strip */
|
|
52
|
+
--ty-wizard-header-bg: var(--ty-surface-content);
|
|
53
|
+
--ty-wizard-header-border: var(--ty-border-soft, var(--ty-border));
|
|
54
|
+
--ty-wizard-header-padding: 24px 24px 16px;
|
|
55
|
+
|
|
56
|
+
/* Progress line */
|
|
57
|
+
--ty-wizard-progress-track: var(--ty-border);
|
|
58
|
+
--ty-wizard-progress-fill: var(--ty-wizard-completed-accent);
|
|
59
|
+
--ty-wizard-progress-height: 2px;
|
|
60
|
+
|
|
61
|
+
/* Motion — routes through global motion tokens if defined. */
|
|
62
|
+
--ty-wizard-transition-duration: var(--ty-transition-duration, 300ms);
|
|
63
|
+
--ty-wizard-transition-easing: var(--ty-transition-easing, ease-in-out);
|
|
64
|
+
|
|
65
|
+
/* Circle geometry */
|
|
66
|
+
--ty-wizard-circle-size: 32px;
|
|
67
|
+
--ty-wizard-circle-border-width: 2px;
|
|
68
|
+
|
|
69
|
+
/* Panels viewport */
|
|
70
|
+
--ty-wizard-panels-bg: var(--ty-surface-elevated);
|
|
71
|
+
|
|
72
|
+
/* Focus */
|
|
73
|
+
--ty-wizard-focus-outline: var(--ty-wizard-active-accent);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.wizard-container {
|
|
77
|
+
width: 100%;
|
|
78
|
+
height: 100%;
|
|
79
|
+
display: flex;
|
|
80
|
+
flex-direction: column;
|
|
81
|
+
position: relative;
|
|
82
|
+
box-sizing: border-box;
|
|
83
|
+
border-radius: var(--ty-wizard-radius);
|
|
84
|
+
border: 1px solid var(--ty-wizard-border);
|
|
85
|
+
background: var(--ty-wizard-bg);
|
|
86
|
+
box-shadow: var(--ty-wizard-shadow);
|
|
87
|
+
overflow: hidden;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* ===================================== */
|
|
91
|
+
/* Step Indicators Wrapper */
|
|
92
|
+
/* ===================================== */
|
|
93
|
+
|
|
94
|
+
.step-indicators-wrapper {
|
|
95
|
+
display: flex;
|
|
96
|
+
flex-direction: column;
|
|
97
|
+
flex-shrink: 0;
|
|
98
|
+
position: relative;
|
|
99
|
+
padding: var(--ty-wizard-header-padding);
|
|
100
|
+
border-bottom: 1px solid var(--ty-wizard-header-border);
|
|
101
|
+
background: var(--ty-wizard-header-bg);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* ===================================== */
|
|
105
|
+
/* Progress Line (behind step circles) */
|
|
106
|
+
/* ===================================== */
|
|
107
|
+
|
|
108
|
+
.progress-line {
|
|
109
|
+
position: absolute;
|
|
110
|
+
/*
|
|
111
|
+
* With equal-width indicators (flex: 1), each takes 100%/N of the width.
|
|
112
|
+
* Circle centers sit at 50%/N from the left edge of each indicator.
|
|
113
|
+
* Inset = 50% / step-count from each side keeps the line between circle centres.
|
|
114
|
+
*/
|
|
115
|
+
left: calc(50% / var(--ty-wizard-step-count, 4));
|
|
116
|
+
right: calc(50% / var(--ty-wizard-step-count, 4));
|
|
117
|
+
top: calc(var(--ty-wizard-circle-size, 32px) / 2 - 1px);
|
|
118
|
+
height: var(--ty-wizard-progress-height);
|
|
119
|
+
background: var(--ty-wizard-progress-track);
|
|
120
|
+
z-index: 0;
|
|
121
|
+
pointer-events: none;
|
|
122
|
+
transition: opacity var(--ty-wizard-transition-duration) var(--ty-wizard-transition-easing);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.progress-overlay {
|
|
126
|
+
position: absolute;
|
|
127
|
+
left: 0;
|
|
128
|
+
top: 0;
|
|
129
|
+
height: 100%;
|
|
130
|
+
background: var(--ty-wizard-progress-fill);
|
|
131
|
+
transition: width var(--ty-wizard-transition-duration) var(--ty-wizard-transition-easing);
|
|
132
|
+
will-change: width;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/* ===================================== */
|
|
136
|
+
/* Step Indicators Container */
|
|
137
|
+
/* ===================================== */
|
|
138
|
+
|
|
139
|
+
.step-indicators {
|
|
140
|
+
display: flex;
|
|
141
|
+
align-items: flex-start;
|
|
142
|
+
position: relative;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/* ===================================== */
|
|
146
|
+
/* Individual Step Indicator */
|
|
147
|
+
/* ===================================== */
|
|
148
|
+
|
|
149
|
+
.step-indicator {
|
|
150
|
+
display: flex;
|
|
151
|
+
flex-direction: column;
|
|
152
|
+
align-items: center;
|
|
153
|
+
gap: 8px;
|
|
154
|
+
cursor: pointer;
|
|
155
|
+
background: transparent;
|
|
156
|
+
border: none;
|
|
157
|
+
padding: 0;
|
|
158
|
+
font: inherit;
|
|
159
|
+
transition: opacity 200ms;
|
|
160
|
+
flex: 1;
|
|
161
|
+
min-width: 0;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.step-indicator[aria-disabled="true"] {
|
|
165
|
+
opacity: 0.4;
|
|
166
|
+
cursor: not-allowed;
|
|
167
|
+
pointer-events: none;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.step-indicator:focus-visible {
|
|
171
|
+
outline: 2px solid var(--ty-wizard-focus-outline);
|
|
172
|
+
outline-offset: 4px;
|
|
173
|
+
border-radius: 50%;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/* ===================================== */
|
|
177
|
+
/* Step Circle */
|
|
178
|
+
/* ===================================== */
|
|
179
|
+
|
|
180
|
+
.step-circle {
|
|
181
|
+
width: var(--ty-wizard-circle-size);
|
|
182
|
+
height: var(--ty-wizard-circle-size);
|
|
183
|
+
border-radius: 50%;
|
|
184
|
+
border: var(--ty-wizard-circle-border-width) solid;
|
|
185
|
+
display: flex;
|
|
186
|
+
align-items: center;
|
|
187
|
+
justify-content: center;
|
|
188
|
+
position: relative;
|
|
189
|
+
z-index: 10;
|
|
190
|
+
transition: all var(--ty-wizard-transition-duration) var(--ty-wizard-transition-easing);
|
|
191
|
+
box-sizing: border-box;
|
|
192
|
+
flex-shrink: 0;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.step-circle[data-state="completed"] {
|
|
196
|
+
background: var(--ty-wizard-completed-accent);
|
|
197
|
+
border-color: var(--ty-color-success-strong);
|
|
198
|
+
color: var(--ty-solid-success-fg, white);
|
|
199
|
+
box-shadow: 0 0 0 4px color-mix(in oklab, var(--ty-wizard-completed-accent) 12%, transparent);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.step-circle[data-state="active"] {
|
|
203
|
+
background: var(--ty-wizard-active-accent);
|
|
204
|
+
border-color: var(--ty-color-primary-strong);
|
|
205
|
+
color: var(--ty-solid-primary-fg, white);
|
|
206
|
+
box-shadow: 0 0 0 4px color-mix(in oklab, var(--ty-wizard-active-accent) 12%, transparent);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.step-circle[data-state="pending"] {
|
|
210
|
+
background: var(--ty-surface-elevated);
|
|
211
|
+
border-color: var(--ty-border);
|
|
212
|
+
color: var(--ty-color-neutral);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.step-circle[data-state="error"] {
|
|
216
|
+
background: var(--ty-wizard-error-accent);
|
|
217
|
+
border-color: var(--ty-color-danger-strong);
|
|
218
|
+
color: var(--ty-solid-danger-fg, white);
|
|
219
|
+
box-shadow: 0 0 0 4px color-mix(in oklab, var(--ty-wizard-error-accent) 12%, transparent);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/* ===================================== */
|
|
223
|
+
/* Step Text Container */
|
|
224
|
+
/* ===================================== */
|
|
225
|
+
|
|
226
|
+
.step-text {
|
|
227
|
+
display: flex;
|
|
228
|
+
flex-direction: column;
|
|
229
|
+
gap: 2px;
|
|
230
|
+
align-items: center;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/* ===================================== */
|
|
234
|
+
/* Step Label */
|
|
235
|
+
/* ===================================== */
|
|
236
|
+
|
|
237
|
+
.step-label {
|
|
238
|
+
font-size: var(--ty-font-sm, 14px);
|
|
239
|
+
font-weight: var(--ty-font-semibold, 600);
|
|
240
|
+
color: var(--ty-color-neutral);
|
|
241
|
+
transition: color 200ms;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.step-indicator[aria-selected="true"] .step-label {
|
|
245
|
+
color: var(--ty-color-neutral-strong);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.step-indicator[aria-selected="false"] .step-label {
|
|
249
|
+
color: var(--ty-color-neutral);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/* ===================================== */
|
|
253
|
+
/* Step Description */
|
|
254
|
+
/* ===================================== */
|
|
255
|
+
|
|
256
|
+
.step-description {
|
|
257
|
+
font-size: var(--ty-font-xs, 12px);
|
|
258
|
+
font-weight: var(--ty-font-normal, 400);
|
|
259
|
+
color: var(--ty-color-neutral);
|
|
260
|
+
transition: color 200ms;
|
|
261
|
+
text-align: center;
|
|
262
|
+
max-width: 120px;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.step-indicator[aria-selected="true"] .step-description {
|
|
266
|
+
color: var(--ty-color-neutral-bold);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/* ===================================== */
|
|
270
|
+
/* Custom Indicator Content via Slots */
|
|
271
|
+
/* ===================================== */
|
|
272
|
+
|
|
273
|
+
::slotted([slot^="indicator-"]) {
|
|
274
|
+
display: flex;
|
|
275
|
+
align-items: center;
|
|
276
|
+
justify-content: center;
|
|
277
|
+
width: 100%;
|
|
278
|
+
height: 100%;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/* ===================================== */
|
|
282
|
+
/* Panels Viewport */
|
|
283
|
+
/* ===================================== */
|
|
284
|
+
|
|
285
|
+
.panels-viewport {
|
|
286
|
+
position: relative;
|
|
287
|
+
flex: 1;
|
|
288
|
+
overflow: hidden;
|
|
289
|
+
min-height: 0;
|
|
290
|
+
background: var(--ty-wizard-panels-bg);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/* ===================================== */
|
|
294
|
+
/* Panels Wrapper (slides horizontally) */
|
|
295
|
+
/* ===================================== */
|
|
296
|
+
|
|
297
|
+
.panels-wrapper {
|
|
298
|
+
display: flex;
|
|
299
|
+
height: 100%;
|
|
300
|
+
transition: transform var(--ty-wizard-transition-duration) var(--ty-wizard-transition-easing);
|
|
301
|
+
will-change: transform;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/* ===================================== */
|
|
305
|
+
/* Slotted Step Panels */
|
|
306
|
+
/* ===================================== */
|
|
307
|
+
|
|
308
|
+
::slotted(ty-step) {
|
|
309
|
+
width: var(--ty-wizard-width, 100%);
|
|
310
|
+
height: 100%;
|
|
311
|
+
flex-shrink: 0;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/* ===================================== */
|
|
315
|
+
/* Accessibility & Motion Preferences */
|
|
316
|
+
/* ===================================== */
|
|
317
|
+
|
|
318
|
+
@media (prefers-reduced-motion: reduce) {
|
|
319
|
+
.panels-wrapper {
|
|
320
|
+
transition-duration: 0ms !important;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.progress-overlay {
|
|
324
|
+
transition-duration: 0ms !important;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.step-circle {
|
|
328
|
+
transition-duration: 0ms !important;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.progress-line {
|
|
332
|
+
transition-duration: 0ms !important;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.sr-only {
|
|
337
|
+
position: absolute;
|
|
338
|
+
width: 1px;
|
|
339
|
+
height: 1px;
|
|
340
|
+
padding: 0;
|
|
341
|
+
margin: -1px;
|
|
342
|
+
overflow: hidden;
|
|
343
|
+
clip: rect(0, 0, 0, 0);
|
|
344
|
+
white-space: nowrap;
|
|
345
|
+
border-width: 0;
|
|
346
|
+
}
|
|
347
|
+
`;
|
|
348
|
+
//# sourceMappingURL=wizard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wizard.js","sourceRoot":"","sources":["../../src/styles/wizard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmU3B,CAAC"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ty Component Common Types
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Built-in semantic color flavor names. Append `+` for a stronger shade or `-`
|
|
6
|
+
* for a softer shade — e.g. `primary`, `primary+`, `primary-`. Matches the
|
|
7
|
+
* design system's `ty-bg-primary+` / `ty-text-primary-` class convention.
|
|
8
|
+
*/
|
|
9
|
+
export type FlavorBase = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'neutral';
|
|
10
|
+
/**
|
|
11
|
+
* A flavor with optional shade suffix: `primary | primary+ | primary-`.
|
|
12
|
+
*/
|
|
13
|
+
export type FlavorShaded<F extends string = FlavorBase> = F | `${F}+` | `${F}-`;
|
|
14
|
+
/**
|
|
15
|
+
* Semantic color flavors used throughout Ty components.
|
|
16
|
+
*
|
|
17
|
+
* Built-in flavors get themed styles. Add `+` / `-` for a stronger / softer
|
|
18
|
+
* shade. Any other string is also accepted — pass a custom flavor name and
|
|
19
|
+
* theme it via `--ty-button-*` (or component-specific) CSS variables on the
|
|
20
|
+
* host. The `(string & {})` keeps editor autocomplete on the literals while
|
|
21
|
+
* leaving the type open.
|
|
22
|
+
*/
|
|
23
|
+
export type Flavor = FlavorShaded | (string & {});
|
|
24
|
+
/** Component size variants */
|
|
25
|
+
export type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
26
|
+
/** Input types supported by ty-input */
|
|
27
|
+
export type InputType = 'text' | 'password' | 'email' | 'url' | 'tel' | 'date' | 'time' | 'datetime-local' | 'number' | 'currency' | 'percent' | 'compact' | 'checkbox';
|
|
28
|
+
/** Base properties shared by all Ty components */
|
|
29
|
+
export interface TyBaseElement extends HTMLElement {
|
|
30
|
+
/** Semantic color flavor */
|
|
31
|
+
flavor?: Flavor;
|
|
32
|
+
}
|
|
33
|
+
/** Button appearance variant */
|
|
34
|
+
export type ButtonAppearance = 'solid' | 'outlined' | 'ghost';
|
|
35
|
+
/** Button component interface */
|
|
36
|
+
export interface TyButtonElement extends TyBaseElement {
|
|
37
|
+
/** Button size */
|
|
38
|
+
size?: Size;
|
|
39
|
+
/** Visual appearance: solid (filled, default), outlined (border only), ghost (text only) */
|
|
40
|
+
appearance?: ButtonAppearance;
|
|
41
|
+
/** Disabled state */
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
/** Pill shape (fully rounded) */
|
|
44
|
+
pill?: boolean;
|
|
45
|
+
/** Action (icon-only square) */
|
|
46
|
+
action?: boolean;
|
|
47
|
+
/** Full-width */
|
|
48
|
+
wide?: boolean;
|
|
49
|
+
/** Button type for forms */
|
|
50
|
+
type?: 'button' | 'submit' | 'reset';
|
|
51
|
+
}
|
|
52
|
+
/** CSS style content */
|
|
53
|
+
/** Icon size variants */
|
|
54
|
+
export type IconSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '12' | '14' | '16' | '18' | '20' | '24' | '32' | '48' | '64' | '80' | '96';
|
|
55
|
+
/** Icon animation tempo */
|
|
56
|
+
export type IconTempo = 'slow' | 'fast';
|
|
57
|
+
/** Icon component interface */
|
|
58
|
+
export interface TyIconElement extends HTMLElement {
|
|
59
|
+
/** Icon name to display */
|
|
60
|
+
name?: string;
|
|
61
|
+
/** Icon size */
|
|
62
|
+
size?: IconSize;
|
|
63
|
+
/** Spin animation */
|
|
64
|
+
spin?: boolean;
|
|
65
|
+
/** Pulse animation */
|
|
66
|
+
pulse?: boolean;
|
|
67
|
+
/** Animation tempo */
|
|
68
|
+
tempo?: IconTempo;
|
|
69
|
+
}
|
|
70
|
+
/** Tag component custom event detail */
|
|
71
|
+
export interface TyTagEventDetail {
|
|
72
|
+
/** Target tag element */
|
|
73
|
+
target: HTMLElement;
|
|
74
|
+
}
|
|
75
|
+
/** Tag component interface */
|
|
76
|
+
export interface TyTagElement extends TyBaseElement {
|
|
77
|
+
/** Tag value */
|
|
78
|
+
value?: string;
|
|
79
|
+
/** Tag size */
|
|
80
|
+
size?: Size;
|
|
81
|
+
/** Selected state */
|
|
82
|
+
selected?: boolean;
|
|
83
|
+
/** Pill shape (fully rounded) - default true */
|
|
84
|
+
pill?: boolean;
|
|
85
|
+
/** Clickable state */
|
|
86
|
+
clickable?: boolean;
|
|
87
|
+
/** Dismissible state */
|
|
88
|
+
dismissible?: boolean;
|
|
89
|
+
/** Disabled state */
|
|
90
|
+
disabled?: boolean;
|
|
91
|
+
}
|
|
92
|
+
/** Option component interface - omit 'hidden' from HTMLElement to avoid conflict */
|
|
93
|
+
export interface TyOptionElement extends Omit<HTMLElement, 'hidden'> {
|
|
94
|
+
/** Option value */
|
|
95
|
+
value?: string;
|
|
96
|
+
/** Selected state */
|
|
97
|
+
selected?: boolean;
|
|
98
|
+
/** Disabled state */
|
|
99
|
+
disabled?: boolean;
|
|
100
|
+
/** Highlighted state (keyboard navigation) */
|
|
101
|
+
highlighted?: boolean;
|
|
102
|
+
/** Hidden state - overrides HTMLElement's hidden */
|
|
103
|
+
hidden?: boolean;
|
|
104
|
+
}
|
|
105
|
+
/** Input component interface */
|
|
106
|
+
export interface TyInputElement extends TyBaseElement {
|
|
107
|
+
/** Input type */
|
|
108
|
+
type?: InputType;
|
|
109
|
+
/** Input value */
|
|
110
|
+
value?: string;
|
|
111
|
+
/** Input name (for forms) */
|
|
112
|
+
name?: string;
|
|
113
|
+
/** Placeholder text */
|
|
114
|
+
placeholder?: string;
|
|
115
|
+
/** Label text */
|
|
116
|
+
label?: string;
|
|
117
|
+
/** Disabled state */
|
|
118
|
+
disabled?: boolean;
|
|
119
|
+
/** Required field */
|
|
120
|
+
required?: boolean;
|
|
121
|
+
/** Error message */
|
|
122
|
+
error?: string;
|
|
123
|
+
/** Input size */
|
|
124
|
+
size?: Size;
|
|
125
|
+
/** Associated form */
|
|
126
|
+
readonly form?: HTMLFormElement | null;
|
|
127
|
+
/** Currency code for currency type (e.g., 'USD', 'EUR', 'HRK') */
|
|
128
|
+
currency?: string;
|
|
129
|
+
/** Locale for formatting (e.g., 'en-US', 'hr-HR') */
|
|
130
|
+
locale?: string;
|
|
131
|
+
/** Number of decimal places */
|
|
132
|
+
precision?: number | string;
|
|
133
|
+
/** Debounce in milliseconds before firing input/change events (0-5000ms) */
|
|
134
|
+
debounce?: number | string;
|
|
135
|
+
}
|
|
136
|
+
/** CSS style content */
|
|
137
|
+
export interface StyleContent {
|
|
138
|
+
/** CSS text content */
|
|
139
|
+
css: string;
|
|
140
|
+
/** Optional style ID for caching */
|
|
141
|
+
id?: string;
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,WAAW,GACX,SAAS,GACT,QAAQ,GACR,SAAS,GACT,SAAS,CAAA;AAEb;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,GAAG,UAAU,IAAI,CAAC,GAAG,GAAG,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ilities
|
|
3
|
+
*
|
|
4
|
+
* Pure TypeScript utilities for calendar month generation and localization.
|
|
5
|
+
* Ported from ClojureScript ty/date/core.cljs
|
|
6
|
+
*
|
|
7
|
+
* Key Features:
|
|
8
|
+
* - 42-day calendar grid generation (6 weeks × 7 days)
|
|
9
|
+
* - Monday-first week ordering
|
|
10
|
+
* - Rich day context with metadata
|
|
11
|
+
* - Localized weekday names
|
|
12
|
+
* - No external dependencies (native Date API only)
|
|
13
|
+
*
|
|
14
|
+
* Note on Timestamps:
|
|
15
|
+
* - `value`: UTC timestamp at midnight UTC (timezone-independent, use for storage/server)
|
|
16
|
+
* - `localValue`: Local timestamp at midnight local time (use for display/local calculations)
|
|
17
|
+
* - `year/month/dayInMonth`: Calendar date components (user's mental model)
|
|
18
|
+
*
|
|
19
|
+
* Example for October 13, 2025:
|
|
20
|
+
* - value = Date.UTC(2025, 9, 13) = consistent worldwide
|
|
21
|
+
* - localValue = new Date(2025, 9, 13).getTime() = varies by timezone
|
|
22
|
+
* - Both represent the same calendar date, different moments in time
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Rich context for a single calendar day
|
|
26
|
+
* Contains all metadata needed for rendering and event handling
|
|
27
|
+
*/
|
|
28
|
+
export interface DayContext {
|
|
29
|
+
/** Timestamp in milliseconds (UTC midnight) - use for server communication and storage */
|
|
30
|
+
value: number;
|
|
31
|
+
/** Timestamp in milliseconds (local midnight) - use for local calculations and display */
|
|
32
|
+
localValue: number;
|
|
33
|
+
/** Year (e.g., 2025) */
|
|
34
|
+
year: number;
|
|
35
|
+
/** Month (1-12, 1 = January) */
|
|
36
|
+
month: number;
|
|
37
|
+
/** Day of month (1-31) */
|
|
38
|
+
dayInMonth: number;
|
|
39
|
+
/** Is this a weekend day? (Saturday or Sunday) */
|
|
40
|
+
weekend: boolean;
|
|
41
|
+
/** Is this day from a different month? */
|
|
42
|
+
otherMonth: boolean;
|
|
43
|
+
/** Is this from the previous month? */
|
|
44
|
+
prevMonth?: boolean;
|
|
45
|
+
/** Is this from the next month? */
|
|
46
|
+
nextMonth?: boolean;
|
|
47
|
+
/** Is this today? */
|
|
48
|
+
today?: boolean;
|
|
49
|
+
/** Is this a holiday? (extensible for future use) */
|
|
50
|
+
holiday?: boolean;
|
|
51
|
+
/** Is this day selected? (from calendar's internal state) */
|
|
52
|
+
isSelected?: boolean;
|
|
53
|
+
/** Calendar's selected year (if any) */
|
|
54
|
+
selectedYear?: number;
|
|
55
|
+
/** Calendar's selected month (if any) */
|
|
56
|
+
selectedMonth?: number;
|
|
57
|
+
/** Calendar's selected day (if any) */
|
|
58
|
+
selectedDay?: number;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Generate a 42-day calendar grid for a given month
|
|
62
|
+
*
|
|
63
|
+
* Returns 6 weeks (42 days) starting from the Monday at or before
|
|
64
|
+
* the first day of the month. This ensures a complete calendar view
|
|
65
|
+
* with days from the previous and next months as needed.
|
|
66
|
+
*
|
|
67
|
+
* @param year - Year (e.g., 2025)
|
|
68
|
+
* @param month - Month (1-12, 1 = January)
|
|
69
|
+
* @param selection - Optional selection state to include in day contexts
|
|
70
|
+
* @returns Array of 42 day contexts with rich metadata
|
|
71
|
+
*
|
|
72
|
+
* @throws {RangeError} If year or month are invalid
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* const days = getCalendarMonthDays(2025, 10); // October 2025
|
|
76
|
+
* console.log(days.length); // 42
|
|
77
|
+
* console.log(days[0].dayInMonth); // First day shown (might be from September)
|
|
78
|
+
*/
|
|
79
|
+
export declare function getCalendarMonthDays(year: number, month: number, selection?: {
|
|
80
|
+
year?: number;
|
|
81
|
+
month?: number;
|
|
82
|
+
day?: number;
|
|
83
|
+
}): DayContext[];
|
|
84
|
+
/**
|
|
85
|
+
* Get localized weekday names in Monday-first order
|
|
86
|
+
*
|
|
87
|
+
* Note: Intl.DateTimeFormat returns Sunday-first by default,
|
|
88
|
+
* so we reorder to Monday-first: [Mon, Tue, Wed, Thu, Fri, Sat, Sun]
|
|
89
|
+
*
|
|
90
|
+
* @param locale - Locale string (e.g., "en-US", "de-DE", "ja-JP")
|
|
91
|
+
* @param style - Display style: "long" (Monday), "short" (Mon), "narrow" (M)
|
|
92
|
+
* @returns Array of 7 weekday names starting with Monday
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* getLocalizedWeekdays("en-US", "short")
|
|
96
|
+
* // Returns: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
|
|
97
|
+
*
|
|
98
|
+
* getLocalizedWeekdays("de-DE", "long")
|
|
99
|
+
* // Returns: ["Montag", "Dienstag", "Mittwoch", ...]
|
|
100
|
+
*/
|
|
101
|
+
export declare function getLocalizedWeekdays(locale: string, style?: 'long' | 'short' | 'narrow'): string[];
|
|
102
|
+
/**
|
|
103
|
+
* Get month name in specified locale
|
|
104
|
+
*
|
|
105
|
+
* @param month - Month (1-12)
|
|
106
|
+
* @param locale - Locale string
|
|
107
|
+
* @param style - Display style
|
|
108
|
+
* @returns Localized month name
|
|
109
|
+
*
|
|
110
|
+
* @throws {RangeError} If month is invalid
|
|
111
|
+
*/
|
|
112
|
+
export declare function getMonthName(month: number, locale?: string, style?: 'long' | 'short' | 'narrow'): string;
|
|
113
|
+
/**
|
|
114
|
+
* Format a day context as an ISO date string
|
|
115
|
+
*
|
|
116
|
+
* @param dayContext - Day context to format
|
|
117
|
+
* @returns ISO date string (YYYY-MM-DD)
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* formatDayContext({ year: 2025, month: 10, dayInMonth: 13, ... })
|
|
121
|
+
* // Returns: "2025-10-13"
|
|
122
|
+
*/
|
|
123
|
+
export declare function formatDayContext(dayContext: DayContext): string;
|
|
124
|
+
/**
|
|
125
|
+
* Check if a day context matches a specific date
|
|
126
|
+
*
|
|
127
|
+
* @param dayContext - Day context to check
|
|
128
|
+
* @param year - Target year
|
|
129
|
+
* @param month - Target month (1-12)
|
|
130
|
+
* @param day - Target day
|
|
131
|
+
* @returns True if the day context matches
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
* isDayContext(dayCtx, 2025, 10, 13) // true if context is Oct 13, 2025
|
|
135
|
+
*/
|
|
136
|
+
export declare function isDayContext(dayContext: DayContext, year: number, month: number, day: number): boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Parse an ISO date string (YYYY-MM-DD) into year, month, day components
|
|
139
|
+
*
|
|
140
|
+
* @param isoString - ISO date string (YYYY-MM-DD)
|
|
141
|
+
* @returns Object with year, month (1-12), and day, or null if invalid
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* parseISODate("2025-10-13")
|
|
145
|
+
* // Returns: { year: 2025, month: 10, day: 13 }
|
|
146
|
+
*/
|
|
147
|
+
export declare function parseISODate(isoString: string): {
|
|
148
|
+
year: number;
|
|
149
|
+
month: number;
|
|
150
|
+
day: number;
|
|
151
|
+
} | null;
|
|
152
|
+
/**
|
|
153
|
+
* Convert a UTC timestamp to an ISO date string
|
|
154
|
+
* Interprets the timestamp as UTC midnight and returns the date
|
|
155
|
+
*
|
|
156
|
+
* @param utcTimestamp - UTC timestamp in milliseconds
|
|
157
|
+
* @returns ISO date string (YYYY-MM-DD)
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* const ctx = getCalendarMonthDays(2025, 10)[0];
|
|
161
|
+
* utcTimestampToISO(ctx.value) // "2025-10-13"
|
|
162
|
+
*/
|
|
163
|
+
export declare function utcTimestampToISO(utcTimestamp: number): string;
|
|
164
|
+
/**
|
|
165
|
+
* Convert a local timestamp to an ISO date string
|
|
166
|
+
* Interprets the timestamp in local timezone and returns the date
|
|
167
|
+
*
|
|
168
|
+
* @param localTimestamp - Local timestamp in milliseconds
|
|
169
|
+
* @returns ISO date string (YYYY-MM-DD)
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* const ctx = getCalendarMonthDays(2025, 10)[0];
|
|
173
|
+
* localTimestampToISO(ctx.localValue) // "2025-10-13"
|
|
174
|
+
*/
|
|
175
|
+
export declare function localTimestampToISO(localTimestamp: number): string;
|
|
176
|
+
//# sourceMappingURL=calendar-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-utils.d.ts","sourceRoot":"","sources":["../../src/utils/calendar-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAMH;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,0FAA0F;IAC1F,KAAK,EAAE,MAAM,CAAC;IAEd,0FAA0F;IAC1F,UAAU,EAAE,MAAM,CAAC;IAEnB,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAC;IAEb,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IAEd,0BAA0B;IAC1B,UAAU,EAAE,MAAM,CAAC;IAEnB,kDAAkD;IAClD,OAAO,EAAE,OAAO,CAAC;IAEjB,0CAA0C;IAC1C,UAAU,EAAE,OAAO,CAAC;IAEpB,uCAAuC;IACvC,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,mCAAmC;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,qBAAqB;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,qDAAqD;IACrD,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,wCAAwC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,yCAAyC;IACzC,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAiND;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,SAAS,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MA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