glassdate-rn 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,158 @@
1
+ import React from 'react';
2
+
3
+ /**
4
+ * GlassDateTokens — generated from packages/tokens/schema/tokens.schema.json
5
+ * Do not edit by hand.
6
+ */
7
+ type DeepPartial<T> = T extends object ? {
8
+ [P in keyof T]?: DeepPartial<T[P]>;
9
+ } : T;
10
+ interface SceneTokens {
11
+ backgroundColour: string;
12
+ }
13
+ interface ContainerTokens {
14
+ backgroundColour: string;
15
+ borderColour: string;
16
+ borderWidth: number;
17
+ cornerRadius: number;
18
+ shadowColour: string;
19
+ shadowOffsetX: number;
20
+ shadowOffsetY: number;
21
+ shadowBlurRadius: number;
22
+ shadowOpacity: number;
23
+ blurRadius: number;
24
+ }
25
+ interface PillTokens {
26
+ backgroundColour: string;
27
+ borderColour: string;
28
+ borderWidth: number;
29
+ cornerRadius: number;
30
+ textColour: string;
31
+ fontWeight: number;
32
+ hoverBackgroundColour: string;
33
+ todayBackgroundColour: string;
34
+ todayBorderColour: string;
35
+ todayTextColour: string;
36
+ }
37
+ interface PopupTokens {
38
+ backgroundColour: string;
39
+ borderColour: string;
40
+ borderWidth: number;
41
+ cornerRadius: number;
42
+ itemTextColour: string;
43
+ itemFontWeight: number;
44
+ itemHoverBackgroundColour: string;
45
+ itemActiveBackgroundColour: string;
46
+ itemActiveTextColour: string;
47
+ itemSelectedBackgroundColour: string;
48
+ itemSelectedTextColour: string;
49
+ itemDisabledOpacity: number;
50
+ }
51
+ interface NavTokens {
52
+ backgroundColour: string;
53
+ borderColour: string;
54
+ borderWidth: number;
55
+ cornerRadius: number;
56
+ arrowColour: string;
57
+ hoverBackgroundColour: string;
58
+ disabledOpacity: number;
59
+ }
60
+ interface GridTokens {
61
+ weekdayLabelColour: string;
62
+ weekdayFontWeight: number;
63
+ dayTextColour: string;
64
+ dayFontWeight: number;
65
+ dayHoverBackgroundColour: string;
66
+ daySelectedBackgroundColour: string;
67
+ daySelectedTextColour: string;
68
+ dayTodayFontWeight: number;
69
+ dayTodayDotColour: string;
70
+ dayOutOfRangeOpacity: number;
71
+ dayAdjacentMonthOpacity: number;
72
+ }
73
+ interface FooterTokens {
74
+ cancelBackgroundColour: string;
75
+ cancelBorderColour: string;
76
+ cancelBorderWidth: number;
77
+ cancelTextColour: string;
78
+ cancelCornerRadius: number;
79
+ cancelHoverBackgroundColour: string;
80
+ confirmBackgroundColour: string;
81
+ confirmBorderColour: string;
82
+ confirmBorderWidth: number;
83
+ confirmTextColour: string;
84
+ confirmCornerRadius: number;
85
+ confirmHoverBackgroundColour: string;
86
+ disabledOpacity: number;
87
+ selectedDateTextColour: string;
88
+ }
89
+ interface MetaTokens {
90
+ name: string;
91
+ mode: 'dark' | 'light' | 'single';
92
+ defaultAccent: string;
93
+ }
94
+ interface GlassDateTokens {
95
+ scene: SceneTokens;
96
+ container: ContainerTokens;
97
+ pill: PillTokens;
98
+ popup: PopupTokens;
99
+ nav: NavTokens;
100
+ grid: GridTokens;
101
+ footer: FooterTokens;
102
+ meta: MetaTokens;
103
+ }
104
+ type ThemeKey = 'default' | 'ios-liquid' | 'material3' | 'toon' | 'flat' | 'plain' | 'mono';
105
+ type ConstraintPreset$1 = 'none' | 'birthday' | 'adult' | 'future' | 'custom';
106
+ type DayShape = 'circle' | 'round-square' | 'subtle';
107
+ type OpenDropdown = 'none' | 'month' | 'year';
108
+
109
+ interface GlassDatePickerProps {
110
+ value?: Date | null;
111
+ hintDate?: Date;
112
+ onChange?: (date: Date) => void;
113
+ onConfirm?: (date: Date) => void;
114
+ onCancel?: () => void;
115
+ constraint?: ConstraintPreset$1;
116
+ minDate?: Date;
117
+ maxDate?: Date;
118
+ yearRange?: number;
119
+ theme?: ThemeKey;
120
+ colorScheme?: 'dark' | 'light' | 'auto';
121
+ accent?: string;
122
+ dayShape?: DayShape;
123
+ tokens?: DeepPartial<GlassDateTokens>;
124
+ firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
125
+ monthNames?: [
126
+ string,
127
+ string,
128
+ string,
129
+ string,
130
+ string,
131
+ string,
132
+ string,
133
+ string,
134
+ string,
135
+ string,
136
+ string,
137
+ string
138
+ ];
139
+ confirmLabel?: (date: Date) => string;
140
+ placeholderLabel?: string;
141
+ showSelectedDate?: boolean;
142
+ selectedDateLabel?: (date: Date) => string;
143
+ }
144
+ declare function GlassDatePicker({ value, hintDate, onChange, onConfirm, onCancel, constraint, minDate, maxDate, yearRange, theme, colorScheme: colorSchemeProp, accent, dayShape, tokens: tokenOverrides, firstDayOfWeek: firstDayOfWeekProp, monthNames: monthNamesProp, confirmLabel: confirmLabelProp, placeholderLabel: placeholderLabelProp, showSelectedDate, selectedDateLabel: selectedDateLabelProp, }: GlassDatePickerProps): React.ReactElement;
145
+
146
+ type ConstraintPreset = 'none' | 'birthday' | 'adult' | 'future' | 'custom';
147
+ interface ConstraintConfig {
148
+ preset: ConstraintPreset;
149
+ minDate?: Date;
150
+ maxDate?: Date;
151
+ yearRange?: number;
152
+ }
153
+ interface ConstraintBounds {
154
+ minDate: Date;
155
+ maxDate: Date;
156
+ }
157
+
158
+ export { type ConstraintBounds, type ConstraintConfig, type ConstraintPreset$1 as ConstraintPreset, type DayShape, type DeepPartial, GlassDatePicker, type GlassDatePickerProps, type GlassDateTokens, type OpenDropdown, type ThemeKey };
@@ -0,0 +1,158 @@
1
+ import React from 'react';
2
+
3
+ /**
4
+ * GlassDateTokens — generated from packages/tokens/schema/tokens.schema.json
5
+ * Do not edit by hand.
6
+ */
7
+ type DeepPartial<T> = T extends object ? {
8
+ [P in keyof T]?: DeepPartial<T[P]>;
9
+ } : T;
10
+ interface SceneTokens {
11
+ backgroundColour: string;
12
+ }
13
+ interface ContainerTokens {
14
+ backgroundColour: string;
15
+ borderColour: string;
16
+ borderWidth: number;
17
+ cornerRadius: number;
18
+ shadowColour: string;
19
+ shadowOffsetX: number;
20
+ shadowOffsetY: number;
21
+ shadowBlurRadius: number;
22
+ shadowOpacity: number;
23
+ blurRadius: number;
24
+ }
25
+ interface PillTokens {
26
+ backgroundColour: string;
27
+ borderColour: string;
28
+ borderWidth: number;
29
+ cornerRadius: number;
30
+ textColour: string;
31
+ fontWeight: number;
32
+ hoverBackgroundColour: string;
33
+ todayBackgroundColour: string;
34
+ todayBorderColour: string;
35
+ todayTextColour: string;
36
+ }
37
+ interface PopupTokens {
38
+ backgroundColour: string;
39
+ borderColour: string;
40
+ borderWidth: number;
41
+ cornerRadius: number;
42
+ itemTextColour: string;
43
+ itemFontWeight: number;
44
+ itemHoverBackgroundColour: string;
45
+ itemActiveBackgroundColour: string;
46
+ itemActiveTextColour: string;
47
+ itemSelectedBackgroundColour: string;
48
+ itemSelectedTextColour: string;
49
+ itemDisabledOpacity: number;
50
+ }
51
+ interface NavTokens {
52
+ backgroundColour: string;
53
+ borderColour: string;
54
+ borderWidth: number;
55
+ cornerRadius: number;
56
+ arrowColour: string;
57
+ hoverBackgroundColour: string;
58
+ disabledOpacity: number;
59
+ }
60
+ interface GridTokens {
61
+ weekdayLabelColour: string;
62
+ weekdayFontWeight: number;
63
+ dayTextColour: string;
64
+ dayFontWeight: number;
65
+ dayHoverBackgroundColour: string;
66
+ daySelectedBackgroundColour: string;
67
+ daySelectedTextColour: string;
68
+ dayTodayFontWeight: number;
69
+ dayTodayDotColour: string;
70
+ dayOutOfRangeOpacity: number;
71
+ dayAdjacentMonthOpacity: number;
72
+ }
73
+ interface FooterTokens {
74
+ cancelBackgroundColour: string;
75
+ cancelBorderColour: string;
76
+ cancelBorderWidth: number;
77
+ cancelTextColour: string;
78
+ cancelCornerRadius: number;
79
+ cancelHoverBackgroundColour: string;
80
+ confirmBackgroundColour: string;
81
+ confirmBorderColour: string;
82
+ confirmBorderWidth: number;
83
+ confirmTextColour: string;
84
+ confirmCornerRadius: number;
85
+ confirmHoverBackgroundColour: string;
86
+ disabledOpacity: number;
87
+ selectedDateTextColour: string;
88
+ }
89
+ interface MetaTokens {
90
+ name: string;
91
+ mode: 'dark' | 'light' | 'single';
92
+ defaultAccent: string;
93
+ }
94
+ interface GlassDateTokens {
95
+ scene: SceneTokens;
96
+ container: ContainerTokens;
97
+ pill: PillTokens;
98
+ popup: PopupTokens;
99
+ nav: NavTokens;
100
+ grid: GridTokens;
101
+ footer: FooterTokens;
102
+ meta: MetaTokens;
103
+ }
104
+ type ThemeKey = 'default' | 'ios-liquid' | 'material3' | 'toon' | 'flat' | 'plain' | 'mono';
105
+ type ConstraintPreset$1 = 'none' | 'birthday' | 'adult' | 'future' | 'custom';
106
+ type DayShape = 'circle' | 'round-square' | 'subtle';
107
+ type OpenDropdown = 'none' | 'month' | 'year';
108
+
109
+ interface GlassDatePickerProps {
110
+ value?: Date | null;
111
+ hintDate?: Date;
112
+ onChange?: (date: Date) => void;
113
+ onConfirm?: (date: Date) => void;
114
+ onCancel?: () => void;
115
+ constraint?: ConstraintPreset$1;
116
+ minDate?: Date;
117
+ maxDate?: Date;
118
+ yearRange?: number;
119
+ theme?: ThemeKey;
120
+ colorScheme?: 'dark' | 'light' | 'auto';
121
+ accent?: string;
122
+ dayShape?: DayShape;
123
+ tokens?: DeepPartial<GlassDateTokens>;
124
+ firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
125
+ monthNames?: [
126
+ string,
127
+ string,
128
+ string,
129
+ string,
130
+ string,
131
+ string,
132
+ string,
133
+ string,
134
+ string,
135
+ string,
136
+ string,
137
+ string
138
+ ];
139
+ confirmLabel?: (date: Date) => string;
140
+ placeholderLabel?: string;
141
+ showSelectedDate?: boolean;
142
+ selectedDateLabel?: (date: Date) => string;
143
+ }
144
+ declare function GlassDatePicker({ value, hintDate, onChange, onConfirm, onCancel, constraint, minDate, maxDate, yearRange, theme, colorScheme: colorSchemeProp, accent, dayShape, tokens: tokenOverrides, firstDayOfWeek: firstDayOfWeekProp, monthNames: monthNamesProp, confirmLabel: confirmLabelProp, placeholderLabel: placeholderLabelProp, showSelectedDate, selectedDateLabel: selectedDateLabelProp, }: GlassDatePickerProps): React.ReactElement;
145
+
146
+ type ConstraintPreset = 'none' | 'birthday' | 'adult' | 'future' | 'custom';
147
+ interface ConstraintConfig {
148
+ preset: ConstraintPreset;
149
+ minDate?: Date;
150
+ maxDate?: Date;
151
+ yearRange?: number;
152
+ }
153
+ interface ConstraintBounds {
154
+ minDate: Date;
155
+ maxDate: Date;
156
+ }
157
+
158
+ export { type ConstraintBounds, type ConstraintConfig, type ConstraintPreset$1 as ConstraintPreset, type DayShape, type DeepPartial, GlassDatePicker, type GlassDatePickerProps, type GlassDateTokens, type OpenDropdown, type ThemeKey };