@navikt/ds-react 8.1.0 → 8.2.1
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/cjs/accordion/Accordion.d.ts +9 -7
- package/cjs/accordion/Accordion.js +4 -1
- package/cjs/accordion/Accordion.js.map +1 -1
- package/cjs/accordion/index.d.ts +2 -4
- package/cjs/accordion/index.js +3 -6
- package/cjs/accordion/index.js.map +1 -1
- package/cjs/chat/Chat.d.ts +4 -2
- package/cjs/chat/Chat.js +2 -1
- package/cjs/chat/Chat.js.map +1 -1
- package/cjs/chat/index.d.ts +2 -2
- package/cjs/chat/index.js +1 -2
- package/cjs/chat/index.js.map +1 -1
- package/cjs/chips/Chips.d.ts +7 -6
- package/cjs/chips/Chips.js +3 -1
- package/cjs/chips/Chips.js.map +1 -1
- package/cjs/chips/index.d.ts +2 -3
- package/cjs/chips/index.js +2 -4
- package/cjs/chips/index.js.map +1 -1
- package/cjs/collapsible/Collapsible.d.ts +6 -4
- package/cjs/collapsible/Collapsible.js +4 -2
- package/cjs/collapsible/Collapsible.js.map +1 -1
- package/cjs/collapsible/index.d.ts +2 -3
- package/cjs/collapsible/index.js +2 -4
- package/cjs/collapsible/index.js.map +1 -1
- package/cjs/data/action-bar/root/DataActionBarRoot.d.ts +27 -0
- package/cjs/data/action-bar/root/DataActionBarRoot.js +49 -0
- package/cjs/data/action-bar/root/DataActionBarRoot.js.map +1 -0
- package/cjs/data/filter/index.d.ts +2 -0
- package/cjs/data/filter/index.js +8 -0
- package/cjs/data/filter/index.js.map +1 -0
- package/cjs/data/filter/item/DataFilterItem.d.ts +5 -0
- package/cjs/data/filter/item/DataFilterItem.js +24 -0
- package/cjs/data/filter/item/DataFilterItem.js.map +1 -0
- package/cjs/data/filter/root/DataFilterRoot.d.ts +23 -0
- package/cjs/data/filter/root/DataFilterRoot.js +28 -0
- package/cjs/data/filter/root/DataFilterRoot.js.map +1 -0
- package/cjs/data/stories/dummy-data.d.ts +17 -0
- package/cjs/data/stories/dummy-data.js +1526 -0
- package/cjs/data/stories/dummy-data.js.map +1 -0
- package/cjs/data/table/caption/DataTableCaption.d.ts +5 -0
- package/cjs/data/table/caption/DataTableCaption.js +55 -0
- package/cjs/data/table/caption/DataTableCaption.js.map +1 -0
- package/cjs/data/table/index.d.ts +2 -0
- package/cjs/data/table/index.js +16 -0
- package/cjs/data/table/index.js.map +1 -0
- package/cjs/data/table/root/DataTableRoot.d.ts +94 -0
- package/cjs/data/table/root/DataTableRoot.js +75 -0
- package/cjs/data/table/root/DataTableRoot.js.map +1 -0
- package/cjs/data/table/tbody/DataTableTbody.d.ts +5 -0
- package/cjs/data/table/tbody/DataTableTbody.js +55 -0
- package/cjs/data/table/tbody/DataTableTbody.js.map +1 -0
- package/cjs/data/table/td/DataTableTd.d.ts +5 -0
- package/cjs/data/table/td/DataTableTd.js +56 -0
- package/cjs/data/table/td/DataTableTd.js.map +1 -0
- package/cjs/data/table/th/DataTableTh.d.ts +15 -0
- package/cjs/data/table/th/DataTableTh.js +60 -0
- package/cjs/data/table/th/DataTableTh.js.map +1 -0
- package/cjs/data/table/thead/DataTableThead.d.ts +5 -0
- package/cjs/data/table/thead/DataTableThead.js +55 -0
- package/cjs/data/table/thead/DataTableThead.js.map +1 -0
- package/cjs/data/table/tr/DataTableTr.d.ts +5 -0
- package/cjs/data/table/tr/DataTableTr.js +55 -0
- package/cjs/data/table/tr/DataTableTr.js.map +1 -0
- package/cjs/data/toolbar/button/DataToolbarButton.d.ts +17 -0
- package/cjs/data/toolbar/button/DataToolbarButton.js +28 -0
- package/cjs/data/toolbar/button/DataToolbarButton.js.map +1 -0
- package/cjs/data/toolbar/index.d.ts +2 -0
- package/cjs/data/toolbar/index.js +9 -0
- package/cjs/data/toolbar/index.js.map +1 -0
- package/cjs/data/toolbar/root/DataToolbarRoot.d.ts +43 -0
- package/cjs/data/toolbar/root/DataToolbarRoot.js +35 -0
- package/cjs/data/toolbar/root/DataToolbarRoot.js.map +1 -0
- package/cjs/data/toolbar/search-field/DataToolbarSearchField.d.ts +8 -0
- package/cjs/data/toolbar/search-field/DataToolbarSearchField.js +29 -0
- package/cjs/data/toolbar/search-field/DataToolbarSearchField.js.map +1 -0
- package/cjs/data/toolbar/toggle-button/DataToolbarToggleButton.d.ts +37 -0
- package/cjs/data/toolbar/toggle-button/DataToolbarToggleButton.js +33 -0
- package/cjs/data/toolbar/toggle-button/DataToolbarToggleButton.js.map +1 -0
- package/cjs/date/datepicker/DatePicker.d.ts +6 -3
- package/cjs/date/datepicker/DatePicker.js +3 -1
- package/cjs/date/datepicker/DatePicker.js.map +1 -1
- package/cjs/date/datepicker/index.d.ts +2 -3
- package/cjs/date/datepicker/index.js +3 -5
- package/cjs/date/datepicker/index.js.map +1 -1
- package/cjs/date/monthpicker/MonthPicker.d.ts +5 -2
- package/cjs/date/monthpicker/MonthPicker.js +3 -1
- package/cjs/date/monthpicker/MonthPicker.js.map +1 -1
- package/cjs/date/monthpicker/index.d.ts +2 -4
- package/cjs/date/monthpicker/index.js +2 -4
- package/cjs/date/monthpicker/index.js.map +1 -1
- package/cjs/dialog/index.d.ts +2 -18
- package/cjs/dialog/index.js +8 -16
- package/cjs/dialog/index.js.map +1 -1
- package/cjs/dialog/root/DialogRoot.d.ts +10 -9
- package/cjs/dialog/root/DialogRoot.js +9 -1
- package/cjs/dialog/root/DialogRoot.js.map +1 -1
- package/cjs/form/file-upload/FileUpload.d.ts +2 -2
- package/cjs/form/file-upload/FileUpload.js +1 -1
- package/cjs/form/file-upload/FileUpload.js.map +1 -1
- package/cjs/form/search/Search.d.ts +2 -1
- package/cjs/form/search/Search.js.map +1 -1
- package/cjs/internal-header/InternalHeader.d.ts +16 -16
- package/cjs/internal-header/InternalHeader.js +10 -7
- package/cjs/internal-header/InternalHeader.js.map +1 -1
- package/cjs/internal-header/index.d.ts +2 -5
- package/cjs/internal-header/index.js +4 -8
- package/cjs/internal-header/index.js.map +1 -1
- package/cjs/layout/bleed/Bleed.d.ts +1 -1
- package/cjs/layout/bleed/Bleed.js +1 -1
- package/cjs/layout/responsive/Responsive.d.ts +4 -4
- package/cjs/layout/responsive/Responsive.js +4 -4
- package/cjs/layout/stack/HStack.d.ts +2 -2
- package/cjs/layout/stack/HStack.js +2 -2
- package/cjs/layout/stack/Spacer.d.ts +1 -1
- package/cjs/layout/stack/Spacer.js +1 -1
- package/cjs/layout/stack/VStack.d.ts +2 -2
- package/cjs/layout/stack/VStack.js +2 -2
- package/cjs/link-panel/LinkPanel.d.ts +1 -1
- package/cjs/link-panel/LinkPanel.js.map +1 -1
- package/cjs/list/List.d.ts +4 -2
- package/cjs/list/List.js +2 -1
- package/cjs/list/List.js.map +1 -1
- package/cjs/list/index.d.ts +2 -3
- package/cjs/list/index.js +1 -2
- package/cjs/list/index.js.map +1 -1
- package/cjs/overlays/action-menu/ActionMenu.d.ts +53 -43
- package/cjs/overlays/action-menu/ActionMenu.js +9 -10
- package/cjs/overlays/action-menu/ActionMenu.js.map +1 -1
- package/cjs/panel/Panel.d.ts +2 -2
- package/cjs/panel/Panel.js +2 -2
- package/cjs/stepper/Stepper.d.ts +4 -2
- package/cjs/stepper/Stepper.js +2 -1
- package/cjs/stepper/Stepper.js.map +1 -1
- package/cjs/stepper/index.d.ts +2 -2
- package/cjs/stepper/index.js +1 -2
- package/cjs/stepper/index.js.map +1 -1
- package/cjs/tabs/Tabs.d.ts +5 -3
- package/cjs/tabs/Tabs.js +4 -1
- package/cjs/tabs/Tabs.js.map +1 -1
- package/cjs/tabs/index.d.ts +2 -5
- package/cjs/tabs/index.js +3 -6
- package/cjs/tabs/index.js.map +1 -1
- package/cjs/toggle-group/ToggleGroup.d.ts +4 -2
- package/cjs/toggle-group/ToggleGroup.js +2 -1
- package/cjs/toggle-group/ToggleGroup.js.map +1 -1
- package/cjs/toggle-group/index.d.ts +2 -3
- package/cjs/toggle-group/index.js +1 -2
- package/cjs/toggle-group/index.js.map +1 -1
- package/esm/accordion/Accordion.d.ts +9 -7
- package/esm/accordion/Accordion.js +1 -0
- package/esm/accordion/Accordion.js.map +1 -1
- package/esm/accordion/index.d.ts +2 -4
- package/esm/accordion/index.js +1 -4
- package/esm/accordion/index.js.map +1 -1
- package/esm/chat/Chat.d.ts +4 -2
- package/esm/chat/Chat.js +1 -0
- package/esm/chat/Chat.js.map +1 -1
- package/esm/chat/index.d.ts +2 -2
- package/esm/chat/index.js +1 -2
- package/esm/chat/index.js.map +1 -1
- package/esm/chips/Chips.d.ts +7 -6
- package/esm/chips/Chips.js +1 -0
- package/esm/chips/Chips.js.map +1 -1
- package/esm/chips/index.d.ts +2 -3
- package/esm/chips/index.js +1 -3
- package/esm/chips/index.js.map +1 -1
- package/esm/collapsible/Collapsible.d.ts +6 -4
- package/esm/collapsible/Collapsible.js +2 -1
- package/esm/collapsible/Collapsible.js.map +1 -1
- package/esm/collapsible/index.d.ts +2 -3
- package/esm/collapsible/index.js +1 -3
- package/esm/collapsible/index.js.map +1 -1
- package/esm/data/action-bar/root/DataActionBarRoot.d.ts +27 -0
- package/esm/data/action-bar/root/DataActionBarRoot.js +43 -0
- package/esm/data/action-bar/root/DataActionBarRoot.js.map +1 -0
- package/esm/data/filter/index.d.ts +2 -0
- package/esm/data/filter/index.js +3 -0
- package/esm/data/filter/index.js.map +1 -0
- package/esm/data/filter/item/DataFilterItem.d.ts +5 -0
- package/esm/data/filter/item/DataFilterItem.js +18 -0
- package/esm/data/filter/item/DataFilterItem.js.map +1 -0
- package/esm/data/filter/root/DataFilterRoot.d.ts +23 -0
- package/esm/data/filter/root/DataFilterRoot.js +21 -0
- package/esm/data/filter/root/DataFilterRoot.js.map +1 -0
- package/esm/data/stories/dummy-data.d.ts +17 -0
- package/esm/data/stories/dummy-data.js +1520 -0
- package/esm/data/stories/dummy-data.js.map +1 -0
- package/esm/data/table/caption/DataTableCaption.d.ts +5 -0
- package/esm/data/table/caption/DataTableCaption.js +19 -0
- package/esm/data/table/caption/DataTableCaption.js.map +1 -0
- package/esm/data/table/index.d.ts +2 -0
- package/esm/data/table/index.js +3 -0
- package/esm/data/table/index.js.map +1 -0
- package/esm/data/table/root/DataTableRoot.d.ts +94 -0
- package/esm/data/table/root/DataTableRoot.js +33 -0
- package/esm/data/table/root/DataTableRoot.js.map +1 -0
- package/esm/data/table/tbody/DataTableTbody.d.ts +5 -0
- package/esm/data/table/tbody/DataTableTbody.js +19 -0
- package/esm/data/table/tbody/DataTableTbody.js.map +1 -0
- package/esm/data/table/td/DataTableTd.d.ts +5 -0
- package/esm/data/table/td/DataTableTd.js +20 -0
- package/esm/data/table/td/DataTableTd.js.map +1 -0
- package/esm/data/table/th/DataTableTh.d.ts +15 -0
- package/esm/data/table/th/DataTableTh.js +24 -0
- package/esm/data/table/th/DataTableTh.js.map +1 -0
- package/esm/data/table/thead/DataTableThead.d.ts +5 -0
- package/esm/data/table/thead/DataTableThead.js +19 -0
- package/esm/data/table/thead/DataTableThead.js.map +1 -0
- package/esm/data/table/tr/DataTableTr.d.ts +5 -0
- package/esm/data/table/tr/DataTableTr.js +19 -0
- package/esm/data/table/tr/DataTableTr.js.map +1 -0
- package/esm/data/toolbar/button/DataToolbarButton.d.ts +17 -0
- package/esm/data/toolbar/button/DataToolbarButton.js +22 -0
- package/esm/data/toolbar/button/DataToolbarButton.js.map +1 -0
- package/esm/data/toolbar/index.d.ts +2 -0
- package/esm/data/toolbar/index.js +3 -0
- package/esm/data/toolbar/index.js.map +1 -0
- package/esm/data/toolbar/root/DataToolbarRoot.d.ts +43 -0
- package/esm/data/toolbar/root/DataToolbarRoot.js +26 -0
- package/esm/data/toolbar/root/DataToolbarRoot.js.map +1 -0
- package/esm/data/toolbar/search-field/DataToolbarSearchField.d.ts +8 -0
- package/esm/data/toolbar/search-field/DataToolbarSearchField.js +23 -0
- package/esm/data/toolbar/search-field/DataToolbarSearchField.js.map +1 -0
- package/esm/data/toolbar/toggle-button/DataToolbarToggleButton.d.ts +37 -0
- package/esm/data/toolbar/toggle-button/DataToolbarToggleButton.js +27 -0
- package/esm/data/toolbar/toggle-button/DataToolbarToggleButton.js.map +1 -0
- package/esm/date/datepicker/DatePicker.d.ts +6 -3
- package/esm/date/datepicker/DatePicker.js +2 -1
- package/esm/date/datepicker/DatePicker.js.map +1 -1
- package/esm/date/datepicker/index.d.ts +2 -3
- package/esm/date/datepicker/index.js +1 -3
- package/esm/date/datepicker/index.js.map +1 -1
- package/esm/date/monthpicker/MonthPicker.d.ts +5 -2
- package/esm/date/monthpicker/MonthPicker.js +3 -2
- package/esm/date/monthpicker/MonthPicker.js.map +1 -1
- package/esm/date/monthpicker/index.d.ts +2 -4
- package/esm/date/monthpicker/index.js +1 -3
- package/esm/date/monthpicker/index.js.map +1 -1
- package/esm/dialog/index.d.ts +2 -18
- package/esm/dialog/index.js +1 -9
- package/esm/dialog/index.js.map +1 -1
- package/esm/dialog/root/DialogRoot.d.ts +10 -9
- package/esm/dialog/root/DialogRoot.js +3 -2
- package/esm/dialog/root/DialogRoot.js.map +1 -1
- package/esm/form/file-upload/FileUpload.d.ts +2 -2
- package/esm/form/file-upload/FileUpload.js +1 -1
- package/esm/form/file-upload/FileUpload.js.map +1 -1
- package/esm/form/search/Search.d.ts +2 -1
- package/esm/form/search/Search.js.map +1 -1
- package/esm/internal-header/InternalHeader.d.ts +16 -16
- package/esm/internal-header/InternalHeader.js +6 -6
- package/esm/internal-header/InternalHeader.js.map +1 -1
- package/esm/internal-header/index.d.ts +2 -5
- package/esm/internal-header/index.js +1 -5
- package/esm/internal-header/index.js.map +1 -1
- package/esm/layout/bleed/Bleed.d.ts +1 -1
- package/esm/layout/bleed/Bleed.js +1 -1
- package/esm/layout/responsive/Responsive.d.ts +4 -4
- package/esm/layout/responsive/Responsive.js +4 -4
- package/esm/layout/stack/HStack.d.ts +2 -2
- package/esm/layout/stack/HStack.js +2 -2
- package/esm/layout/stack/Spacer.d.ts +1 -1
- package/esm/layout/stack/Spacer.js +1 -1
- package/esm/layout/stack/VStack.d.ts +2 -2
- package/esm/layout/stack/VStack.js +2 -2
- package/esm/link-panel/LinkPanel.d.ts +1 -1
- package/esm/link-panel/LinkPanel.js.map +1 -1
- package/esm/list/List.d.ts +4 -2
- package/esm/list/List.js +1 -0
- package/esm/list/List.js.map +1 -1
- package/esm/list/index.d.ts +2 -3
- package/esm/list/index.js +1 -2
- package/esm/list/index.js.map +1 -1
- package/esm/overlays/action-menu/ActionMenu.d.ts +53 -43
- package/esm/overlays/action-menu/ActionMenu.js +9 -10
- package/esm/overlays/action-menu/ActionMenu.js.map +1 -1
- package/esm/panel/Panel.d.ts +2 -2
- package/esm/panel/Panel.js +2 -2
- package/esm/stepper/Stepper.d.ts +4 -2
- package/esm/stepper/Stepper.js +1 -0
- package/esm/stepper/Stepper.js.map +1 -1
- package/esm/stepper/index.d.ts +2 -2
- package/esm/stepper/index.js +1 -2
- package/esm/stepper/index.js.map +1 -1
- package/esm/tabs/Tabs.d.ts +5 -3
- package/esm/tabs/Tabs.js +1 -0
- package/esm/tabs/Tabs.js.map +1 -1
- package/esm/tabs/index.d.ts +2 -5
- package/esm/tabs/index.js +1 -4
- package/esm/tabs/index.js.map +1 -1
- package/esm/toggle-group/ToggleGroup.d.ts +4 -2
- package/esm/toggle-group/ToggleGroup.js +1 -0
- package/esm/toggle-group/ToggleGroup.js.map +1 -1
- package/esm/toggle-group/index.d.ts +2 -3
- package/esm/toggle-group/index.js +1 -2
- package/esm/toggle-group/index.js.map +1 -1
- package/package.json +8 -8
- package/src/accordion/Accordion.tsx +14 -14
- package/src/accordion/index.ts +11 -12
- package/src/chat/Chat.tsx +6 -5
- package/src/chat/index.ts +2 -2
- package/src/chips/Chips.tsx +8 -8
- package/src/chips/index.ts +6 -6
- package/src/collapsible/Collapsible.tsx +18 -10
- package/src/collapsible/index.ts +9 -8
- package/src/data/action-bar/root/DataActionBarRoot.tsx +59 -0
- package/src/data/filter/index.ts +6 -0
- package/src/data/filter/item/DataFilterItem.tsx +12 -0
- package/src/data/filter/root/DataFilterRoot.tsx +42 -0
- package/src/data/stories/dummy-data.tsx +1596 -0
- package/src/data/table/Readme.md +11 -0
- package/src/data/table/caption/DataTableCaption.tsx +20 -0
- package/src/data/table/index.tsx +19 -0
- package/src/data/table/root/DataTableRoot.tsx +145 -0
- package/src/data/table/tbody/DataTableTbody.tsx +19 -0
- package/src/data/table/td/DataTableTd.tsx +21 -0
- package/src/data/table/th/DataTableTh.tsx +70 -0
- package/src/data/table/thead/DataTableThead.tsx +19 -0
- package/src/data/table/tr/DataTableTr.tsx +19 -0
- package/src/data/toolbar/button/DataToolbarButton.tsx +34 -0
- package/src/data/toolbar/index.ts +11 -0
- package/src/data/toolbar/root/DataToolbarRoot.tsx +86 -0
- package/src/data/toolbar/search-field/DataToolbarSearchField.tsx +30 -0
- package/src/data/toolbar/toggle-button/DataToolbarToggleButton.tsx +67 -0
- package/src/date/datepicker/DatePicker.tsx +13 -5
- package/src/date/datepicker/index.ts +10 -6
- package/src/date/monthpicker/MonthPicker.tsx +13 -4
- package/src/date/monthpicker/index.ts +7 -5
- package/src/dialog/index.ts +22 -18
- package/src/dialog/root/DialogRoot.tsx +37 -9
- package/src/form/file-upload/FileUpload.tsx +5 -6
- package/src/form/search/Search.tsx +9 -6
- package/src/internal-header/InternalHeader.tsx +26 -21
- package/src/internal-header/index.ts +11 -17
- package/src/layout/bleed/Bleed.tsx +1 -1
- package/src/layout/responsive/Responsive.tsx +4 -4
- package/src/layout/stack/HStack.tsx +2 -2
- package/src/layout/stack/Spacer.tsx +1 -1
- package/src/layout/stack/VStack.tsx +2 -2
- package/src/link-panel/LinkPanel.tsx +6 -5
- package/src/list/List.tsx +5 -5
- package/src/list/index.ts +2 -3
- package/src/overlays/action-menu/ActionMenu.tsx +114 -86
- package/src/panel/Panel.tsx +2 -2
- package/src/stepper/Stepper.tsx +6 -5
- package/src/stepper/index.ts +2 -2
- package/src/tabs/Tabs.tsx +13 -7
- package/src/tabs/index.ts +7 -11
- package/src/toggle-group/ToggleGroup.tsx +7 -6
- package/src/toggle-group/index.ts +2 -6
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import { cl } from "../../../utils/helpers";
|
|
3
|
+
|
|
4
|
+
type DataTableCaptionProps = React.HTMLAttributes<HTMLTableCaptionElement>;
|
|
5
|
+
|
|
6
|
+
const DataTableCaption = forwardRef<
|
|
7
|
+
HTMLTableCaptionElement,
|
|
8
|
+
DataTableCaptionProps
|
|
9
|
+
>(({ className, ...rest }, forwardedRef) => {
|
|
10
|
+
return (
|
|
11
|
+
<caption
|
|
12
|
+
{...rest}
|
|
13
|
+
ref={forwardedRef}
|
|
14
|
+
className={cl("aksel-data-table__caption", className)}
|
|
15
|
+
/>
|
|
16
|
+
);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export { DataTableCaption };
|
|
20
|
+
export type { DataTableCaptionProps };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
export {
|
|
3
|
+
default as DataTable,
|
|
4
|
+
DataTableCaption,
|
|
5
|
+
DataTableThead,
|
|
6
|
+
DataTableTbody,
|
|
7
|
+
DataTableTr,
|
|
8
|
+
DataTableTh,
|
|
9
|
+
DataTableTd,
|
|
10
|
+
} from "./root/DataTableRoot";
|
|
11
|
+
export type {
|
|
12
|
+
DataTableProps,
|
|
13
|
+
DataTableCaptionProps,
|
|
14
|
+
DataTableTheadProps,
|
|
15
|
+
DataTableTbodyProps,
|
|
16
|
+
DataTableTrProps,
|
|
17
|
+
DataTableThProps,
|
|
18
|
+
DataTableTdProps,
|
|
19
|
+
} from "./root/DataTableRoot";
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import { cl } from "../../../utils/helpers";
|
|
3
|
+
import {
|
|
4
|
+
DataTableCaption,
|
|
5
|
+
type DataTableCaptionProps,
|
|
6
|
+
} from "../caption/DataTableCaption";
|
|
7
|
+
import {
|
|
8
|
+
DataTableTbody,
|
|
9
|
+
type DataTableTbodyProps,
|
|
10
|
+
} from "../tbody/DataTableTbody";
|
|
11
|
+
import { DataTableTd, type DataTableTdProps } from "../td/DataTableTd";
|
|
12
|
+
import { DataTableTh, type DataTableThProps } from "../th/DataTableTh";
|
|
13
|
+
import {
|
|
14
|
+
DataTableThead,
|
|
15
|
+
type DataTableTheadProps,
|
|
16
|
+
} from "../thead/DataTableThead";
|
|
17
|
+
import { DataTableTr, type DataTableTrProps } from "../tr/DataTableTr";
|
|
18
|
+
|
|
19
|
+
interface DataTableProps extends React.HTMLAttributes<HTMLTableElement> {
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface DataTableRootComponent extends React.ForwardRefExoticComponent<
|
|
24
|
+
DataTableProps & React.RefAttributes<HTMLDialogElement>
|
|
25
|
+
> {
|
|
26
|
+
/**
|
|
27
|
+
* @see 🏷️ {@link DataTableCaptionProps}
|
|
28
|
+
* @example
|
|
29
|
+
* ```jsx
|
|
30
|
+
* <DataTable>
|
|
31
|
+
* <DataTable.Caption>
|
|
32
|
+
* Lorem ipsum
|
|
33
|
+
* </DataTable.Caption
|
|
34
|
+
* </DataTable>
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
Caption: typeof DataTableCaption;
|
|
38
|
+
/**
|
|
39
|
+
* @see 🏷️ {@link DataTableTheadProps}
|
|
40
|
+
* @example
|
|
41
|
+
* ```jsx
|
|
42
|
+
* <DataTable>
|
|
43
|
+
* <DataTable.Thead>
|
|
44
|
+
* ... TODO
|
|
45
|
+
* </DataTable.Thead>
|
|
46
|
+
* </DataTable>
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
Thead: typeof DataTableThead;
|
|
50
|
+
/**
|
|
51
|
+
* @see 🏷️ {@link DataTableTbodyProps}
|
|
52
|
+
* @example
|
|
53
|
+
* ```jsx
|
|
54
|
+
* <DataTable>
|
|
55
|
+
* <DataTable.Tbody>
|
|
56
|
+
* ... TODO
|
|
57
|
+
* </DataTable.Tbody>
|
|
58
|
+
* </DataTable>
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
Tbody: typeof DataTableTbody;
|
|
62
|
+
/**
|
|
63
|
+
* @see 🏷️ {@link DataTableTrProps}
|
|
64
|
+
* @example
|
|
65
|
+
* ```jsx
|
|
66
|
+
* <DataTable>
|
|
67
|
+
* <DataTable.Tr>
|
|
68
|
+
* ... TODO
|
|
69
|
+
* </DataTable.Tr
|
|
70
|
+
* </DataTable>
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
Tr: typeof DataTableTr;
|
|
74
|
+
/**
|
|
75
|
+
* @see 🏷️ {@link DataTableThProps}
|
|
76
|
+
* @example
|
|
77
|
+
* ```jsx
|
|
78
|
+
* <DataTable>
|
|
79
|
+
* <DataTable.Thead>
|
|
80
|
+
* <DataTable.Th>Header 1</DataTable.Th>
|
|
81
|
+
* <DataTable.Th>Header 2</DataTable.Th>
|
|
82
|
+
* </DataTable.Thead>
|
|
83
|
+
* </DataTable>
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
Th: typeof DataTableTh;
|
|
87
|
+
/**
|
|
88
|
+
* @see 🏷️ {@link DataTableTdProps}
|
|
89
|
+
* @example
|
|
90
|
+
* ```jsx
|
|
91
|
+
* <DataTable>
|
|
92
|
+
* <DataTable.Tbody>
|
|
93
|
+
* <DataTable.Td>
|
|
94
|
+
* Lorem ipsum
|
|
95
|
+
* </DataTable.Td>
|
|
96
|
+
* <DataTable.Td>
|
|
97
|
+
* Dolor sit amet
|
|
98
|
+
* </DataTable.Td>
|
|
99
|
+
* </DataTable.Tbody>
|
|
100
|
+
* </DataTable>
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
Td: typeof DataTableTd;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const DataTable = forwardRef<HTMLTableElement, DataTableProps>(
|
|
107
|
+
({ className, ...rest }, forwardedRef) => {
|
|
108
|
+
return (
|
|
109
|
+
<div className="aksel-data-table__wrapper">
|
|
110
|
+
<table
|
|
111
|
+
{...rest}
|
|
112
|
+
ref={forwardedRef}
|
|
113
|
+
className={cl("aksel-data-table", className)}
|
|
114
|
+
/>
|
|
115
|
+
</div>
|
|
116
|
+
);
|
|
117
|
+
},
|
|
118
|
+
) as DataTableRootComponent;
|
|
119
|
+
|
|
120
|
+
DataTable.Caption = DataTableCaption;
|
|
121
|
+
DataTable.Thead = DataTableThead;
|
|
122
|
+
DataTable.Tbody = DataTableTbody;
|
|
123
|
+
DataTable.Th = DataTableTh;
|
|
124
|
+
DataTable.Tr = DataTableTr;
|
|
125
|
+
DataTable.Td = DataTableTd;
|
|
126
|
+
|
|
127
|
+
export {
|
|
128
|
+
DataTable,
|
|
129
|
+
DataTableCaption,
|
|
130
|
+
DataTableTbody,
|
|
131
|
+
DataTableTd,
|
|
132
|
+
DataTableTh,
|
|
133
|
+
DataTableThead,
|
|
134
|
+
DataTableTr,
|
|
135
|
+
};
|
|
136
|
+
export default DataTable;
|
|
137
|
+
export type {
|
|
138
|
+
DataTableProps,
|
|
139
|
+
DataTableCaptionProps,
|
|
140
|
+
DataTableTbodyProps,
|
|
141
|
+
DataTableTdProps,
|
|
142
|
+
DataTableThProps,
|
|
143
|
+
DataTableTheadProps,
|
|
144
|
+
DataTableTrProps,
|
|
145
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import { cl } from "../../../utils/helpers";
|
|
3
|
+
|
|
4
|
+
type DataTableTbodyProps = React.HTMLAttributes<HTMLTableSectionElement>;
|
|
5
|
+
|
|
6
|
+
const DataTableTbody = forwardRef<HTMLTableSectionElement, DataTableTbodyProps>(
|
|
7
|
+
({ className, ...rest }, forwardedRef) => {
|
|
8
|
+
return (
|
|
9
|
+
<tbody
|
|
10
|
+
{...rest}
|
|
11
|
+
ref={forwardedRef}
|
|
12
|
+
className={cl("aksel-data-table__tbody", className)}
|
|
13
|
+
/>
|
|
14
|
+
);
|
|
15
|
+
},
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
export { DataTableTbody };
|
|
19
|
+
export type { DataTableTbodyProps };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import { cl } from "../../../utils/helpers";
|
|
3
|
+
|
|
4
|
+
type DataTableTdProps = React.HTMLAttributes<HTMLTableCellElement>;
|
|
5
|
+
|
|
6
|
+
const DataTableTd = forwardRef<HTMLTableCellElement, DataTableTdProps>(
|
|
7
|
+
({ className, children, ...rest }, forwardedRef) => {
|
|
8
|
+
return (
|
|
9
|
+
<td
|
|
10
|
+
{...rest}
|
|
11
|
+
ref={forwardedRef}
|
|
12
|
+
className={cl("aksel-data-table__td", className)}
|
|
13
|
+
>
|
|
14
|
+
<div>{children}</div>
|
|
15
|
+
</td>
|
|
16
|
+
);
|
|
17
|
+
},
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export { DataTableTd };
|
|
21
|
+
export type { DataTableTdProps };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import {
|
|
3
|
+
CaretLeftRightIcon,
|
|
4
|
+
PushPinFillIcon,
|
|
5
|
+
PushPinIcon,
|
|
6
|
+
} from "@navikt/aksel-icons";
|
|
7
|
+
import { Button } from "../../../button";
|
|
8
|
+
import { cl } from "../../../utils/helpers";
|
|
9
|
+
|
|
10
|
+
type DataTableThProps = React.HTMLAttributes<HTMLTableCellElement> & {
|
|
11
|
+
resizeHandler?: React.MouseEventHandler<HTMLButtonElement>;
|
|
12
|
+
isPinned?: boolean;
|
|
13
|
+
pinningHandler?: React.MouseEventHandler<HTMLButtonElement>;
|
|
14
|
+
size?: number;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const DataTableTh = forwardRef<HTMLTableCellElement, DataTableThProps>(
|
|
18
|
+
(
|
|
19
|
+
{
|
|
20
|
+
className,
|
|
21
|
+
children,
|
|
22
|
+
resizeHandler,
|
|
23
|
+
isPinned = false,
|
|
24
|
+
pinningHandler,
|
|
25
|
+
size,
|
|
26
|
+
...rest
|
|
27
|
+
},
|
|
28
|
+
forwardedRef,
|
|
29
|
+
) => {
|
|
30
|
+
return (
|
|
31
|
+
<th
|
|
32
|
+
{...rest}
|
|
33
|
+
ref={forwardedRef}
|
|
34
|
+
className={cl("aksel-data-table__th", className)}
|
|
35
|
+
style={{ width: size }}
|
|
36
|
+
>
|
|
37
|
+
{children}
|
|
38
|
+
{pinningHandler && (
|
|
39
|
+
<Button
|
|
40
|
+
onClick={pinningHandler}
|
|
41
|
+
size="small"
|
|
42
|
+
variant="secondary"
|
|
43
|
+
icon={
|
|
44
|
+
isPinned ? (
|
|
45
|
+
<PushPinFillIcon aria-hidden title="Fest kolonne" />
|
|
46
|
+
) : (
|
|
47
|
+
<PushPinIcon aria-hidden title="Løstne kolonne" />
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
/>
|
|
51
|
+
)}
|
|
52
|
+
{resizeHandler && (
|
|
53
|
+
<Button
|
|
54
|
+
onMouseDown={resizeHandler}
|
|
55
|
+
onMouseUp={resizeHandler}
|
|
56
|
+
className={cl("aksel-data-table__th-resize-handle")}
|
|
57
|
+
size="small"
|
|
58
|
+
variant="secondary"
|
|
59
|
+
icon={
|
|
60
|
+
<CaretLeftRightIcon aria-hidden title="Endre kolonnestørrelse" />
|
|
61
|
+
}
|
|
62
|
+
/>
|
|
63
|
+
)}
|
|
64
|
+
</th>
|
|
65
|
+
);
|
|
66
|
+
},
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
export { DataTableTh };
|
|
70
|
+
export type { DataTableThProps };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import { cl } from "../../../utils/helpers";
|
|
3
|
+
|
|
4
|
+
type DataTableTheadProps = React.HTMLAttributes<HTMLTableSectionElement>;
|
|
5
|
+
|
|
6
|
+
const DataTableThead = forwardRef<HTMLTableSectionElement, DataTableTheadProps>(
|
|
7
|
+
({ className, ...rest }, forwardedRef) => {
|
|
8
|
+
return (
|
|
9
|
+
<thead
|
|
10
|
+
{...rest}
|
|
11
|
+
ref={forwardedRef}
|
|
12
|
+
className={cl("aksel-data-table__thead", className)}
|
|
13
|
+
/>
|
|
14
|
+
);
|
|
15
|
+
},
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
export { DataTableThead };
|
|
19
|
+
export type { DataTableTheadProps };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import { cl } from "../../../utils/helpers";
|
|
3
|
+
|
|
4
|
+
type DataTableTrProps = React.HTMLAttributes<HTMLTableRowElement>;
|
|
5
|
+
|
|
6
|
+
const DataTableTr = forwardRef<HTMLTableRowElement, DataTableTrProps>(
|
|
7
|
+
({ className, ...rest }, forwardedRef) => {
|
|
8
|
+
return (
|
|
9
|
+
<tr
|
|
10
|
+
{...rest}
|
|
11
|
+
ref={forwardedRef}
|
|
12
|
+
className={cl("aksel-data-table__tr", className)}
|
|
13
|
+
/>
|
|
14
|
+
);
|
|
15
|
+
},
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
export { DataTableTr };
|
|
19
|
+
export type { DataTableTrProps };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Button, ButtonProps } from "../../../button";
|
|
3
|
+
import { Tooltip } from "../../../tooltip";
|
|
4
|
+
|
|
5
|
+
type DataToolbarButtonProps = Omit<
|
|
6
|
+
ButtonProps,
|
|
7
|
+
"variant" | "size" | "data-color"
|
|
8
|
+
> & {
|
|
9
|
+
/**
|
|
10
|
+
* Kort beskrivelse av knappens funksjon.
|
|
11
|
+
*/
|
|
12
|
+
tooltip?: string; // TODO: Bør kanskje ikke være innebygget, men funker ikke å bruke Tooltip rundt Button rundt ActionMenu.Trigger i dag pga. props-forwarding i Tooltip
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const DataToolbarButton = React.forwardRef<
|
|
16
|
+
HTMLButtonElement,
|
|
17
|
+
DataToolbarButtonProps
|
|
18
|
+
>(({ tooltip, ...rest }, ref) => {
|
|
19
|
+
const button = (
|
|
20
|
+
<Button
|
|
21
|
+
ref={ref}
|
|
22
|
+
{...rest}
|
|
23
|
+
variant="secondary"
|
|
24
|
+
size="small"
|
|
25
|
+
data-color="neutral"
|
|
26
|
+
iconPosition="right"
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
return tooltip ? <Tooltip content={tooltip}>{button}</Tooltip> : button;
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export { DataToolbarButton };
|
|
33
|
+
export default DataToolbarButton;
|
|
34
|
+
export type { DataToolbarButtonProps };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
export {
|
|
3
|
+
DataToolbar,
|
|
4
|
+
DataToolbarSearchField,
|
|
5
|
+
DataToolbarToggleButton,
|
|
6
|
+
} from "./root/DataToolbarRoot";
|
|
7
|
+
export type {
|
|
8
|
+
DataToolbarProps,
|
|
9
|
+
DataToolbarSearchFieldProps,
|
|
10
|
+
DataToolbarToggleButtonProps,
|
|
11
|
+
} from "./root/DataToolbarRoot";
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { cl } from "../../../utils/helpers";
|
|
3
|
+
import DataToolbarButton, {
|
|
4
|
+
DataToolbarButtonProps,
|
|
5
|
+
} from "../button/DataToolbarButton";
|
|
6
|
+
import {
|
|
7
|
+
DataToolbarSearchField,
|
|
8
|
+
type DataToolbarSearchFieldProps,
|
|
9
|
+
} from "../search-field/DataToolbarSearchField";
|
|
10
|
+
import DataToolbarToggleButton, {
|
|
11
|
+
type DataToolbarToggleButtonProps,
|
|
12
|
+
} from "../toggle-button/DataToolbarToggleButton";
|
|
13
|
+
|
|
14
|
+
interface DataToolbarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface DataToolbarRootComponent extends React.ForwardRefExoticComponent<
|
|
19
|
+
DataToolbarProps & React.RefAttributes<HTMLDivElement>
|
|
20
|
+
> {
|
|
21
|
+
/**
|
|
22
|
+
* @see 🏷️ {@link DataToolbarSearchFieldProps}
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <DataToolbar>
|
|
26
|
+
* <DataToolbar.SearchField />
|
|
27
|
+
* </DataToolbar>
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
SearchField: typeof DataToolbarSearchField;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @see 🏷️ {@link DataToolbarButtonProps}
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* <DataToolbar>
|
|
37
|
+
* <DataToolbar.Button />
|
|
38
|
+
* </DataToolbar>
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
Button: typeof DataToolbarButton;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @see 🏷️ {@link DataToolbarToggleButtonProps}
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* <DataToolbar>
|
|
48
|
+
* <DataToolbar.ToggleButton />
|
|
49
|
+
* </DataToolbar>
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
ToggleButton: typeof DataToolbarToggleButton;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const DataToolbar = React.forwardRef<HTMLDivElement, DataToolbarProps>(
|
|
56
|
+
({ children, className, ...rest }, forwardRef) => {
|
|
57
|
+
return (
|
|
58
|
+
<div
|
|
59
|
+
ref={forwardRef}
|
|
60
|
+
{...rest}
|
|
61
|
+
className={cl("aksel-data-toolbar", className)}
|
|
62
|
+
role="toolbar"
|
|
63
|
+
>
|
|
64
|
+
{children}
|
|
65
|
+
</div>
|
|
66
|
+
);
|
|
67
|
+
},
|
|
68
|
+
) as DataToolbarRootComponent;
|
|
69
|
+
|
|
70
|
+
DataToolbar.SearchField = DataToolbarSearchField;
|
|
71
|
+
DataToolbar.Button = DataToolbarButton;
|
|
72
|
+
DataToolbar.ToggleButton = DataToolbarToggleButton;
|
|
73
|
+
|
|
74
|
+
export {
|
|
75
|
+
DataToolbar,
|
|
76
|
+
DataToolbarSearchField,
|
|
77
|
+
DataToolbarButton,
|
|
78
|
+
DataToolbarToggleButton,
|
|
79
|
+
};
|
|
80
|
+
export default DataToolbar;
|
|
81
|
+
export type {
|
|
82
|
+
DataToolbarProps,
|
|
83
|
+
DataToolbarSearchFieldProps,
|
|
84
|
+
DataToolbarButtonProps,
|
|
85
|
+
DataToolbarToggleButtonProps,
|
|
86
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Search, type SearchProps } from "../../../form/search";
|
|
3
|
+
import type { SearchNativeProps } from "../../../form/search/Search";
|
|
4
|
+
|
|
5
|
+
type DataToolbarSearchFieldProps = Omit<SearchNativeProps, "data-color"> &
|
|
6
|
+
Pick<SearchProps, "label" | "onChange">; // TODO: Vurder om label skal hardkodes (bør jo samsvare med placeholder...)
|
|
7
|
+
|
|
8
|
+
const DataToolbarSearchField = React.forwardRef<
|
|
9
|
+
HTMLInputElement,
|
|
10
|
+
DataToolbarSearchFieldProps
|
|
11
|
+
>(({ className, ...props }, ref) => {
|
|
12
|
+
// We need the wrapper because Search has width:100%
|
|
13
|
+
return (
|
|
14
|
+
<div>
|
|
15
|
+
<Search
|
|
16
|
+
className={className}
|
|
17
|
+
ref={ref}
|
|
18
|
+
{...props}
|
|
19
|
+
variant="simple"
|
|
20
|
+
size="small"
|
|
21
|
+
htmlSize="12"
|
|
22
|
+
placeholder="Hurtigfilter" // TODO: Oversett, og vurder om skal være overstyrbart
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export { DataToolbarSearchField };
|
|
29
|
+
export default DataToolbarSearchField;
|
|
30
|
+
export type { DataToolbarSearchFieldProps };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Button, ButtonProps } from "../../../button";
|
|
3
|
+
import { cl, composeEventHandlers } from "../../../utils/helpers";
|
|
4
|
+
import { useControllableState } from "../../../utils/hooks";
|
|
5
|
+
|
|
6
|
+
type DataToolbarToggleButtonProps = Omit<
|
|
7
|
+
ButtonProps,
|
|
8
|
+
"variant" | "size" | "data-color" | "children"
|
|
9
|
+
> &
|
|
10
|
+
Required<Pick<ButtonProps, "icon">> & {
|
|
11
|
+
/**
|
|
12
|
+
* Indicates whether the toggle button is pressed or not.
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
isPressed?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Default uncontrolled pressed state.
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
defaultPressed?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Callback for new pressed state.
|
|
23
|
+
*/
|
|
24
|
+
onPressChange?: (isPressed: boolean) => void;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const DataToolbarToggleButton = React.forwardRef<
|
|
28
|
+
HTMLButtonElement,
|
|
29
|
+
DataToolbarToggleButtonProps
|
|
30
|
+
>(
|
|
31
|
+
(
|
|
32
|
+
{
|
|
33
|
+
className,
|
|
34
|
+
isPressed,
|
|
35
|
+
defaultPressed = false,
|
|
36
|
+
onPressChange,
|
|
37
|
+
onClick,
|
|
38
|
+
...props
|
|
39
|
+
},
|
|
40
|
+
ref,
|
|
41
|
+
) => {
|
|
42
|
+
const [pressed, setPressed] = useControllableState({
|
|
43
|
+
defaultValue: defaultPressed,
|
|
44
|
+
value: isPressed,
|
|
45
|
+
onChange: onPressChange,
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<Button
|
|
50
|
+
className={cl("aksel-data-toolbar__toggle-button", className)}
|
|
51
|
+
ref={ref}
|
|
52
|
+
{...props}
|
|
53
|
+
variant="secondary"
|
|
54
|
+
size="small"
|
|
55
|
+
data-color="neutral"
|
|
56
|
+
aria-pressed={pressed}
|
|
57
|
+
onClick={composeEventHandlers(onClick, () =>
|
|
58
|
+
setPressed((oldState) => !oldState),
|
|
59
|
+
)}
|
|
60
|
+
/>
|
|
61
|
+
);
|
|
62
|
+
},
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
export { DataToolbarToggleButton };
|
|
66
|
+
export default DataToolbarToggleButton;
|
|
67
|
+
export type { DataToolbarToggleButtonProps };
|
|
@@ -6,7 +6,11 @@ import { cl } from "../../utils/helpers";
|
|
|
6
6
|
import { useControllableState, useMergeRefs } from "../../utils/hooks";
|
|
7
7
|
import { useI18n } from "../../utils/i18n/i18n.hooks";
|
|
8
8
|
import { DateDialog } from "../Date.Dialog";
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
DateInputContextProvider,
|
|
11
|
+
DateInputProps,
|
|
12
|
+
DatePickerInput,
|
|
13
|
+
} from "../Date.Input";
|
|
10
14
|
import {
|
|
11
15
|
DateTranslationContextProvider,
|
|
12
16
|
getTranslations,
|
|
@@ -17,13 +21,15 @@ import {
|
|
|
17
21
|
DatePickerDefaultProps,
|
|
18
22
|
} from "./DatePicker.types";
|
|
19
23
|
import { ReactDayPicker } from "./parts/DatePicker.RDP";
|
|
20
|
-
import DatePickerStandalone
|
|
24
|
+
import DatePickerStandalone, {
|
|
25
|
+
DatePickerStandaloneProps,
|
|
26
|
+
} from "./parts/DatePicker.Standalone";
|
|
21
27
|
|
|
22
|
-
|
|
28
|
+
type DatePickerProps = DatePickerDefaultProps & ConditionalModeProps;
|
|
23
29
|
|
|
24
|
-
interface DatePickerComponent
|
|
25
|
-
extends React.ForwardRefExoticComponent<DatePickerProps> {
|
|
30
|
+
interface DatePickerComponent extends React.ForwardRefExoticComponent<DatePickerProps> {
|
|
26
31
|
/**
|
|
32
|
+
* @see 🏷️ {@link DatePickerStandaloneProps}
|
|
27
33
|
* @example
|
|
28
34
|
* ```jsx
|
|
29
35
|
* <DatePicker.Standalone
|
|
@@ -175,3 +181,5 @@ DatePicker.Standalone = DatePickerStandalone;
|
|
|
175
181
|
DatePicker.Input = DatePickerInput;
|
|
176
182
|
|
|
177
183
|
export default DatePicker;
|
|
184
|
+
export { DatePickerStandalone, DatePickerInput };
|
|
185
|
+
export type { DatePickerProps, DatePickerStandaloneProps, DateInputProps };
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export {
|
|
2
|
+
export {
|
|
3
|
+
default as DatePicker,
|
|
4
|
+
DatePickerStandalone,
|
|
5
|
+
DatePickerInput,
|
|
6
|
+
} from "./DatePicker";
|
|
7
|
+
export type {
|
|
8
|
+
DatePickerProps,
|
|
9
|
+
DatePickerStandaloneProps,
|
|
10
|
+
DateInputProps,
|
|
11
|
+
} from "./DatePicker";
|
|
3
12
|
export {
|
|
4
13
|
useDatepicker,
|
|
5
14
|
type DateValidationT,
|
|
@@ -10,8 +19,3 @@ export {
|
|
|
10
19
|
type RangeValidationT,
|
|
11
20
|
type UseRangeDatepickerOptions,
|
|
12
21
|
} from "./hooks/useRangeDatepicker";
|
|
13
|
-
export {
|
|
14
|
-
DatePickerStandalone,
|
|
15
|
-
type DatePickerStandaloneProps,
|
|
16
|
-
} from "./parts/DatePicker.Standalone";
|
|
17
|
-
export { DatePickerInput, type DateInputProps } from "../Date.Input";
|
|
@@ -4,7 +4,11 @@ import { cl } from "../../utils/helpers";
|
|
|
4
4
|
import { useControllableState, useMergeRefs } from "../../utils/hooks";
|
|
5
5
|
import { useDateLocale, useI18n } from "../../utils/i18n/i18n.hooks";
|
|
6
6
|
import { DateDialog } from "../Date.Dialog";
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
DateInputContextProvider,
|
|
9
|
+
DateInputProps,
|
|
10
|
+
MonthPickerInput,
|
|
11
|
+
} from "../Date.Input";
|
|
8
12
|
import {
|
|
9
13
|
DateTranslationContextProvider,
|
|
10
14
|
getLocaleFromString,
|
|
@@ -13,12 +17,15 @@ import {
|
|
|
13
17
|
import { MonthPickerProvider } from "./MonthPicker.context";
|
|
14
18
|
import { MonthPickerProps } from "./MonthPicker.types";
|
|
15
19
|
import { MonthPickerCaption } from "./parts/MonthPicker.Caption";
|
|
16
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
MonthPickerStandalone,
|
|
22
|
+
MonthPickerStandaloneProps,
|
|
23
|
+
} from "./parts/MonthPicker.Standalone";
|
|
17
24
|
import { MonthPickerTable } from "./parts/MonthPicker.Table";
|
|
18
25
|
|
|
19
|
-
interface MonthPickerComponent
|
|
20
|
-
extends React.ForwardRefExoticComponent<MonthPickerProps> {
|
|
26
|
+
interface MonthPickerComponent extends React.ForwardRefExoticComponent<MonthPickerProps> {
|
|
21
27
|
/**
|
|
28
|
+
* @see 🏷️ {@link MonthPickerStandaloneProps}
|
|
22
29
|
* @example
|
|
23
30
|
* ```jsx
|
|
24
31
|
* <MonthPicker.Standalone
|
|
@@ -174,3 +181,5 @@ MonthPicker.Standalone = MonthPickerStandalone;
|
|
|
174
181
|
MonthPicker.Input = MonthPickerInput;
|
|
175
182
|
|
|
176
183
|
export default MonthPicker;
|
|
184
|
+
export { MonthPickerStandalone, MonthPickerInput };
|
|
185
|
+
export type { MonthPickerProps, MonthPickerStandaloneProps, DateInputProps };
|