@geomak/ui 3.0.0 → 5.0.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.
- package/dist/index.cjs +487 -352
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +114 -67
- package/dist/index.d.ts +114 -67
- package/dist/index.js +487 -352
- package/dist/index.js.map +1 -1
- package/dist/styles.css +42 -60
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1812,40 +1812,84 @@ interface AutoCompleteProps {
|
|
|
1812
1812
|
*/
|
|
1813
1813
|
declare function AutoComplete({ disabled, label, placeholder, name, inputStyle, style, layout, items, onItemClick, emptyText, }: AutoCompleteProps): react_jsx_runtime.JSX.Element;
|
|
1814
1814
|
|
|
1815
|
-
interface
|
|
1815
|
+
interface TreeSelectNode {
|
|
1816
1816
|
key: string | number;
|
|
1817
1817
|
label: React$1.ReactNode;
|
|
1818
1818
|
icon?: React$1.ReactNode;
|
|
1819
|
+
/** Nested children. If present, this node is treated as a parent (branch). */
|
|
1820
|
+
children?: TreeSelectNode[];
|
|
1821
|
+
/** Render the node disabled — visible but not selectable. */
|
|
1822
|
+
disabled?: boolean;
|
|
1819
1823
|
}
|
|
1820
1824
|
interface TreeSelectProps {
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
value?:
|
|
1825
|
+
/** Tree data. Each node may optionally carry `children` for sub-branches. */
|
|
1826
|
+
items: TreeSelectNode[];
|
|
1827
|
+
/** Currently selected key (single-select). Pass `undefined`/`null` for unset. */
|
|
1828
|
+
value?: string | number | null;
|
|
1829
|
+
/** Fires with the next selected key (and the corresponding event-like target). */
|
|
1825
1830
|
onChange?: (e: {
|
|
1826
1831
|
target: {
|
|
1827
|
-
value:
|
|
1832
|
+
value: string | number;
|
|
1828
1833
|
id?: string;
|
|
1829
1834
|
name?: string;
|
|
1830
1835
|
};
|
|
1831
1836
|
}) => void;
|
|
1832
|
-
|
|
1837
|
+
label?: React$1.ReactNode;
|
|
1838
|
+
placeholder?: string;
|
|
1839
|
+
/** Form control id linkage. */
|
|
1840
|
+
htmlFor?: string;
|
|
1841
|
+
name?: string;
|
|
1842
|
+
/** Label/trigger orientation. Defaults to `'horizontal'`. */
|
|
1843
|
+
layout?: 'horizontal' | 'vertical';
|
|
1833
1844
|
disabled?: boolean;
|
|
1834
|
-
/** 'horizontal' | 'vertical' */
|
|
1835
|
-
layout?: string;
|
|
1836
1845
|
errorMessage?: React$1.ReactNode;
|
|
1837
1846
|
style?: React$1.CSSProperties;
|
|
1838
|
-
|
|
1839
|
-
|
|
1847
|
+
/**
|
|
1848
|
+
* Whether parent (branch) nodes can be selected. When `false`, parents
|
|
1849
|
+
* only expand/collapse and only leaves are picked. Default `true`.
|
|
1850
|
+
*/
|
|
1851
|
+
parentsSelectable?: boolean;
|
|
1852
|
+
/** Keys of nodes that should start expanded. */
|
|
1853
|
+
defaultExpandedKeys?: (string | number)[];
|
|
1840
1854
|
}
|
|
1841
1855
|
/**
|
|
1842
|
-
*
|
|
1843
|
-
*
|
|
1856
|
+
* Hierarchical single-select with expandable branches.
|
|
1857
|
+
*
|
|
1858
|
+
* Built on `@radix-ui/react-popover` for portal positioning and click-outside.
|
|
1859
|
+
* Tree state (expanded keys) is local; selected value is controlled by the
|
|
1860
|
+
* parent.
|
|
1861
|
+
*
|
|
1862
|
+
* **Keyboard model** (focus is on the trigger or any item):
|
|
1863
|
+
* - `Enter` / `Space` / `↓` / `↑` on the trigger — open the popover
|
|
1864
|
+
* - `↓` / `↑` — move active item through the visible (un-collapsed) list
|
|
1865
|
+
* - `→` — expand a branch (or move into it if already expanded)
|
|
1866
|
+
* - `←` — collapse a branch (or move to its parent if already collapsed)
|
|
1867
|
+
* - `Enter` / `Space` — select the active item (if selectable)
|
|
1868
|
+
* - `Esc` — close the popover, return focus to the trigger
|
|
1844
1869
|
*
|
|
1845
1870
|
* @example
|
|
1846
|
-
*
|
|
1871
|
+
* ```tsx
|
|
1872
|
+
* type FleetKey = number
|
|
1873
|
+
* const [fleet, setFleet] = useState<FleetKey | null>(null)
|
|
1874
|
+
*
|
|
1875
|
+
* const tree: TreeSelectNode[] = [
|
|
1876
|
+
* { key: 'eu', label: 'Europe', children: [
|
|
1877
|
+
* { key: 1, label: 'Aegean Fleet' },
|
|
1878
|
+
* { key: 2, label: 'Adriatic Fleet' },
|
|
1879
|
+
* ]},
|
|
1880
|
+
* { key: 'asia', label: 'Asia', children: [{ key: 3, label: 'Pacific Fleet' }] },
|
|
1881
|
+
* ]
|
|
1882
|
+
*
|
|
1883
|
+
* <TreeSelect
|
|
1884
|
+
* label="Fleet"
|
|
1885
|
+
* items={tree}
|
|
1886
|
+
* value={fleet}
|
|
1887
|
+
* onChange={({ target }) => setFleet(target.value as FleetKey)}
|
|
1888
|
+
* parentsSelectable={false}
|
|
1889
|
+
* />
|
|
1890
|
+
* ```
|
|
1847
1891
|
*/
|
|
1848
|
-
declare function TreeSelect({ label, name, value, onChange, disabled, layout, errorMessage, style, htmlFor, items, }: TreeSelectProps): react_jsx_runtime.JSX.Element;
|
|
1892
|
+
declare function TreeSelect({ label, name, value, onChange, disabled, layout, errorMessage, style, htmlFor, items, placeholder, parentsSelectable, defaultExpandedKeys, }: TreeSelectProps): react_jsx_runtime.JSX.Element;
|
|
1849
1893
|
|
|
1850
1894
|
interface FileInputProps {
|
|
1851
1895
|
allowMultiple?: boolean;
|
|
@@ -1875,68 +1919,71 @@ interface FileInputProps {
|
|
|
1875
1919
|
*/
|
|
1876
1920
|
declare function FileInput({ allowMultiple, onChange, name, accept, }: FileInputProps): react_jsx_runtime.JSX.Element;
|
|
1877
1921
|
|
|
1878
|
-
/** ─────────────────── DatePicker ─────────────────── */
|
|
1879
1922
|
interface DatePickerProps {
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
id?: string;
|
|
1885
|
-
name?: string;
|
|
1886
|
-
};
|
|
1887
|
-
}) => void;
|
|
1888
|
-
layout?: 'horizontal' | 'vertical';
|
|
1923
|
+
/** Current date. `null` / `undefined` means "no date selected". */
|
|
1924
|
+
value?: Date | null;
|
|
1925
|
+
/** Fires with the next date (or `null` if cleared via the clear button). */
|
|
1926
|
+
onChange?: (date: Date | null) => void;
|
|
1889
1927
|
label?: React$1.ReactNode;
|
|
1928
|
+
/** Text shown in the trigger when no date is selected. Default `"Select a date…"`. */
|
|
1929
|
+
placeholder?: string;
|
|
1890
1930
|
htmlFor?: string;
|
|
1891
1931
|
name?: string;
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
disableBefore?: Date | string;
|
|
1895
|
-
disableAfter?: Date | string;
|
|
1932
|
+
/** Label/trigger orientation. Defaults to `'horizontal'`. */
|
|
1933
|
+
layout?: 'horizontal' | 'vertical';
|
|
1896
1934
|
disabled?: boolean;
|
|
1897
|
-
}
|
|
1898
|
-
/**
|
|
1899
|
-
* Custom calendar date picker.
|
|
1900
|
-
*
|
|
1901
|
-
* @example
|
|
1902
|
-
* <DatePicker.DatePicker
|
|
1903
|
-
* label="Report date"
|
|
1904
|
-
* value={form.date}
|
|
1905
|
-
* onChange={({ target }) => setField('date', target.value)}
|
|
1906
|
-
* disableAfter={new Date()}
|
|
1907
|
-
* />
|
|
1908
|
-
*/
|
|
1909
|
-
declare function DatePickerBase({ value, onChange, layout, label, htmlFor, name, style, errorMessage, disableBefore, disableAfter, disabled, }: DatePickerProps): react_jsx_runtime.JSX.Element;
|
|
1910
|
-
/** ─────────────────── TemporalPicker (year/number scroll) ─────────────────── */
|
|
1911
|
-
interface TemporalPickerProps {
|
|
1912
|
-
value: number;
|
|
1913
|
-
onChange: (e: {
|
|
1914
|
-
target: {
|
|
1915
|
-
value: number;
|
|
1916
|
-
};
|
|
1917
|
-
}) => void;
|
|
1918
|
-
type?: 'year';
|
|
1919
|
-
upperLimit?: number;
|
|
1920
|
-
lowerLimit?: number;
|
|
1921
1935
|
errorMessage?: React$1.ReactNode;
|
|
1922
|
-
|
|
1923
|
-
|
|
1936
|
+
/** Earliest selectable date. Dates before this render disabled. */
|
|
1937
|
+
min?: Date;
|
|
1938
|
+
/** Latest selectable date. Dates after this render disabled. */
|
|
1939
|
+
max?: Date;
|
|
1924
1940
|
style?: React$1.CSSProperties;
|
|
1941
|
+
/**
|
|
1942
|
+
* Custom formatter for the trigger display. Defaults to
|
|
1943
|
+
* `YYYY-MM-DD` via `toISOString().slice(0, 10)`.
|
|
1944
|
+
*/
|
|
1945
|
+
format?: (date: Date) => string;
|
|
1946
|
+
/** 0 = Sunday, 1 = Monday. Default `0`. */
|
|
1947
|
+
weekStartsOn?: 0 | 1;
|
|
1948
|
+
/** Allow the user to clear the date with a button in the popover. Default `true`. */
|
|
1949
|
+
clearable?: boolean;
|
|
1925
1950
|
}
|
|
1926
|
-
|
|
1927
|
-
/** ─────────────────── Namespace export ─────────────────── */
|
|
1951
|
+
type TemporalPickerProps = DatePickerProps;
|
|
1928
1952
|
/**
|
|
1929
|
-
*
|
|
1953
|
+
* Calendar date picker built on `@radix-ui/react-popover`.
|
|
1930
1954
|
*
|
|
1931
|
-
*
|
|
1932
|
-
*
|
|
1955
|
+
* Renders the calendar as a real `<table role="grid">` with weekday `<th>`
|
|
1956
|
+
* headers and per-day `<td role="gridcell">` cells, so screen readers get
|
|
1957
|
+
* proper row/column context.
|
|
1958
|
+
*
|
|
1959
|
+
* **Keyboard model** (focus is anywhere inside the grid):
|
|
1960
|
+
* - `←` `→` — previous / next day
|
|
1961
|
+
* - `↑` `↓` — previous / next week
|
|
1962
|
+
* - `PageUp` / `PageDown` — previous / next month
|
|
1963
|
+
* - `Home` / `End` — first / last day of the current week
|
|
1964
|
+
* - `Enter` / `Space` — select the focused day
|
|
1965
|
+
* - `Esc` — close the popover
|
|
1966
|
+
*
|
|
1967
|
+
* @example Required date
|
|
1968
|
+
* ```tsx
|
|
1969
|
+
* const [date, setDate] = useState<Date | null>(null)
|
|
1970
|
+
* <DatePicker
|
|
1971
|
+
* label="Report date"
|
|
1972
|
+
* value={date}
|
|
1973
|
+
* onChange={setDate}
|
|
1974
|
+
* max={new Date()}
|
|
1975
|
+
* />
|
|
1976
|
+
* ```
|
|
1933
1977
|
*
|
|
1934
|
-
*
|
|
1935
|
-
*
|
|
1978
|
+
* @example Custom format
|
|
1979
|
+
* ```tsx
|
|
1980
|
+
* <DatePicker
|
|
1981
|
+
* value={date}
|
|
1982
|
+
* onChange={setDate}
|
|
1983
|
+
* format={(d) => new Intl.DateTimeFormat('en-GB', { dateStyle: 'long' }).format(d)}
|
|
1984
|
+
* />
|
|
1985
|
+
* ```
|
|
1936
1986
|
*/
|
|
1937
|
-
declare
|
|
1938
|
-
DatePicker: typeof DatePickerBase;
|
|
1939
|
-
TemporalPicker: typeof TemporalPickerBase;
|
|
1940
|
-
};
|
|
1987
|
+
declare function DatePicker({ value, onChange, label, placeholder, htmlFor, name: _name, layout, disabled, errorMessage, min, max, style, format, weekStartsOn, clearable, }: DatePickerProps): react_jsx_runtime.JSX.Element;
|
|
1941
1988
|
|
|
1942
|
-
export { AppShell, type AppShellProps, AutoComplete, type AutoCompleteProps, Button, type ButtonProps, Catalog, CatalogCarousel, type CatalogCarouselProps, CatalogGrid, type CatalogGridProps, type CatalogProps, Checkbox, type CheckboxProps, ContextMenu, type ContextMenuActionItem, type ContextMenuPosition, type ContextMenuProps, type DatePickerProps, Drawer, type DrawerProps, Dropdown, type DropdownItem, DropdownPill, type DropdownPillProps, type DropdownProps, type ExpandRowOptions, FadingBase, type FadingBaseProps, FileInput, type FileInputProps, GridCard, type GridCardItem, type GridCardProps, Icon, IconButton, type IconButtonProps, List, type ListItem, type ListProps, LoadingSpinner, type LoadingSpinnerProps, MenuBar, MenuBarItem, type MenuBarItemConfig, type MenuBarItemProps, type MenuBarProps, Modal, type ModalProps, type NotificationPayload, NotificationProvider, NumberInput, type NumberInputProps, OpaqueGridCard, type OpaqueGridCardProps, type PaginationOptions, Password, type PasswordProps, Portal, type PortalProps, ScalableContainer, type ScalableContainerProps, SearchInput, type SearchInputProps, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, SkeletonBox, type SkeletonBoxProps, SkeletonCard, type SkeletonCardProps, SkeletonCircle, type SkeletonCircleProps, SkeletonText, type SkeletonTextProps, Switch, type SwitchInputProps, type TabItem, Table, type TableColumn, type TableProps, Tabs, type TabsProps, Temporal, type TemporalPickerProps, TextInput, type TextInputProps, type ThemeColors, type ThemeConfig, type ThemeDensity, type ThemeMotion, ThemeProvider, type ThemeProviderProps, type ThemeRadius, type ThemeShadows, ThemeSwitch, type ThemeSwitchProps, type ThemeTypography, ToggleButton, type ToggleButtonProps, type ToggleItem, Tooltip, type TooltipProps, TooltipProvider, TopBar, type TopBarProps, Tree, type TreeItemClickPayload, type TreeNode, type TreeProps, TreeSelect, type TreeSelectProps, Wizard, type WizardProps, type WizardStep, useNotification };
|
|
1989
|
+
export { AppShell, type AppShellProps, AutoComplete, type AutoCompleteProps, Button, type ButtonProps, Catalog, CatalogCarousel, type CatalogCarouselProps, CatalogGrid, type CatalogGridProps, type CatalogProps, Checkbox, type CheckboxProps, ContextMenu, type ContextMenuActionItem, type ContextMenuPosition, type ContextMenuProps, type DatePickerProps, Drawer, type DrawerProps, Dropdown, type DropdownItem, DropdownPill, type DropdownPillProps, type DropdownProps, type ExpandRowOptions, FadingBase, type FadingBaseProps, FileInput, type FileInputProps, GridCard, type GridCardItem, type GridCardProps, Icon, IconButton, type IconButtonProps, List, type ListItem, type ListProps, LoadingSpinner, type LoadingSpinnerProps, MenuBar, MenuBarItem, type MenuBarItemConfig, type MenuBarItemProps, type MenuBarProps, Modal, type ModalProps, type NotificationPayload, NotificationProvider, NumberInput, type NumberInputProps, OpaqueGridCard, type OpaqueGridCardProps, type PaginationOptions, Password, type PasswordProps, Portal, type PortalProps, ScalableContainer, type ScalableContainerProps, SearchInput, type SearchInputProps, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, SkeletonBox, type SkeletonBoxProps, SkeletonCard, type SkeletonCardProps, SkeletonCircle, type SkeletonCircleProps, SkeletonText, type SkeletonTextProps, Switch, type SwitchInputProps, type TabItem, Table, type TableColumn, type TableProps, Tabs, type TabsProps, DatePicker as Temporal, type TemporalPickerProps, TextInput, type TextInputProps, type ThemeColors, type ThemeConfig, type ThemeDensity, type ThemeMotion, ThemeProvider, type ThemeProviderProps, type ThemeRadius, type ThemeShadows, ThemeSwitch, type ThemeSwitchProps, type ThemeTypography, ToggleButton, type ToggleButtonProps, type ToggleItem, Tooltip, type TooltipProps, TooltipProvider, TopBar, type TopBarProps, Tree, type TreeItemClickPayload, type TreeNode, type TreeProps, TreeSelect, type TreeSelectProps, Wizard, type WizardProps, type WizardStep, useNotification };
|
package/dist/index.d.ts
CHANGED
|
@@ -1812,40 +1812,84 @@ interface AutoCompleteProps {
|
|
|
1812
1812
|
*/
|
|
1813
1813
|
declare function AutoComplete({ disabled, label, placeholder, name, inputStyle, style, layout, items, onItemClick, emptyText, }: AutoCompleteProps): react_jsx_runtime.JSX.Element;
|
|
1814
1814
|
|
|
1815
|
-
interface
|
|
1815
|
+
interface TreeSelectNode {
|
|
1816
1816
|
key: string | number;
|
|
1817
1817
|
label: React$1.ReactNode;
|
|
1818
1818
|
icon?: React$1.ReactNode;
|
|
1819
|
+
/** Nested children. If present, this node is treated as a parent (branch). */
|
|
1820
|
+
children?: TreeSelectNode[];
|
|
1821
|
+
/** Render the node disabled — visible but not selectable. */
|
|
1822
|
+
disabled?: boolean;
|
|
1819
1823
|
}
|
|
1820
1824
|
interface TreeSelectProps {
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
value?:
|
|
1825
|
+
/** Tree data. Each node may optionally carry `children` for sub-branches. */
|
|
1826
|
+
items: TreeSelectNode[];
|
|
1827
|
+
/** Currently selected key (single-select). Pass `undefined`/`null` for unset. */
|
|
1828
|
+
value?: string | number | null;
|
|
1829
|
+
/** Fires with the next selected key (and the corresponding event-like target). */
|
|
1825
1830
|
onChange?: (e: {
|
|
1826
1831
|
target: {
|
|
1827
|
-
value:
|
|
1832
|
+
value: string | number;
|
|
1828
1833
|
id?: string;
|
|
1829
1834
|
name?: string;
|
|
1830
1835
|
};
|
|
1831
1836
|
}) => void;
|
|
1832
|
-
|
|
1837
|
+
label?: React$1.ReactNode;
|
|
1838
|
+
placeholder?: string;
|
|
1839
|
+
/** Form control id linkage. */
|
|
1840
|
+
htmlFor?: string;
|
|
1841
|
+
name?: string;
|
|
1842
|
+
/** Label/trigger orientation. Defaults to `'horizontal'`. */
|
|
1843
|
+
layout?: 'horizontal' | 'vertical';
|
|
1833
1844
|
disabled?: boolean;
|
|
1834
|
-
/** 'horizontal' | 'vertical' */
|
|
1835
|
-
layout?: string;
|
|
1836
1845
|
errorMessage?: React$1.ReactNode;
|
|
1837
1846
|
style?: React$1.CSSProperties;
|
|
1838
|
-
|
|
1839
|
-
|
|
1847
|
+
/**
|
|
1848
|
+
* Whether parent (branch) nodes can be selected. When `false`, parents
|
|
1849
|
+
* only expand/collapse and only leaves are picked. Default `true`.
|
|
1850
|
+
*/
|
|
1851
|
+
parentsSelectable?: boolean;
|
|
1852
|
+
/** Keys of nodes that should start expanded. */
|
|
1853
|
+
defaultExpandedKeys?: (string | number)[];
|
|
1840
1854
|
}
|
|
1841
1855
|
/**
|
|
1842
|
-
*
|
|
1843
|
-
*
|
|
1856
|
+
* Hierarchical single-select with expandable branches.
|
|
1857
|
+
*
|
|
1858
|
+
* Built on `@radix-ui/react-popover` for portal positioning and click-outside.
|
|
1859
|
+
* Tree state (expanded keys) is local; selected value is controlled by the
|
|
1860
|
+
* parent.
|
|
1861
|
+
*
|
|
1862
|
+
* **Keyboard model** (focus is on the trigger or any item):
|
|
1863
|
+
* - `Enter` / `Space` / `↓` / `↑` on the trigger — open the popover
|
|
1864
|
+
* - `↓` / `↑` — move active item through the visible (un-collapsed) list
|
|
1865
|
+
* - `→` — expand a branch (or move into it if already expanded)
|
|
1866
|
+
* - `←` — collapse a branch (or move to its parent if already collapsed)
|
|
1867
|
+
* - `Enter` / `Space` — select the active item (if selectable)
|
|
1868
|
+
* - `Esc` — close the popover, return focus to the trigger
|
|
1844
1869
|
*
|
|
1845
1870
|
* @example
|
|
1846
|
-
*
|
|
1871
|
+
* ```tsx
|
|
1872
|
+
* type FleetKey = number
|
|
1873
|
+
* const [fleet, setFleet] = useState<FleetKey | null>(null)
|
|
1874
|
+
*
|
|
1875
|
+
* const tree: TreeSelectNode[] = [
|
|
1876
|
+
* { key: 'eu', label: 'Europe', children: [
|
|
1877
|
+
* { key: 1, label: 'Aegean Fleet' },
|
|
1878
|
+
* { key: 2, label: 'Adriatic Fleet' },
|
|
1879
|
+
* ]},
|
|
1880
|
+
* { key: 'asia', label: 'Asia', children: [{ key: 3, label: 'Pacific Fleet' }] },
|
|
1881
|
+
* ]
|
|
1882
|
+
*
|
|
1883
|
+
* <TreeSelect
|
|
1884
|
+
* label="Fleet"
|
|
1885
|
+
* items={tree}
|
|
1886
|
+
* value={fleet}
|
|
1887
|
+
* onChange={({ target }) => setFleet(target.value as FleetKey)}
|
|
1888
|
+
* parentsSelectable={false}
|
|
1889
|
+
* />
|
|
1890
|
+
* ```
|
|
1847
1891
|
*/
|
|
1848
|
-
declare function TreeSelect({ label, name, value, onChange, disabled, layout, errorMessage, style, htmlFor, items, }: TreeSelectProps): react_jsx_runtime.JSX.Element;
|
|
1892
|
+
declare function TreeSelect({ label, name, value, onChange, disabled, layout, errorMessage, style, htmlFor, items, placeholder, parentsSelectable, defaultExpandedKeys, }: TreeSelectProps): react_jsx_runtime.JSX.Element;
|
|
1849
1893
|
|
|
1850
1894
|
interface FileInputProps {
|
|
1851
1895
|
allowMultiple?: boolean;
|
|
@@ -1875,68 +1919,71 @@ interface FileInputProps {
|
|
|
1875
1919
|
*/
|
|
1876
1920
|
declare function FileInput({ allowMultiple, onChange, name, accept, }: FileInputProps): react_jsx_runtime.JSX.Element;
|
|
1877
1921
|
|
|
1878
|
-
/** ─────────────────── DatePicker ─────────────────── */
|
|
1879
1922
|
interface DatePickerProps {
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
id?: string;
|
|
1885
|
-
name?: string;
|
|
1886
|
-
};
|
|
1887
|
-
}) => void;
|
|
1888
|
-
layout?: 'horizontal' | 'vertical';
|
|
1923
|
+
/** Current date. `null` / `undefined` means "no date selected". */
|
|
1924
|
+
value?: Date | null;
|
|
1925
|
+
/** Fires with the next date (or `null` if cleared via the clear button). */
|
|
1926
|
+
onChange?: (date: Date | null) => void;
|
|
1889
1927
|
label?: React$1.ReactNode;
|
|
1928
|
+
/** Text shown in the trigger when no date is selected. Default `"Select a date…"`. */
|
|
1929
|
+
placeholder?: string;
|
|
1890
1930
|
htmlFor?: string;
|
|
1891
1931
|
name?: string;
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
disableBefore?: Date | string;
|
|
1895
|
-
disableAfter?: Date | string;
|
|
1932
|
+
/** Label/trigger orientation. Defaults to `'horizontal'`. */
|
|
1933
|
+
layout?: 'horizontal' | 'vertical';
|
|
1896
1934
|
disabled?: boolean;
|
|
1897
|
-
}
|
|
1898
|
-
/**
|
|
1899
|
-
* Custom calendar date picker.
|
|
1900
|
-
*
|
|
1901
|
-
* @example
|
|
1902
|
-
* <DatePicker.DatePicker
|
|
1903
|
-
* label="Report date"
|
|
1904
|
-
* value={form.date}
|
|
1905
|
-
* onChange={({ target }) => setField('date', target.value)}
|
|
1906
|
-
* disableAfter={new Date()}
|
|
1907
|
-
* />
|
|
1908
|
-
*/
|
|
1909
|
-
declare function DatePickerBase({ value, onChange, layout, label, htmlFor, name, style, errorMessage, disableBefore, disableAfter, disabled, }: DatePickerProps): react_jsx_runtime.JSX.Element;
|
|
1910
|
-
/** ─────────────────── TemporalPicker (year/number scroll) ─────────────────── */
|
|
1911
|
-
interface TemporalPickerProps {
|
|
1912
|
-
value: number;
|
|
1913
|
-
onChange: (e: {
|
|
1914
|
-
target: {
|
|
1915
|
-
value: number;
|
|
1916
|
-
};
|
|
1917
|
-
}) => void;
|
|
1918
|
-
type?: 'year';
|
|
1919
|
-
upperLimit?: number;
|
|
1920
|
-
lowerLimit?: number;
|
|
1921
1935
|
errorMessage?: React$1.ReactNode;
|
|
1922
|
-
|
|
1923
|
-
|
|
1936
|
+
/** Earliest selectable date. Dates before this render disabled. */
|
|
1937
|
+
min?: Date;
|
|
1938
|
+
/** Latest selectable date. Dates after this render disabled. */
|
|
1939
|
+
max?: Date;
|
|
1924
1940
|
style?: React$1.CSSProperties;
|
|
1941
|
+
/**
|
|
1942
|
+
* Custom formatter for the trigger display. Defaults to
|
|
1943
|
+
* `YYYY-MM-DD` via `toISOString().slice(0, 10)`.
|
|
1944
|
+
*/
|
|
1945
|
+
format?: (date: Date) => string;
|
|
1946
|
+
/** 0 = Sunday, 1 = Monday. Default `0`. */
|
|
1947
|
+
weekStartsOn?: 0 | 1;
|
|
1948
|
+
/** Allow the user to clear the date with a button in the popover. Default `true`. */
|
|
1949
|
+
clearable?: boolean;
|
|
1925
1950
|
}
|
|
1926
|
-
|
|
1927
|
-
/** ─────────────────── Namespace export ─────────────────── */
|
|
1951
|
+
type TemporalPickerProps = DatePickerProps;
|
|
1928
1952
|
/**
|
|
1929
|
-
*
|
|
1953
|
+
* Calendar date picker built on `@radix-ui/react-popover`.
|
|
1930
1954
|
*
|
|
1931
|
-
*
|
|
1932
|
-
*
|
|
1955
|
+
* Renders the calendar as a real `<table role="grid">` with weekday `<th>`
|
|
1956
|
+
* headers and per-day `<td role="gridcell">` cells, so screen readers get
|
|
1957
|
+
* proper row/column context.
|
|
1958
|
+
*
|
|
1959
|
+
* **Keyboard model** (focus is anywhere inside the grid):
|
|
1960
|
+
* - `←` `→` — previous / next day
|
|
1961
|
+
* - `↑` `↓` — previous / next week
|
|
1962
|
+
* - `PageUp` / `PageDown` — previous / next month
|
|
1963
|
+
* - `Home` / `End` — first / last day of the current week
|
|
1964
|
+
* - `Enter` / `Space` — select the focused day
|
|
1965
|
+
* - `Esc` — close the popover
|
|
1966
|
+
*
|
|
1967
|
+
* @example Required date
|
|
1968
|
+
* ```tsx
|
|
1969
|
+
* const [date, setDate] = useState<Date | null>(null)
|
|
1970
|
+
* <DatePicker
|
|
1971
|
+
* label="Report date"
|
|
1972
|
+
* value={date}
|
|
1973
|
+
* onChange={setDate}
|
|
1974
|
+
* max={new Date()}
|
|
1975
|
+
* />
|
|
1976
|
+
* ```
|
|
1933
1977
|
*
|
|
1934
|
-
*
|
|
1935
|
-
*
|
|
1978
|
+
* @example Custom format
|
|
1979
|
+
* ```tsx
|
|
1980
|
+
* <DatePicker
|
|
1981
|
+
* value={date}
|
|
1982
|
+
* onChange={setDate}
|
|
1983
|
+
* format={(d) => new Intl.DateTimeFormat('en-GB', { dateStyle: 'long' }).format(d)}
|
|
1984
|
+
* />
|
|
1985
|
+
* ```
|
|
1936
1986
|
*/
|
|
1937
|
-
declare
|
|
1938
|
-
DatePicker: typeof DatePickerBase;
|
|
1939
|
-
TemporalPicker: typeof TemporalPickerBase;
|
|
1940
|
-
};
|
|
1987
|
+
declare function DatePicker({ value, onChange, label, placeholder, htmlFor, name: _name, layout, disabled, errorMessage, min, max, style, format, weekStartsOn, clearable, }: DatePickerProps): react_jsx_runtime.JSX.Element;
|
|
1941
1988
|
|
|
1942
|
-
export { AppShell, type AppShellProps, AutoComplete, type AutoCompleteProps, Button, type ButtonProps, Catalog, CatalogCarousel, type CatalogCarouselProps, CatalogGrid, type CatalogGridProps, type CatalogProps, Checkbox, type CheckboxProps, ContextMenu, type ContextMenuActionItem, type ContextMenuPosition, type ContextMenuProps, type DatePickerProps, Drawer, type DrawerProps, Dropdown, type DropdownItem, DropdownPill, type DropdownPillProps, type DropdownProps, type ExpandRowOptions, FadingBase, type FadingBaseProps, FileInput, type FileInputProps, GridCard, type GridCardItem, type GridCardProps, Icon, IconButton, type IconButtonProps, List, type ListItem, type ListProps, LoadingSpinner, type LoadingSpinnerProps, MenuBar, MenuBarItem, type MenuBarItemConfig, type MenuBarItemProps, type MenuBarProps, Modal, type ModalProps, type NotificationPayload, NotificationProvider, NumberInput, type NumberInputProps, OpaqueGridCard, type OpaqueGridCardProps, type PaginationOptions, Password, type PasswordProps, Portal, type PortalProps, ScalableContainer, type ScalableContainerProps, SearchInput, type SearchInputProps, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, SkeletonBox, type SkeletonBoxProps, SkeletonCard, type SkeletonCardProps, SkeletonCircle, type SkeletonCircleProps, SkeletonText, type SkeletonTextProps, Switch, type SwitchInputProps, type TabItem, Table, type TableColumn, type TableProps, Tabs, type TabsProps, Temporal, type TemporalPickerProps, TextInput, type TextInputProps, type ThemeColors, type ThemeConfig, type ThemeDensity, type ThemeMotion, ThemeProvider, type ThemeProviderProps, type ThemeRadius, type ThemeShadows, ThemeSwitch, type ThemeSwitchProps, type ThemeTypography, ToggleButton, type ToggleButtonProps, type ToggleItem, Tooltip, type TooltipProps, TooltipProvider, TopBar, type TopBarProps, Tree, type TreeItemClickPayload, type TreeNode, type TreeProps, TreeSelect, type TreeSelectProps, Wizard, type WizardProps, type WizardStep, useNotification };
|
|
1989
|
+
export { AppShell, type AppShellProps, AutoComplete, type AutoCompleteProps, Button, type ButtonProps, Catalog, CatalogCarousel, type CatalogCarouselProps, CatalogGrid, type CatalogGridProps, type CatalogProps, Checkbox, type CheckboxProps, ContextMenu, type ContextMenuActionItem, type ContextMenuPosition, type ContextMenuProps, type DatePickerProps, Drawer, type DrawerProps, Dropdown, type DropdownItem, DropdownPill, type DropdownPillProps, type DropdownProps, type ExpandRowOptions, FadingBase, type FadingBaseProps, FileInput, type FileInputProps, GridCard, type GridCardItem, type GridCardProps, Icon, IconButton, type IconButtonProps, List, type ListItem, type ListProps, LoadingSpinner, type LoadingSpinnerProps, MenuBar, MenuBarItem, type MenuBarItemConfig, type MenuBarItemProps, type MenuBarProps, Modal, type ModalProps, type NotificationPayload, NotificationProvider, NumberInput, type NumberInputProps, OpaqueGridCard, type OpaqueGridCardProps, type PaginationOptions, Password, type PasswordProps, Portal, type PortalProps, ScalableContainer, type ScalableContainerProps, SearchInput, type SearchInputProps, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, SkeletonBox, type SkeletonBoxProps, SkeletonCard, type SkeletonCardProps, SkeletonCircle, type SkeletonCircleProps, SkeletonText, type SkeletonTextProps, Switch, type SwitchInputProps, type TabItem, Table, type TableColumn, type TableProps, Tabs, type TabsProps, DatePicker as Temporal, type TemporalPickerProps, TextInput, type TextInputProps, type ThemeColors, type ThemeConfig, type ThemeDensity, type ThemeMotion, ThemeProvider, type ThemeProviderProps, type ThemeRadius, type ThemeShadows, ThemeSwitch, type ThemeSwitchProps, type ThemeTypography, ToggleButton, type ToggleButtonProps, type ToggleItem, Tooltip, type TooltipProps, TooltipProvider, TopBar, type TopBarProps, Tree, type TreeItemClickPayload, type TreeNode, type TreeProps, TreeSelect, type TreeSelectProps, Wizard, type WizardProps, type WizardStep, useNotification };
|