@warp-ds/elements 2.2.0-next.5 → 2.2.0-next.6
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/custom-elements.json +729 -247
- package/dist/index.d.ts +1 -0
- package/dist/index.js +139 -101
- package/dist/index.js.map +4 -4
- package/dist/packages/button/index.d.ts +3 -0
- package/dist/packages/button/index.js.map +2 -2
- package/dist/packages/button/react.js.map +2 -2
- package/dist/packages/datepicker/datepicker.d.ts +89 -0
- package/dist/packages/datepicker/datepicker.stories.d.ts +11 -0
- package/dist/packages/datepicker/index.d.ts +1 -0
- package/dist/packages/datepicker/index.js +2782 -0
- package/dist/packages/datepicker/index.js.map +7 -0
- package/dist/packages/datepicker/locales/da/messages.d.mts +1 -0
- package/dist/packages/datepicker/locales/en/messages.d.mts +1 -0
- package/dist/packages/datepicker/locales/fi/messages.d.mts +1 -0
- package/dist/packages/datepicker/locales/nb/messages.d.mts +1 -0
- package/dist/packages/datepicker/locales/sv/messages.d.mts +1 -0
- package/dist/packages/datepicker/styles/w-datepicker-calendar.styles.d.ts +1 -0
- package/dist/packages/datepicker/styles/w-datepicker-day.styles.d.ts +1 -0
- package/dist/packages/datepicker/styles/w-datepicker-month.styles.d.ts +1 -0
- package/dist/packages/datepicker/styles/w-datepicker.styles.d.ts +1 -0
- package/dist/packages/datepicker/utils.d.ts +13 -0
- package/dist/packages/pageindicator/index.d.ts +14 -0
- package/dist/packages/pageindicator/index.js +32 -0
- package/dist/packages/pageindicator/index.js.map +7 -0
- package/dist/packages/pageindicator/pageindicator.stories.d.ts +32 -0
- package/dist/packages/pageindicator/react.d.ts +2 -0
- package/dist/packages/pageindicator/react.js +52 -0
- package/dist/packages/pageindicator/react.js.map +7 -0
- package/dist/packages/pageindicator/style.d.ts +1 -0
- package/dist/packages/pagination/index.d.ts +3 -0
- package/dist/packages/pagination/index.js +21 -13
- package/dist/packages/pagination/index.js.map +3 -3
- package/dist/packages/pagination/react.js +21 -13
- package/dist/packages/pagination/react.js.map +3 -3
- package/dist/vscode.html-custom-data.json +66 -19
- package/dist/web-types.json +162 -38
- package/package.json +2 -1
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { Locale } from 'date-fns';
|
|
3
|
+
import '@warp-ds/icons/elements/calendar-16';
|
|
4
|
+
import '@warp-ds/icons/elements/chevron-left-16';
|
|
5
|
+
import '@warp-ds/icons/elements/chevron-right-16';
|
|
6
|
+
declare const WarpDatepicker_base: import("@open-wc/form-control").Constructor<import("@open-wc/form-control").FormControlInterface> & typeof LitElement;
|
|
7
|
+
/**
|
|
8
|
+
* An input for dates.
|
|
9
|
+
*
|
|
10
|
+
* Uses the `lang` attribute on either the element or on `<html>` to determine the locale options.
|
|
11
|
+
*
|
|
12
|
+
* [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/forms-datepicker--docs)
|
|
13
|
+
*/
|
|
14
|
+
declare class WarpDatepicker extends WarpDatepicker_base {
|
|
15
|
+
#private;
|
|
16
|
+
static shadowRootOptions: {
|
|
17
|
+
delegatesFocus: boolean;
|
|
18
|
+
mode: ShadowRootMode;
|
|
19
|
+
serializable?: boolean;
|
|
20
|
+
slotAssignment?: SlotAssignmentMode;
|
|
21
|
+
};
|
|
22
|
+
static styles: import("lit").CSSResult[];
|
|
23
|
+
label: string;
|
|
24
|
+
/** Takes precedence over the `<html>` lang attribute. */
|
|
25
|
+
lang: string;
|
|
26
|
+
name: string;
|
|
27
|
+
value: string;
|
|
28
|
+
/**
|
|
29
|
+
* Decides the format of the date as shown in the calendar header.
|
|
30
|
+
*
|
|
31
|
+
* The syntax is defined by [date-fns/format](https://date-fns.org/v4.1.0/docs/format).
|
|
32
|
+
*/
|
|
33
|
+
headerFormat: string;
|
|
34
|
+
/**
|
|
35
|
+
* Decides the format of the weekday as shown above the grid of dates in the calendar.
|
|
36
|
+
*
|
|
37
|
+
* The syntax is defined by [date-fns/format](https://date-fns.org/v4.1.0/docs/format).
|
|
38
|
+
*/
|
|
39
|
+
weekdayFormat: string;
|
|
40
|
+
/**
|
|
41
|
+
* Lets you control if a date in the calendar should be disabled.
|
|
42
|
+
*
|
|
43
|
+
* This needs to be set on the element instance in JavaScript, not as an HTML attribute.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* import type { WarpDatepicker } from "@warp-ds/elements";
|
|
48
|
+
* import { isBefore, startOfDay } from 'date-fns';
|
|
49
|
+
*
|
|
50
|
+
* const today = startOfDay(new Date());
|
|
51
|
+
* const datePicker = document.querySelector('w-datepicker') as WarpDatepicker;
|
|
52
|
+
* datePicker.isDayDisabled = (day: Date) => isBefore(startOfDay(day), today);
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
isDayDisabled: (day: Date) => boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Decides the format of the day in the calendar as read to screen readers.
|
|
58
|
+
*
|
|
59
|
+
* The syntax is defined by [date-fns/format](https://date-fns.org/v4.1.0/docs/format).
|
|
60
|
+
*/
|
|
61
|
+
dayFormat: string;
|
|
62
|
+
isCalendarOpen: boolean;
|
|
63
|
+
/** The current input value as a stringified date-like */
|
|
64
|
+
internalValue: string;
|
|
65
|
+
navigationDate: Date;
|
|
66
|
+
/** @internal This gets picked up by the custom element manifest analyzer as a property for some reason */
|
|
67
|
+
locale: Locale;
|
|
68
|
+
get selectedDate(): Date | null;
|
|
69
|
+
get month(): Date;
|
|
70
|
+
get weeks(): import("date-fns").EachDayOfIntervalResult<{
|
|
71
|
+
start: Date;
|
|
72
|
+
end: Date;
|
|
73
|
+
}, undefined>[];
|
|
74
|
+
calendar: HTMLDivElement;
|
|
75
|
+
input: HTMLInputElement;
|
|
76
|
+
toggleButton: HTMLButtonElement;
|
|
77
|
+
wrapper: HTMLDivElement;
|
|
78
|
+
selectedCell: HTMLTableCellElement;
|
|
79
|
+
constructor();
|
|
80
|
+
connectedCallback(): void;
|
|
81
|
+
disconnectedCallback(): void;
|
|
82
|
+
render(): import("lit").TemplateResult<1>;
|
|
83
|
+
}
|
|
84
|
+
declare global {
|
|
85
|
+
interface HTMLElementTagNameMap {
|
|
86
|
+
'w-datepicker': WarpDatepicker;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
export { WarpDatepicker };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import type { WarpDatepicker } from './index.js';
|
|
3
|
+
import './index.js';
|
|
4
|
+
declare const args: Partial<WarpDatepicker> & {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
};
|
|
7
|
+
declare const meta: Meta<typeof args>;
|
|
8
|
+
export default meta;
|
|
9
|
+
type Story = StoryObj<typeof args>;
|
|
10
|
+
export declare const Default: Story;
|
|
11
|
+
export declare const DisableCalendarDates: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './datepicker.js';
|