@widgetic/editor 4.1.13 → 4.1.15
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/dist/components/PreviewChromeControls.svelte +15 -21
- package/dist/components/WidgetPreview.svelte +136 -105
- package/dist/components/color-select/ColorSelect.svelte +203 -224
- package/dist/components/color-select/constants.d.ts +4 -2
- package/dist/components/color-select/constants.js +4 -2
- package/dist/components/color-select/render.js +10 -9
- package/dist/components/editors/CompositionEditorApp.svelte +55 -40
- package/dist/components/editors/EditLeaseNotice.svelte +44 -33
- package/dist/components/editors/EmbedEditor.svelte +133 -259
- package/dist/components/editors/PropsEditor.svelte +426 -1333
- package/dist/components/editors/props-editor.css +5 -68
- package/dist/components/ic/AngleInputController.svelte +202 -277
- package/dist/components/ic/BrowserInputController.svelte +813 -803
- package/dist/components/ic/CheckboxInputController.svelte +92 -169
- package/dist/components/ic/CheckboxInputController.svelte.d.ts +2 -8
- package/dist/components/ic/ColorPickerInputController.svelte +1589 -1587
- package/dist/components/ic/ColorPickerInputController.svelte.d.ts +3 -3
- package/dist/components/ic/DateFieldInputController.svelte +455 -465
- package/dist/components/ic/DatePickerInputController.svelte +355 -368
- package/dist/components/ic/DatePickerInputController.svelte.d.ts +1 -1
- package/dist/components/ic/DropdownInputController.svelte +130 -200
- package/dist/components/ic/FixedPositionInputController.svelte +255 -276
- package/dist/components/ic/FixedPositionInputController.svelte.d.ts +5 -1
- package/dist/components/ic/FontInputController.svelte +2110 -2231
- package/dist/components/ic/FontInputController.svelte.d.ts +11 -11
- package/dist/components/ic/InputControllerHeader.svelte +141 -147
- package/dist/components/ic/InputControllerRenderer.svelte +5 -1
- package/dist/components/ic/InputControllerRenderer.svelte.d.ts +2 -1
- package/dist/components/ic/InputControllerRow.svelte +74 -0
- package/dist/components/ic/InputControllerRow.svelte.d.ts +14 -0
- package/dist/components/ic/KnowledgeDocumentsInputController.svelte +401 -0
- package/dist/components/ic/KnowledgeDocumentsInputController.svelte.d.ts +11 -0
- package/dist/components/ic/KnowledgeTextForm.svelte +109 -0
- package/dist/components/ic/KnowledgeTextForm.svelte.d.ts +15 -0
- package/dist/components/ic/NumberControls.svelte +303 -269
- package/dist/components/ic/NumberControls.svelte.d.ts +4 -1
- package/dist/components/ic/NumberInputController.svelte +361 -301
- package/dist/components/ic/NumberInputController.svelte.d.ts +2 -0
- package/dist/components/ic/PositionInputController.svelte +253 -176
- package/dist/components/ic/PositionInputController.svelte.d.ts +2 -0
- package/dist/components/ic/RadioGroupInputController.svelte +71 -137
- package/dist/components/ic/RadioGroupInputController.svelte.d.ts +2 -8
- package/dist/components/ic/RangeCalendarInputController.svelte +233 -270
- package/dist/components/ic/RangeCalendarInputController.svelte.d.ts +2 -2
- package/dist/components/ic/RoundedCornersInputController.svelte +412 -435
- package/dist/components/ic/RoundedCornersInputController.svelte.d.ts +2 -0
- package/dist/components/ic/SliderInputController.svelte +263 -332
- package/dist/components/ic/SliderInputController.svelte.d.ts +1 -1
- package/dist/components/ic/SliderRangeInputController.svelte +140 -144
- package/dist/components/ic/SliderRangeInputController.svelte.d.ts +3 -3
- package/dist/components/ic/SwitchInputController.svelte +47 -109
- package/dist/components/ic/TagsInputController.svelte +95 -110
- package/dist/components/ic/TextAreaInputController.svelte +1794 -1935
- package/dist/components/ic/TextAreaPreviewInputController.svelte +436 -438
- package/dist/components/ic/TextAreaPreviewInputController.svelte.d.ts +2 -2
- package/dist/components/ic/TextInputController.svelte +65 -75
- package/dist/components/ic/TextInputController.svelte.d.ts +2 -0
- package/dist/components/ic/TimeInputController.svelte +433 -431
- package/dist/components/ic/VectorInputController.svelte +1833 -1831
- package/dist/components/ic/VectorInputController.svelte.d.ts +10 -10
- package/dist/components/ic/index.d.ts +2 -0
- package/dist/components/ic/index.js +2 -0
- package/dist/components/ic/shared/CategoryTabs.svelte +28 -35
- package/dist/components/ic/shared/ItemGrid.svelte +145 -179
- package/dist/components/ic/shared/RecentItemsSection.svelte +208 -271
- package/dist/components/ic/shared/RecentItemsSection.svelte.d.ts +1 -1
- package/dist/components/ui/arrows/OpacitySliderArrows.svelte +23 -38
- package/dist/components/ui/arrows/OpacitySliderArrows.svelte.d.ts +1 -4
- package/dist/components/ui/calendar-editor-fit/EditorCalendarStyles.svelte +45 -0
- package/dist/components/ui/calendar-editor-fit/EditorCalendarStyles.svelte.d.ts +26 -0
- package/dist/components/ui/checkerboard-background/CheckerboardBackground.svelte +20 -12
- package/dist/components/ui/shadow-picker-host/ShadowPickerHost.svelte +39 -0
- package/dist/components/ui/shadow-picker-host/ShadowPickerHost.svelte.d.ts +10 -0
- package/dist/composition/compositionApi.d.ts +21 -1
- package/dist/composition/compositionApi.js +64 -5
- package/dist/composition/knowledgeDocuments.d.ts +90 -0
- package/dist/composition/knowledgeDocuments.js +94 -0
- package/dist/composition/knowledgeDocumentsPanel.d.ts +152 -0
- package/dist/composition/knowledgeDocumentsPanel.js +443 -0
- package/dist/i18n/language.d.ts +86 -36
- package/dist/i18n/messages.d.ts +97 -34
- package/dist/i18n/messages.js +104 -34
- package/dist/i18n/translate.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/knowledgeDocumentsContext.d.ts +10 -0
- package/dist/knowledgeDocumentsContext.js +31 -0
- package/dist/utils.d.ts +7 -0
- package/dist/utils.js +26 -2
- package/package.json +4 -4
|
@@ -18,279 +18,242 @@
|
|
|
18
18
|
-->
|
|
19
19
|
|
|
20
20
|
<script module lang="ts">
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
21
|
+
import type { DateValue } from '@internationalized/date';
|
|
22
|
+
import type { DateRange as BitsDateRange } from 'bits-ui';
|
|
23
|
+
|
|
24
|
+
// Use a more flexible local type
|
|
25
|
+
type DateRange = {
|
|
26
|
+
start?: DateValue;
|
|
27
|
+
end?: DateValue;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
import type { Writable } from 'svelte/store';
|
|
31
|
+
|
|
32
|
+
/** Declared props contract — export lets below are annotated from it so the
|
|
33
|
+
* interface cannot drift from what the component actually reads. */
|
|
34
|
+
export interface RangeCalendarInputControllerProps {
|
|
35
|
+
label: string;
|
|
36
|
+
value?: BitsDateRange;
|
|
37
|
+
onChange: (newValue: DateRange) => void;
|
|
38
|
+
helpText?: string;
|
|
39
|
+
controllerId: string;
|
|
40
|
+
openDropdowns: Writable<Set<string>>;
|
|
41
|
+
toggleDropdown: (id: string) => void;
|
|
42
|
+
onFocus?: () => void;
|
|
43
|
+
}
|
|
44
44
|
</script>
|
|
45
45
|
|
|
46
46
|
<script lang="ts">
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
47
|
+
// Svelte imports
|
|
48
|
+
import { onMount, onDestroy } from 'svelte';
|
|
49
|
+
import { listenForScroll } from '../../utils/shadowDom';
|
|
50
|
+
import { useEditorLanguage } from '../../i18n/language';
|
|
51
|
+
import type { EditorMessageKey } from '../../i18n/messages';
|
|
52
|
+
import { formatLocaleShortDate, type Translate } from '@widgetic/design-system/i18n';
|
|
53
|
+
|
|
54
|
+
// The words of the editor in the language of the page, and the language itself (how the calendar writes its months).
|
|
55
|
+
const { t, locale } = useEditorLanguage();
|
|
56
|
+
|
|
57
|
+
// Shadcn UI Components
|
|
58
|
+
import { RangeCalendar } from '@widgetic/design-system/components';
|
|
59
|
+
import { Popover } from '@widgetic/design-system/components';
|
|
60
|
+
import InputControllerRow from './InputControllerRow.svelte';
|
|
61
|
+
import { IconCalendar } from '@widgetic/design-system/icons';
|
|
62
|
+
import EditorCalendarStyles from '../ui/calendar-editor-fit/EditorCalendarStyles.svelte';
|
|
63
|
+
|
|
64
|
+
// Shadcn aditional: Internationalized Date
|
|
65
|
+
import { CalendarDate, getLocalTimeZone } from '@internationalized/date';
|
|
66
|
+
|
|
67
|
+
// Component props
|
|
68
|
+
export let label: RangeCalendarInputControllerProps['label'];
|
|
69
|
+
export let value: RangeCalendarInputControllerProps['value'];
|
|
70
|
+
export let onChange: RangeCalendarInputControllerProps['onChange'];
|
|
71
|
+
export let helpText: RangeCalendarInputControllerProps['helpText'] = undefined;
|
|
72
|
+
export let controllerId: RangeCalendarInputControllerProps['controllerId'];
|
|
73
|
+
export let openDropdowns: RangeCalendarInputControllerProps['openDropdowns'];
|
|
74
|
+
export let toggleDropdown: RangeCalendarInputControllerProps['toggleDropdown'];
|
|
75
|
+
export let onFocus: RangeCalendarInputControllerProps['onFocus'] = () => {};
|
|
76
|
+
|
|
77
|
+
let currentValue: DateRange | undefined;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Synchronizes external value with internal state
|
|
81
|
+
* Handles date range conversion and validation
|
|
82
|
+
* Preserves timezone information during conversion
|
|
83
|
+
*/
|
|
84
|
+
function updateCurrentValue() {
|
|
85
|
+
if (!value) {
|
|
86
|
+
currentValue = undefined;
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
try {
|
|
91
|
+
const newRange: DateRange = {};
|
|
92
|
+
if (value.start && typeof value.start === 'object' && 'year' in value.start) {
|
|
93
|
+
const start = value.start;
|
|
94
|
+
newRange.start =
|
|
95
|
+
start instanceof CalendarDate
|
|
96
|
+
? start
|
|
97
|
+
: new CalendarDate(start.year, start.month, start.day);
|
|
98
|
+
}
|
|
99
|
+
if (value.end && typeof value.end === 'object' && 'year' in value.end) {
|
|
100
|
+
const end = value.end;
|
|
101
|
+
newRange.end =
|
|
102
|
+
end instanceof CalendarDate ? end : new CalendarDate(end.year, end.month, end.day);
|
|
103
|
+
}
|
|
104
|
+
currentValue = newRange.start || newRange.end ? newRange : undefined;
|
|
105
|
+
} catch (error) {
|
|
106
|
+
console.error('Error updating range value:', error);
|
|
107
|
+
currentValue = undefined;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Watch for value changes and update internal state
|
|
112
|
+
$: (value, updateCurrentValue());
|
|
113
|
+
|
|
114
|
+
// Track dropdown state through store subscription
|
|
115
|
+
$: open = $openDropdowns?.has(controllerId) || false;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Formats a date range for display
|
|
119
|
+
* Handles undefined ranges and invalid dates
|
|
120
|
+
* Provides consistent date formatting across the application
|
|
121
|
+
* @param range - The date range to format
|
|
122
|
+
* @returns Formatted date range string
|
|
123
|
+
*/
|
|
124
|
+
function formatDateRange(
|
|
125
|
+
range: DateRange | undefined,
|
|
126
|
+
languageTag: string,
|
|
127
|
+
translate: Translate<EditorMessageKey>
|
|
128
|
+
): string {
|
|
129
|
+
if (!range || !range.start || !range.end) return translate('editor.date.pickRange');
|
|
130
|
+
|
|
131
|
+
try {
|
|
132
|
+
const formatDate = (date: DateValue) => {
|
|
133
|
+
if (!(date instanceof CalendarDate)) {
|
|
134
|
+
console.warn('[Editor] Invalid date object in range control:', date);
|
|
135
|
+
return translate('editor.date.invalid');
|
|
136
|
+
}
|
|
137
|
+
return formatLocaleShortDate(
|
|
138
|
+
{ year: date.year, month: date.month, day: date.day },
|
|
139
|
+
languageTag
|
|
140
|
+
);
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
return `${formatDate(range.start)} - ${formatDate(range.end)}`;
|
|
144
|
+
} catch (error) {
|
|
145
|
+
console.warn('[Editor] Error formatting date range:', error);
|
|
146
|
+
return translate('editor.date.pickRange');
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Handles date range selection from calendar
|
|
152
|
+
* Ensures both start and end dates are valid
|
|
153
|
+
* Closes dropdown after successful selection
|
|
154
|
+
* @param newValue - The newly selected date range
|
|
155
|
+
*/
|
|
156
|
+
function handleSelect(newValue: BitsDateRange | undefined): void {
|
|
157
|
+
if (newValue?.start && newValue?.end) {
|
|
158
|
+
// Create new CalendarDate instances for consistency
|
|
159
|
+
const range: DateRange = {
|
|
160
|
+
start: newValue.start,
|
|
161
|
+
end: newValue.end
|
|
162
|
+
};
|
|
163
|
+
onChange(range);
|
|
164
|
+
// Delay dropdown close for better UX
|
|
165
|
+
setTimeout(() => toggleDropdown(controllerId), 200);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Toggles calendar dropdown visibility
|
|
171
|
+
* Manages dropdown state through provided toggle function
|
|
172
|
+
*/
|
|
173
|
+
function handleToggle() {
|
|
174
|
+
toggleDropdown(controllerId);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Closes dropdown if currently open
|
|
179
|
+
* Used for cleanup and external close triggers
|
|
180
|
+
*/
|
|
181
|
+
function closeDropdown() {
|
|
182
|
+
if (open) {
|
|
183
|
+
toggleDropdown(controllerId);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Handles scroll events to prevent UI issues
|
|
189
|
+
* Closes dropdown when scrolling occurs
|
|
190
|
+
*/
|
|
191
|
+
function handleScroll() {
|
|
192
|
+
closeDropdown();
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// The control's own element, which says which tree (the page or a module's shadow root) to listen for scrolling in
|
|
196
|
+
let controllerElement: HTMLDivElement | undefined;
|
|
197
|
+
let stopListeningForScroll: () => void = () => {};
|
|
198
|
+
|
|
199
|
+
// Setup scroll event listener on mount (the page and, inside a module, the module's own panels: a scroll never
|
|
200
|
+
// leaves a shadow root, so a listener on the window alone does not hear about those)
|
|
201
|
+
onMount(() => {
|
|
202
|
+
stopListeningForScroll = listenForScroll(controllerElement, handleScroll);
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
// Cleanup scroll event listener on destroy
|
|
206
|
+
onDestroy(() => {
|
|
207
|
+
stopListeningForScroll();
|
|
208
|
+
});
|
|
201
209
|
</script>
|
|
202
210
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
211
|
+
<EditorCalendarStyles />
|
|
212
|
+
|
|
213
|
+
<!-- Range Calendar Container (Figma IC Date Range 172:504) -->
|
|
214
|
+
<div bind:this={controllerElement} class="range-calendar-input-controller">
|
|
215
|
+
<InputControllerRow {label} {helpText}>
|
|
216
|
+
<Popover.Root {open} onOpenChange={handleToggle}>
|
|
217
|
+
<Popover.Trigger
|
|
218
|
+
id="range-calendar"
|
|
219
|
+
class="range-calendar-trigger group flex h-9 w-full items-center gap-2 rounded-lg bg-accent px-3 transition-colors duration-fast hover:bg-accent-hover focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"
|
|
220
|
+
onfocusin={onFocus}
|
|
221
|
+
>
|
|
222
|
+
<span
|
|
223
|
+
class="min-w-0 flex-1 truncate text-start text-body {currentValue
|
|
224
|
+
? 'text-foreground'
|
|
225
|
+
: 'text-muted-foreground'}"
|
|
226
|
+
>
|
|
227
|
+
{formatDateRange(currentValue, $locale, $t)}
|
|
228
|
+
</span>
|
|
229
|
+
<IconCalendar
|
|
230
|
+
class="size-4 shrink-0 stroke-[1.333] text-muted-foreground transition-colors duration-fast group-hover:text-foreground"
|
|
231
|
+
aria-hidden="true"
|
|
232
|
+
/>
|
|
233
|
+
</Popover.Trigger>
|
|
234
|
+
|
|
235
|
+
<Popover.Content
|
|
236
|
+
class="range-calendar-popover z-50 w-auto border border-border p-0 shadow-none"
|
|
237
|
+
align="end"
|
|
238
|
+
sideOffset={8}
|
|
239
|
+
>
|
|
240
|
+
<!-- Style the range calendar -->
|
|
241
|
+
<RangeCalendar
|
|
242
|
+
value={currentValue}
|
|
243
|
+
locale={$locale}
|
|
244
|
+
calendarLabel={$t('editor.date.rangeCalendarLabel')}
|
|
245
|
+
previousLabel={$t('editor.date.previousMonth')}
|
|
246
|
+
nextLabel={$t('editor.date.nextMonth')}
|
|
247
|
+
onValueChange={(v: BitsDateRange) => {
|
|
248
|
+
handleSelect(v);
|
|
249
|
+
}}
|
|
250
|
+
numberOfMonths={2}
|
|
251
|
+
weekdayFormat="short"
|
|
252
|
+
fixedWeeks={true}
|
|
253
|
+
class="range-calendar calendar-editor-fit w-[488px] p-3"
|
|
254
|
+
/>
|
|
255
|
+
<!-- Style the range calendar days: see EditorCalendarStyles (calendar-editor-fit) -->
|
|
256
|
+
</Popover.Content>
|
|
257
|
+
</Popover.Root>
|
|
258
|
+
</InputControllerRow>
|
|
248
259
|
</div>
|
|
249
|
-
|
|
250
|
-
<style>
|
|
251
|
-
/* Remove focus ring from trigger */
|
|
252
|
-
:global(.range-calendar-trigger:focus-visible) {
|
|
253
|
-
outline: none !important;
|
|
254
|
-
box-shadow: none !important;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
/* Style the calendar content */
|
|
258
|
-
:global(.range-calendar-content) {
|
|
259
|
-
border: 1px solid hsl(var(--grey2)) !important;
|
|
260
|
-
background: white !important;
|
|
261
|
-
border-radius: var(--radius) !important;
|
|
262
|
-
margin-top: 4px !important;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
/* Remove button styles */
|
|
266
|
-
:global(button.bg-transparent) {
|
|
267
|
-
outline: none !important;
|
|
268
|
-
box-shadow: none !important;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
:global(button.bg-transparent:hover),
|
|
272
|
-
:global(button.bg-transparent:focus) {
|
|
273
|
-
background-color: transparent !important;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
/* Style the range calendar */
|
|
277
|
-
:global(.range-calendar) {
|
|
278
|
-
border: none !important;
|
|
279
|
-
background: transparent !important;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
/* Style the range calendar days */
|
|
283
|
-
:global(.range-calendar [role="gridcell"]) {
|
|
284
|
-
color: hsl(var(--grey7)) !important;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
:global(.range-calendar [role="gridcell"][data-selected]) {
|
|
288
|
-
background: hsl(var(--grey1)) !important;
|
|
289
|
-
color: hsl(var(--grey7)) !important;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
:global(.range-calendar [role="gridcell"][data-highlighted]) {
|
|
293
|
-
background: hsl(var(--grey1)) !important;
|
|
294
|
-
color: hsl(var(--grey7)) !important;
|
|
295
|
-
}
|
|
296
|
-
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { DateValue } from
|
|
2
|
-
import type { DateRange as BitsDateRange } from
|
|
1
|
+
import type { DateValue } from '@internationalized/date';
|
|
2
|
+
import type { DateRange as BitsDateRange } from 'bits-ui';
|
|
3
3
|
type DateRange = {
|
|
4
4
|
start?: DateValue;
|
|
5
5
|
end?: DateValue;
|