tyrell-components 1.0.0-RC6
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.css +1783 -0
- package/dist/tyrell.css +1783 -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 +126 -0
- package/lib/components/button.d.ts.map +1 -0
- package/lib/components/button.js +244 -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 +402 -0
- package/lib/components/dropdown.d.ts.map +1 -0
- package/lib/components/dropdown.js +1552 -0
- package/lib/components/dropdown.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 +58 -0
- package/lib/components/modal.d.ts.map +1 -0
- package/lib/components/modal.js +473 -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 +1580 -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 +78 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +71 -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 +457 -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 +435 -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 +983 -0
- package/lib/styles/dropdown.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 +774 -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 +420 -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 +136 -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 +325 -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/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 +159 -0
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wizard Component Styles
|
|
3
|
+
*
|
|
4
|
+
* Styles for the ty-wizard container component including:
|
|
5
|
+
* - Flexbox layout with step indicators and content carousel
|
|
6
|
+
* - Progress line with animated completion overlay
|
|
7
|
+
* - Step circles with completed/active/pending states
|
|
8
|
+
* - Carousel viewport with transform animations
|
|
9
|
+
* - Responsive design with prefers-reduced-motion support
|
|
10
|
+
* - Fully customizable via CSS Parts (::part)
|
|
11
|
+
*
|
|
12
|
+
* Uses global design system tokens (no component-specific variables):
|
|
13
|
+
* - Surfaces: --ty-surface-floating, --ty-surface-content, --ty-surface-elevated
|
|
14
|
+
* - Colors: --ty-color-success, --ty-color-primary, --ty-color-danger
|
|
15
|
+
* - Borders: --ty-border, --ty-border-soft
|
|
16
|
+
* - Text: --ty-text, --ty-text-soft
|
|
17
|
+
*
|
|
18
|
+
* CSS Parts (for styling via ::part):
|
|
19
|
+
* - indicators-wrapper: The header containing step indicators
|
|
20
|
+
* - progress-line: The background progress track
|
|
21
|
+
* - step-circle: Individual step circle indicators
|
|
22
|
+
* - panels-container: The content viewport
|
|
23
|
+
*/
|
|
24
|
+
export const wizardStyles = `
|
|
25
|
+
:host {
|
|
26
|
+
display: block;
|
|
27
|
+
width: var(--wizard-width, 100%);
|
|
28
|
+
height: var(--wizard-height, 700px);
|
|
29
|
+
box-sizing: border-box;
|
|
30
|
+
/* Note: --step-circle-size is NOT set here to allow inheritance from light DOM.
|
|
31
|
+
Use fallbacks in var() calls instead. Set on ty-wizard element to customize. */
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.wizard-container {
|
|
35
|
+
width: 100%;
|
|
36
|
+
height: 100%;
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
position: relative;
|
|
40
|
+
box-sizing: border-box;
|
|
41
|
+
border-radius: 12px;
|
|
42
|
+
border: 1px solid var(--ty-border);
|
|
43
|
+
background: var(--ty-surface-floating);
|
|
44
|
+
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* ===================================== */
|
|
49
|
+
/* Step Indicators Wrapper */
|
|
50
|
+
/* Expose as CSS Part for full styling control */
|
|
51
|
+
/* ===================================== */
|
|
52
|
+
|
|
53
|
+
.step-indicators-wrapper {
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: column;
|
|
56
|
+
flex-shrink: 0;
|
|
57
|
+
position: relative;
|
|
58
|
+
padding: 24px 24px 16px;
|
|
59
|
+
border-bottom: 1px solid var(--ty-border-soft, var(--ty-border));
|
|
60
|
+
background: var(--ty-surface-content);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* ===================================== */
|
|
64
|
+
/* Progress Line (behind step circles) */
|
|
65
|
+
/* Expose as CSS Part for custom styling */
|
|
66
|
+
/* ===================================== */
|
|
67
|
+
|
|
68
|
+
.progress-line {
|
|
69
|
+
position: absolute;
|
|
70
|
+
/*
|
|
71
|
+
* With equal-width indicators (flex: 1), each takes 100%/N of the width.
|
|
72
|
+
* Circle centers are at: 50%/N, 150%/N, 250%/N, ... from left.
|
|
73
|
+
* Line spans from first center (50%/N) to last center (100% - 50%/N).
|
|
74
|
+
* Inset = 50% / step-count from each side.
|
|
75
|
+
*/
|
|
76
|
+
left: calc(50% / var(--step-count, 4));
|
|
77
|
+
right: calc(50% / var(--step-count, 4));
|
|
78
|
+
/* Vertically center with step circles - uses circle size variable */
|
|
79
|
+
top: calc(var(--step-circle-size, 32px) / 2 - 1px);
|
|
80
|
+
height: 2px;
|
|
81
|
+
background: var(--ty-border);
|
|
82
|
+
z-index: 0;
|
|
83
|
+
pointer-events: none;
|
|
84
|
+
transition: opacity var(--transition-duration, 300ms) var(--transition-easing, ease-in-out);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.progress-overlay {
|
|
88
|
+
position: absolute;
|
|
89
|
+
left: 0;
|
|
90
|
+
top: 0;
|
|
91
|
+
height: 100%;
|
|
92
|
+
background: var(--ty-color-success);
|
|
93
|
+
transition: width var(--transition-duration, 500ms) var(--transition-easing, ease-in-out);
|
|
94
|
+
will-change: width;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* ===================================== */
|
|
98
|
+
/* Step Indicators Container */
|
|
99
|
+
/* ===================================== */
|
|
100
|
+
|
|
101
|
+
.step-indicators {
|
|
102
|
+
display: flex;
|
|
103
|
+
align-items: flex-start;
|
|
104
|
+
position: relative;
|
|
105
|
+
/* No padding - let equal-width indicators fill the space */
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* ===================================== */
|
|
109
|
+
/* Individual Step Indicator */
|
|
110
|
+
/* Expose as CSS Part for step styling */
|
|
111
|
+
/* ===================================== */
|
|
112
|
+
|
|
113
|
+
.step-indicator {
|
|
114
|
+
display: flex;
|
|
115
|
+
flex-direction: column;
|
|
116
|
+
align-items: center;
|
|
117
|
+
gap: 8px;
|
|
118
|
+
cursor: pointer;
|
|
119
|
+
background: transparent;
|
|
120
|
+
border: none;
|
|
121
|
+
padding: 0;
|
|
122
|
+
font: inherit;
|
|
123
|
+
transition: opacity 200ms;
|
|
124
|
+
/* Equal width for all indicators - makes progress line alignment predictable */
|
|
125
|
+
flex: 1;
|
|
126
|
+
min-width: 0;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.step-indicator[aria-disabled="true"] {
|
|
130
|
+
opacity: 0.4;
|
|
131
|
+
cursor: not-allowed;
|
|
132
|
+
pointer-events: none;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.step-indicator:focus-visible {
|
|
136
|
+
outline: 2px solid var(--ty-color-primary);
|
|
137
|
+
outline-offset: 4px;
|
|
138
|
+
border-radius: 50%;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* ===================================== */
|
|
142
|
+
/* Step Circle - Smaller, cleaner */
|
|
143
|
+
/* Expose as CSS Part for circle styling */
|
|
144
|
+
/* ===================================== */
|
|
145
|
+
|
|
146
|
+
.step-circle {
|
|
147
|
+
/* Circle size - set --step-circle-size on ty-wizard element to customize */
|
|
148
|
+
width: var(--step-circle-size, 32px);
|
|
149
|
+
height: var(--step-circle-size, 32px);
|
|
150
|
+
border-radius: 50%;
|
|
151
|
+
border: 2px solid;
|
|
152
|
+
display: flex;
|
|
153
|
+
align-items: center;
|
|
154
|
+
justify-content: center;
|
|
155
|
+
position: relative;
|
|
156
|
+
z-index: 10;
|
|
157
|
+
transition: all var(--transition-duration, 300ms) var(--transition-easing, ease-in-out);
|
|
158
|
+
box-sizing: border-box;
|
|
159
|
+
flex-shrink: 0;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/* Completed state - green with success glow */
|
|
163
|
+
.step-circle[data-state="completed"] {
|
|
164
|
+
background: var(--ty-color-success);
|
|
165
|
+
border-color: var(--ty-color-success-600, var(--ty-color-success));
|
|
166
|
+
color: white;
|
|
167
|
+
box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/* Active state - primary with primary glow */
|
|
171
|
+
.step-circle[data-state="active"] {
|
|
172
|
+
background: var(--ty-color-primary);
|
|
173
|
+
border-color: var(--ty-color-primary-600, var(--ty-color-primary));
|
|
174
|
+
color: white;
|
|
175
|
+
box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/* Pending state - neutral gray */
|
|
179
|
+
.step-circle[data-state="pending"] {
|
|
180
|
+
background: var(--ty-surface-elevated, #f3f4f6);
|
|
181
|
+
border-color: var(--ty-border, #d1d5db);
|
|
182
|
+
color: var(--ty-text-soft, #6b7280);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/* Error state - red with danger glow */
|
|
186
|
+
.step-circle[data-state="error"] {
|
|
187
|
+
background: var(--ty-color-danger, #ef4444);
|
|
188
|
+
border-color: var(--ty-color-danger-600, #dc2626);
|
|
189
|
+
color: white;
|
|
190
|
+
box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/* ===================================== */
|
|
194
|
+
/* Step Text Container */
|
|
195
|
+
/* Wraps label and description */
|
|
196
|
+
/* ===================================== */
|
|
197
|
+
|
|
198
|
+
.step-text {
|
|
199
|
+
display: flex;
|
|
200
|
+
flex-direction: column;
|
|
201
|
+
gap: 2px;
|
|
202
|
+
align-items: center;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/* ===================================== */
|
|
206
|
+
/* Step Label - Main title */
|
|
207
|
+
/* ===================================== */
|
|
208
|
+
|
|
209
|
+
.step-label {
|
|
210
|
+
font-size: var(--ty-font-sm, 14px);
|
|
211
|
+
font-weight: var(--ty-font-semibold, 600);
|
|
212
|
+
color: var(--ty-text, inherit);
|
|
213
|
+
transition: color 200ms;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.step-indicator[aria-selected="true"] .step-label {
|
|
217
|
+
color: var(--ty-text-strong, inherit);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.step-indicator[aria-selected="false"] .step-label {
|
|
221
|
+
color: var(--ty-text-soft, inherit);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/* ===================================== */
|
|
225
|
+
/* Step Description - Subtitle */
|
|
226
|
+
/* ===================================== */
|
|
227
|
+
|
|
228
|
+
.step-description {
|
|
229
|
+
font-size: var(--ty-font-xs, 12px);
|
|
230
|
+
font-weight: var(--ty-font-normal, 400);
|
|
231
|
+
color: var(--ty-text-soft, #9ca3af);
|
|
232
|
+
transition: color 200ms;
|
|
233
|
+
text-align: center;
|
|
234
|
+
max-width: 120px;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.step-indicator[aria-selected="true"] .step-description {
|
|
238
|
+
color: var(--ty-text, inherit);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/* ===================================== */
|
|
242
|
+
/* Custom Indicator Content via Slots */
|
|
243
|
+
/* ===================================== */
|
|
244
|
+
|
|
245
|
+
::slotted([slot^="indicator-"]) {
|
|
246
|
+
display: flex;
|
|
247
|
+
align-items: center;
|
|
248
|
+
justify-content: center;
|
|
249
|
+
width: 100%;
|
|
250
|
+
height: 100%;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/* ===================================== */
|
|
254
|
+
/* Panels Viewport */
|
|
255
|
+
/* Expose as CSS Part for panels container styling */
|
|
256
|
+
/* ===================================== */
|
|
257
|
+
|
|
258
|
+
.panels-viewport {
|
|
259
|
+
position: relative;
|
|
260
|
+
flex: 1;
|
|
261
|
+
overflow: hidden;
|
|
262
|
+
/* Critical: hides off-screen panels */
|
|
263
|
+
min-height: 0;
|
|
264
|
+
/* Allows flex child to shrink */
|
|
265
|
+
background: var(--ty-surface-elevated);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/* ===================================== */
|
|
269
|
+
/* Panels Wrapper (slides horizontally) */
|
|
270
|
+
/* ===================================== */
|
|
271
|
+
|
|
272
|
+
.panels-wrapper {
|
|
273
|
+
display: flex;
|
|
274
|
+
height: 100%;
|
|
275
|
+
transition: transform var(--transition-duration, 300ms) var(--transition-easing, ease-in-out);
|
|
276
|
+
will-change: transform;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/* ===================================== */
|
|
280
|
+
/* Slotted Step Panels */
|
|
281
|
+
/* ===================================== */
|
|
282
|
+
|
|
283
|
+
::slotted(ty-step) {
|
|
284
|
+
width: var(--wizard-width, 100%);
|
|
285
|
+
height: 100%;
|
|
286
|
+
flex-shrink: 0;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/* ===================================== */
|
|
290
|
+
/* Accessibility & Motion Preferences */
|
|
291
|
+
/* ===================================== */
|
|
292
|
+
|
|
293
|
+
/* Respect user's motion preferences */
|
|
294
|
+
@media (prefers-reduced-motion: reduce) {
|
|
295
|
+
.panels-wrapper {
|
|
296
|
+
transition-duration: 0ms !important;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.progress-overlay {
|
|
300
|
+
transition-duration: 0ms !important;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.step-circle {
|
|
304
|
+
transition-duration: 0ms !important;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.progress-line {
|
|
308
|
+
transition-duration: 0ms !important;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/* Screen reader only content */
|
|
313
|
+
.sr-only {
|
|
314
|
+
position: absolute;
|
|
315
|
+
width: 1px;
|
|
316
|
+
height: 1px;
|
|
317
|
+
padding: 0;
|
|
318
|
+
margin: -1px;
|
|
319
|
+
overflow: hidden;
|
|
320
|
+
clip: rect(0, 0, 0, 0);
|
|
321
|
+
white-space: nowrap;
|
|
322
|
+
border-width: 0;
|
|
323
|
+
}
|
|
324
|
+
`;
|
|
325
|
+
//# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4S3B,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,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAA;AAE/E;;;;;;;;GAQG;AACH,MAAM,MAAM,MAAM,GAAG,Y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ACjB;AAED,gCAAgC;AAChC,MAAM,WAAW,cAAe,SAAQ,aAAa;IACnD,iBAAiB;IACjB,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,kBAAkB;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,6BAA6B;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,iBAAiB;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,oBAAoB;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iBAAiB;IACjB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,sBAAsB;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,IAAI,CAAA;IAGtC,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,+BAA+B;IAC/B,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAG3B,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAC3B;AAED,wBAAwB;AACxB,MAAM,WAAW,YAAY;IAC3B,uBAAuB;IACvB,GAAG,EAAE,MAAM,CAAA;IACX,oCAAoC;IACpC,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calendar Utilities
|
|
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
|
+
//# sourceMapp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