@navikt/ds-react 0.18.1 → 0.18.3
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/_docs.json +9165 -0
- package/cjs/accordion/Accordion.js +6 -5
- package/cjs/accordion/index.js +0 -15
- package/cjs/alert/Alert.js +3 -2
- package/cjs/alert/index.js +0 -15
- package/cjs/button/Button.js +3 -2
- package/cjs/button/index.js +0 -15
- package/cjs/card/index.js +0 -15
- package/cjs/form/ConfirmationPanel.js +3 -2
- package/cjs/form/Fieldset/Fieldset.js +3 -3
- package/cjs/form/Fieldset/index.js +2 -2
- package/cjs/form/Select.js +4 -3
- package/cjs/form/Switch.js +3 -2
- package/cjs/form/TextField.js +4 -3
- package/cjs/form/Textarea.js +3 -3
- package/cjs/form/checkbox/Checkbox.js +3 -2
- package/cjs/form/checkbox/CheckboxGroup.js +3 -3
- package/cjs/form/error-summary/ErrorSummary.js +4 -3
- package/cjs/form/error-summary/ErrorSummaryItem.js +3 -2
- package/cjs/form/error-summary/index.js +0 -15
- package/cjs/form/index.js +6 -6
- package/cjs/form/radio/Radio.js +3 -2
- package/cjs/form/radio/RadioGroup.js +3 -3
- package/cjs/form/search/Search.js +4 -4
- package/cjs/grid/Cell.js +3 -2
- package/cjs/grid/ContentContainer.js +3 -2
- package/cjs/grid/Grid.js +3 -2
- package/cjs/grid/index.js +0 -17
- package/cjs/guide-panel/GuidePanel.js +3 -2
- package/cjs/guide-panel/index.js +0 -15
- package/cjs/help-text/HelpText.js +3 -2
- package/cjs/help-text/index.js +0 -15
- package/cjs/link/Link.js +3 -2
- package/cjs/link/index.js +0 -15
- package/cjs/link-panel/LinkPanel.js +3 -2
- package/cjs/link-panel/index.js +0 -15
- package/cjs/loader/Loader.js +3 -2
- package/cjs/loader/index.js +0 -15
- package/cjs/menu/Menu.js +5 -4
- package/cjs/menu/MenuCollapse.js +3 -3
- package/cjs/menu/MenuItem.js +3 -2
- package/cjs/modal/Modal.js +5 -4
- package/cjs/modal/index.js +0 -15
- package/cjs/page-header/index.js +0 -15
- package/cjs/pagination/Pagination.js +3 -3
- package/cjs/pagination/index.js +0 -15
- package/cjs/panel/Panel.js +3 -2
- package/cjs/panel/index.js +0 -15
- package/cjs/popover/Popover.js +4 -3
- package/cjs/popover/index.js +0 -15
- package/cjs/read-more/ReadMore.js +3 -2
- package/cjs/read-more/index.js +0 -15
- package/cjs/speech-bubble/SpeechBubble.js +4 -3
- package/cjs/speech-bubble/index.js +0 -15
- package/cjs/step-indicator/Step.js +5 -4
- package/cjs/step-indicator/StepIndicator.js +4 -4
- package/cjs/step-indicator/index.js +0 -15
- package/cjs/stepper/Step.js +5 -4
- package/cjs/stepper/Stepper.js +4 -4
- package/cjs/stepper/index.js +0 -15
- package/cjs/table/Body.js +3 -2
- package/cjs/table/ColumnHeader.js +5 -4
- package/cjs/table/DataCell.js +5 -4
- package/cjs/table/ExpandableRow.js +3 -2
- package/cjs/table/Header.js +3 -2
- package/cjs/table/HeaderCell.js +5 -3
- package/cjs/table/Row.js +3 -2
- package/cjs/table/Table.js +10 -10
- package/cjs/table/index.js +0 -15
- package/cjs/tabs/Tab.js +3 -2
- package/cjs/tabs/TabList.js +3 -2
- package/cjs/tabs/TabPanel.js +2 -2
- package/cjs/tabs/Tabs.js +6 -6
- package/cjs/tag/Tag.js +3 -2
- package/cjs/tag/index.js +0 -15
- package/cjs/toggle-group/ToggleGroup.js +4 -4
- package/cjs/tooltip/Tooltip.js +3 -2
- package/cjs/tooltip/index.js +0 -15
- package/cjs/typography/BodyLong.js +3 -2
- package/cjs/typography/BodyShort.js +3 -2
- package/cjs/typography/Detail.js +3 -2
- package/cjs/typography/Heading.js +3 -2
- package/cjs/typography/Ingress.js +3 -2
- package/cjs/typography/Label.js +3 -2
- package/cjs/typography/index.js +5 -5
- package/esm/accordion/Accordion.d.ts +1 -1
- package/esm/accordion/Accordion.js +1 -1
- package/esm/accordion/Accordion.js.map +1 -1
- package/esm/accordion/AccordionHeader.d.ts +1 -1
- package/esm/accordion/AccordionItem.d.ts +2 -2
- package/esm/accordion/index.d.ts +1 -2
- package/esm/accordion/index.js +0 -1
- package/esm/accordion/index.js.map +1 -1
- package/esm/alert/Alert.d.ts +2 -2
- package/esm/alert/Alert.js +1 -1
- package/esm/alert/Alert.js.map +1 -1
- package/esm/alert/index.d.ts +1 -1
- package/esm/alert/index.js +0 -1
- package/esm/alert/index.js.map +1 -1
- package/esm/button/Button.d.ts +3 -3
- package/esm/button/Button.js +1 -1
- package/esm/button/Button.js.map +1 -1
- package/esm/button/index.d.ts +1 -1
- package/esm/button/index.js +0 -1
- package/esm/button/index.js.map +1 -1
- package/esm/card/index.d.ts +1 -1
- package/esm/card/index.js +0 -1
- package/esm/card/index.js.map +1 -1
- package/esm/form/ConfirmationPanel.d.ts +1 -1
- package/esm/form/ConfirmationPanel.js +1 -1
- package/esm/form/ConfirmationPanel.js.map +1 -1
- package/esm/form/Fieldset/Fieldset.d.ts +1 -1
- package/esm/form/Fieldset/Fieldset.js +1 -1
- package/esm/form/Fieldset/Fieldset.js.map +1 -1
- package/esm/form/Fieldset/index.d.ts +1 -1
- package/esm/form/Fieldset/index.js +1 -1
- package/esm/form/Fieldset/index.js.map +1 -1
- package/esm/form/Select.d.ts +1 -1
- package/esm/form/Select.js +2 -2
- package/esm/form/Select.js.map +1 -1
- package/esm/form/Switch.d.ts +1 -1
- package/esm/form/Switch.js +1 -1
- package/esm/form/Switch.js.map +1 -1
- package/esm/form/TextField.d.ts +1 -1
- package/esm/form/TextField.js +2 -2
- package/esm/form/TextField.js.map +1 -1
- package/esm/form/Textarea.d.ts +1 -1
- package/esm/form/Textarea.js +1 -1
- package/esm/form/Textarea.js.map +1 -1
- package/esm/form/checkbox/Checkbox.d.ts +1 -1
- package/esm/form/checkbox/Checkbox.js +1 -1
- package/esm/form/checkbox/Checkbox.js.map +1 -1
- package/esm/form/checkbox/CheckboxGroup.d.ts +1 -1
- package/esm/form/checkbox/CheckboxGroup.js +1 -1
- package/esm/form/checkbox/CheckboxGroup.js.map +1 -1
- package/esm/form/error-summary/ErrorSummary.d.ts +1 -1
- package/esm/form/error-summary/ErrorSummary.js +1 -1
- package/esm/form/error-summary/ErrorSummary.js.map +1 -1
- package/esm/form/error-summary/ErrorSummaryItem.d.ts +1 -1
- package/esm/form/error-summary/ErrorSummaryItem.js +1 -1
- package/esm/form/error-summary/ErrorSummaryItem.js.map +1 -1
- package/esm/form/error-summary/index.d.ts +1 -1
- package/esm/form/error-summary/index.js +0 -1
- package/esm/form/error-summary/index.js.map +1 -1
- package/esm/form/index.d.ts +5 -5
- package/esm/form/index.js +3 -3
- package/esm/form/index.js.map +1 -1
- package/esm/form/radio/Radio.d.ts +1 -1
- package/esm/form/radio/Radio.js +1 -1
- package/esm/form/radio/Radio.js.map +1 -1
- package/esm/form/radio/RadioGroup.d.ts +1 -1
- package/esm/form/radio/RadioGroup.js +1 -1
- package/esm/form/radio/RadioGroup.js.map +1 -1
- package/esm/form/search/Search.d.ts +1 -1
- package/esm/form/search/Search.js +1 -1
- package/esm/form/search/Search.js.map +1 -1
- package/esm/grid/Cell.d.ts +1 -1
- package/esm/grid/Cell.js +1 -1
- package/esm/grid/Cell.js.map +1 -1
- package/esm/grid/ContentContainer.d.ts +1 -1
- package/esm/grid/ContentContainer.js +1 -1
- package/esm/grid/ContentContainer.js.map +1 -1
- package/esm/grid/Grid.d.ts +1 -1
- package/esm/grid/Grid.js +1 -1
- package/esm/grid/Grid.js.map +1 -1
- package/esm/grid/index.d.ts +3 -6
- package/esm/grid/index.js +1 -4
- package/esm/grid/index.js.map +1 -1
- package/esm/guide-panel/GuidePanel.d.ts +1 -1
- package/esm/guide-panel/GuidePanel.js +1 -1
- package/esm/guide-panel/GuidePanel.js.map +1 -1
- package/esm/guide-panel/index.d.ts +1 -2
- package/esm/guide-panel/index.js +0 -1
- package/esm/guide-panel/index.js.map +1 -1
- package/esm/help-text/HelpText.d.ts +1 -1
- package/esm/help-text/HelpText.js +1 -1
- package/esm/help-text/HelpText.js.map +1 -1
- package/esm/help-text/index.d.ts +1 -1
- package/esm/help-text/index.js +0 -1
- package/esm/help-text/index.js.map +1 -1
- package/esm/link/Link.d.ts +1 -1
- package/esm/link/Link.js +1 -1
- package/esm/link/Link.js.map +1 -1
- package/esm/link/index.d.ts +1 -1
- package/esm/link/index.js +0 -1
- package/esm/link/index.js.map +1 -1
- package/esm/link-panel/LinkPanel.d.ts +1 -0
- package/esm/link-panel/LinkPanel.js +1 -1
- package/esm/link-panel/LinkPanel.js.map +1 -1
- package/esm/link-panel/index.d.ts +1 -1
- package/esm/link-panel/index.js +0 -1
- package/esm/link-panel/index.js.map +1 -1
- package/esm/loader/Loader.d.ts +1 -1
- package/esm/loader/Loader.js +1 -1
- package/esm/loader/Loader.js.map +1 -1
- package/esm/loader/index.d.ts +1 -1
- package/esm/loader/index.js +0 -1
- package/esm/loader/index.js.map +1 -1
- package/esm/menu/Menu.d.ts +1 -1
- package/esm/menu/Menu.js +1 -1
- package/esm/menu/Menu.js.map +1 -1
- package/esm/menu/MenuCollapse.d.ts +1 -1
- package/esm/menu/MenuCollapse.js +1 -1
- package/esm/menu/MenuCollapse.js.map +1 -1
- package/esm/menu/MenuItem.d.ts +1 -1
- package/esm/menu/MenuItem.js +1 -1
- package/esm/menu/MenuItem.js.map +1 -1
- package/esm/modal/Modal.d.ts +1 -1
- package/esm/modal/Modal.js +1 -1
- package/esm/modal/Modal.js.map +1 -1
- package/esm/modal/index.d.ts +1 -2
- package/esm/modal/index.js +0 -1
- package/esm/modal/index.js.map +1 -1
- package/esm/page-header/index.d.ts +1 -1
- package/esm/page-header/index.js +0 -1
- package/esm/page-header/index.js.map +1 -1
- package/esm/pagination/Pagination.d.ts +2 -2
- package/esm/pagination/Pagination.js +1 -1
- package/esm/pagination/Pagination.js.map +1 -1
- package/esm/pagination/index.d.ts +1 -1
- package/esm/pagination/index.js +0 -1
- package/esm/pagination/index.js.map +1 -1
- package/esm/panel/Panel.d.ts +1 -1
- package/esm/panel/Panel.js +1 -1
- package/esm/panel/Panel.js.map +1 -1
- package/esm/panel/index.d.ts +1 -1
- package/esm/panel/index.js +0 -1
- package/esm/panel/index.js.map +1 -1
- package/esm/popover/Popover.d.ts +1 -1
- package/esm/popover/Popover.js +1 -1
- package/esm/popover/Popover.js.map +1 -1
- package/esm/popover/index.d.ts +1 -2
- package/esm/popover/index.js +0 -1
- package/esm/popover/index.js.map +1 -1
- package/esm/read-more/ReadMore.d.ts +1 -1
- package/esm/read-more/ReadMore.js +1 -1
- package/esm/read-more/ReadMore.js.map +1 -1
- package/esm/read-more/index.d.ts +1 -2
- package/esm/read-more/index.js +0 -1
- package/esm/read-more/index.js.map +1 -1
- package/esm/speech-bubble/SpeechBubble.d.ts +1 -1
- package/esm/speech-bubble/SpeechBubble.js +1 -1
- package/esm/speech-bubble/SpeechBubble.js.map +1 -1
- package/esm/speech-bubble/index.d.ts +1 -2
- package/esm/speech-bubble/index.js +0 -1
- package/esm/speech-bubble/index.js.map +1 -1
- package/esm/step-indicator/Step.d.ts +1 -0
- package/esm/step-indicator/Step.js +3 -3
- package/esm/step-indicator/Step.js.map +1 -1
- package/esm/step-indicator/StepIndicator.d.ts +1 -1
- package/esm/step-indicator/StepIndicator.js +3 -3
- package/esm/step-indicator/StepIndicator.js.map +1 -1
- package/esm/step-indicator/index.d.ts +1 -2
- package/esm/step-indicator/index.js +0 -1
- package/esm/step-indicator/index.js.map +1 -1
- package/esm/stepper/Step.d.ts +1 -0
- package/esm/stepper/Step.js +2 -2
- package/esm/stepper/Step.js.map +1 -1
- package/esm/stepper/Stepper.d.ts +1 -1
- package/esm/stepper/Stepper.js +1 -1
- package/esm/stepper/Stepper.js.map +1 -1
- package/esm/stepper/index.d.ts +1 -2
- package/esm/stepper/index.js +0 -1
- package/esm/stepper/index.js.map +1 -1
- package/esm/table/Body.d.ts +2 -2
- package/esm/table/Body.js +1 -1
- package/esm/table/Body.js.map +1 -1
- package/esm/table/ColumnHeader.d.ts +2 -2
- package/esm/table/ColumnHeader.js +2 -2
- package/esm/table/ColumnHeader.js.map +1 -1
- package/esm/table/DataCell.d.ts +2 -2
- package/esm/table/DataCell.js +2 -2
- package/esm/table/DataCell.js.map +1 -1
- package/esm/table/ExpandableRow.d.ts +2 -2
- package/esm/table/ExpandableRow.js +1 -1
- package/esm/table/ExpandableRow.js.map +1 -1
- package/esm/table/Header.d.ts +2 -2
- package/esm/table/Header.js +1 -1
- package/esm/table/Header.js.map +1 -1
- package/esm/table/HeaderCell.d.ts +1 -1
- package/esm/table/HeaderCell.js +3 -2
- package/esm/table/HeaderCell.js.map +1 -1
- package/esm/table/Row.d.ts +1 -1
- package/esm/table/Row.js +1 -1
- package/esm/table/Row.js.map +1 -1
- package/esm/table/Table.d.ts +1 -1
- package/esm/table/Table.js +1 -1
- package/esm/table/Table.js.map +1 -1
- package/esm/table/index.d.ts +8 -2
- package/esm/table/index.js +0 -1
- package/esm/table/index.js.map +1 -1
- package/esm/tabs/Tab.d.ts +1 -1
- package/esm/tabs/Tab.js +1 -1
- package/esm/tabs/Tab.js.map +1 -1
- package/esm/tabs/TabList.d.ts +4 -4
- package/esm/tabs/TabList.js +2 -2
- package/esm/tabs/TabList.js.map +1 -1
- package/esm/tabs/TabPanel.d.ts +4 -4
- package/esm/tabs/TabPanel.js +2 -2
- package/esm/tabs/TabPanel.js.map +1 -1
- package/esm/tabs/Tabs.d.ts +5 -5
- package/esm/tabs/Tabs.js +5 -5
- package/esm/tabs/Tabs.js.map +1 -1
- package/esm/tabs/index.d.ts +3 -1
- package/esm/tabs/index.js.map +1 -1
- package/esm/tag/Tag.d.ts +1 -1
- package/esm/tag/Tag.js +1 -1
- package/esm/tag/Tag.js.map +1 -1
- package/esm/tag/index.d.ts +1 -2
- package/esm/tag/index.js +0 -1
- package/esm/tag/index.js.map +1 -1
- package/esm/toggle-group/ToggleGroup.d.ts +1 -1
- package/esm/toggle-group/ToggleGroup.js +1 -1
- package/esm/toggle-group/ToggleGroup.js.map +1 -1
- package/esm/toggle-group/index.d.ts +2 -2
- package/esm/toggle-group/index.js.map +1 -1
- package/esm/tooltip/Tooltip.d.ts +1 -1
- package/esm/tooltip/Tooltip.js +1 -1
- package/esm/tooltip/Tooltip.js.map +1 -1
- package/esm/tooltip/index.d.ts +1 -2
- package/esm/tooltip/index.js +0 -1
- package/esm/tooltip/index.js.map +1 -1
- package/esm/typography/BodyLong.d.ts +1 -1
- package/esm/typography/BodyLong.js +1 -1
- package/esm/typography/BodyLong.js.map +1 -1
- package/esm/typography/BodyShort.d.ts +1 -1
- package/esm/typography/BodyShort.js +1 -1
- package/esm/typography/BodyShort.js.map +1 -1
- package/esm/typography/Detail.d.ts +1 -1
- package/esm/typography/Detail.js +1 -1
- package/esm/typography/Detail.js.map +1 -1
- package/esm/typography/Heading.d.ts +1 -1
- package/esm/typography/Heading.js +1 -1
- package/esm/typography/Heading.js.map +1 -1
- package/esm/typography/Ingress.d.ts +1 -1
- package/esm/typography/Ingress.js +1 -1
- package/esm/typography/Ingress.js.map +1 -1
- package/esm/typography/Label.d.ts +1 -1
- package/esm/typography/Label.js +1 -1
- package/esm/typography/Label.js.map +1 -1
- package/esm/typography/index.d.ts +6 -6
- package/esm/typography/index.js +2 -2
- package/esm/typography/index.js.map +1 -1
- package/package.json +10 -5
- package/src/accordion/Accordion.tsx +1 -1
- package/src/accordion/AccordionHeader.tsx +1 -1
- package/src/accordion/AccordionItem.tsx +2 -2
- package/src/accordion/index.ts +1 -2
- package/src/alert/Alert.tsx +2 -2
- package/src/alert/index.ts +1 -1
- package/src/button/Button.tsx +6 -3
- package/src/button/index.ts +1 -1
- package/src/card/index.ts +1 -1
- package/src/form/ConfirmationPanel.tsx +25 -24
- package/src/form/Fieldset/Fieldset.tsx +2 -1
- package/src/form/Fieldset/index.ts +5 -1
- package/src/form/Select.tsx +72 -68
- package/src/form/Switch.tsx +82 -80
- package/src/form/TextField.tsx +86 -82
- package/src/form/Textarea.tsx +1 -1
- package/src/form/checkbox/Checkbox.tsx +63 -61
- package/src/form/checkbox/CheckboxGroup.tsx +4 -1
- package/src/form/error-summary/ErrorSummary.tsx +1 -1
- package/src/form/error-summary/ErrorSummaryItem.tsx +1 -1
- package/src/form/error-summary/index.ts +1 -1
- package/src/form/index.ts +7 -11
- package/src/form/radio/Radio.tsx +1 -1
- package/src/form/radio/RadioGroup.tsx +1 -1
- package/src/form/search/Search.tsx +130 -128
- package/src/grid/Cell.tsx +1 -1
- package/src/grid/ContentContainer.tsx +10 -9
- package/src/grid/Grid.tsx +2 -1
- package/src/grid/index.ts +6 -6
- package/src/guide-panel/GuidePanel.tsx +1 -1
- package/src/guide-panel/index.ts +1 -2
- package/src/help-text/HelpText.tsx +1 -1
- package/src/help-text/index.ts +1 -1
- package/src/link/Link.tsx +1 -1
- package/src/link/index.ts +1 -1
- package/src/link-panel/LinkPanel.tsx +1 -1
- package/src/link-panel/index.ts +1 -1
- package/src/loader/Loader.tsx +1 -1
- package/src/loader/index.ts +1 -1
- package/src/menu/Menu.tsx +1 -1
- package/src/menu/MenuCollapse.tsx +1 -1
- package/src/menu/MenuItem.tsx +1 -1
- package/src/modal/Modal.tsx +1 -1
- package/src/modal/index.ts +1 -2
- package/src/page-header/index.ts +1 -1
- package/src/pagination/Pagination.tsx +2 -2
- package/src/pagination/index.ts +1 -1
- package/src/panel/Panel.tsx +1 -1
- package/src/panel/index.ts +1 -1
- package/src/popover/Popover.tsx +1 -1
- package/src/popover/index.ts +1 -2
- package/src/read-more/ReadMore.tsx +1 -1
- package/src/read-more/index.ts +1 -2
- package/src/speech-bubble/SpeechBubble.tsx +1 -1
- package/src/speech-bubble/index.ts +1 -2
- package/src/step-indicator/Step.tsx +3 -3
- package/src/step-indicator/StepIndicator.tsx +6 -3
- package/src/step-indicator/index.ts +1 -2
- package/src/stepper/Step.tsx +2 -2
- package/src/stepper/Stepper.tsx +4 -1
- package/src/stepper/index.ts +1 -2
- package/src/table/Body.tsx +3 -2
- package/src/table/ColumnHeader.tsx +3 -3
- package/src/table/DataCell.tsx +4 -3
- package/src/table/ExpandableRow.tsx +2 -2
- package/src/table/Header.tsx +3 -2
- package/src/table/HeaderCell.tsx +3 -2
- package/src/table/Row.tsx +1 -1
- package/src/table/Table.tsx +1 -1
- package/src/table/index.ts +8 -2
- package/src/tabs/Tab.tsx +1 -1
- package/src/tabs/TabList.tsx +6 -6
- package/src/tabs/TabPanel.tsx +6 -6
- package/src/tabs/Tabs.tsx +7 -7
- package/src/tabs/index.ts +3 -1
- package/src/tag/Tag.tsx +1 -1
- package/src/tag/index.ts +1 -2
- package/src/toggle-group/ToggleGroup.tsx +1 -1
- package/src/toggle-group/index.ts +2 -2
- package/src/tooltip/Tooltip.tsx +1 -1
- package/src/tooltip/index.ts +1 -2
- package/src/typography/BodyLong.tsx +1 -1
- package/src/typography/BodyShort.tsx +1 -1
- package/src/typography/Detail.tsx +1 -1
- package/src/typography/Heading.tsx +1 -1
- package/src/typography/Ingress.tsx +1 -1
- package/src/typography/Label.tsx +1 -1
- package/src/typography/index.ts +6 -6
|
@@ -76,148 +76,150 @@ export const SearchContext = React.createContext<SearchContextProps | null>(
|
|
|
76
76
|
null
|
|
77
77
|
);
|
|
78
78
|
|
|
79
|
-
const Search = forwardRef<HTMLInputElement, SearchProps>(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
export const Search = forwardRef<HTMLInputElement, SearchProps>(
|
|
80
|
+
(props, ref) => {
|
|
81
|
+
const { inputProps, size = "medium", inputDescriptionId } = useSearch(
|
|
82
|
+
props,
|
|
83
|
+
"searchfield"
|
|
84
|
+
);
|
|
84
85
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
86
|
+
const {
|
|
87
|
+
className,
|
|
88
|
+
hideLabel = true,
|
|
89
|
+
label,
|
|
90
|
+
description,
|
|
91
|
+
value,
|
|
92
|
+
clearButtonLabel,
|
|
93
|
+
onClear,
|
|
94
|
+
clearButton = true,
|
|
95
|
+
children,
|
|
96
|
+
variant = "primary",
|
|
97
|
+
defaultValue,
|
|
98
|
+
onChange,
|
|
99
|
+
...rest
|
|
100
|
+
} = props;
|
|
100
101
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
const searchRef = useRef<HTMLInputElement | null>(null);
|
|
103
|
+
const mergedRef = mergeRefs([searchRef, ref]);
|
|
104
|
+
const [wrapperRef, setWrapperRef] = useState<HTMLDivElement | null>(null);
|
|
104
105
|
|
|
105
|
-
|
|
106
|
+
const [internalValue, setInternalValue] = useState(defaultValue ?? "");
|
|
106
107
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
const handleClear = useCallback(
|
|
116
|
-
(event: SearchClearEvent) => {
|
|
117
|
-
onClear?.(event);
|
|
118
|
-
handleChange("");
|
|
119
|
-
searchRef.current && searchRef.current?.focus?.();
|
|
120
|
-
},
|
|
121
|
-
[handleChange, onClear]
|
|
122
|
-
);
|
|
108
|
+
const handleChange = useCallback(
|
|
109
|
+
(v: string) => {
|
|
110
|
+
value === undefined && setInternalValue(v);
|
|
111
|
+
onChange?.(v);
|
|
112
|
+
},
|
|
113
|
+
[onChange, value]
|
|
114
|
+
);
|
|
123
115
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
e.preventDefault();
|
|
130
|
-
handleClear({ trigger: "Escape", event: e });
|
|
131
|
-
}
|
|
116
|
+
const handleClear = useCallback(
|
|
117
|
+
(event: SearchClearEvent) => {
|
|
118
|
+
onClear?.(event);
|
|
119
|
+
handleChange("");
|
|
120
|
+
searchRef.current && searchRef.current?.focus?.();
|
|
132
121
|
},
|
|
133
|
-
[
|
|
134
|
-
)
|
|
135
|
-
wrapperRef
|
|
136
|
-
);
|
|
122
|
+
[handleChange, onClear]
|
|
123
|
+
);
|
|
137
124
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
className={cl(
|
|
156
|
-
|
|
157
|
-
|
|
125
|
+
useEventListener(
|
|
126
|
+
"keydown",
|
|
127
|
+
useCallback(
|
|
128
|
+
(e) => {
|
|
129
|
+
if (e.key === "Escape") {
|
|
130
|
+
e.preventDefault();
|
|
131
|
+
handleClear({ trigger: "Escape", event: e });
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
[handleClear]
|
|
135
|
+
),
|
|
136
|
+
wrapperRef
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
return (
|
|
140
|
+
<div
|
|
141
|
+
ref={setWrapperRef}
|
|
142
|
+
className={cl(
|
|
143
|
+
className,
|
|
144
|
+
"navds-form-field",
|
|
145
|
+
`navds-form-field--${size}`,
|
|
146
|
+
"navds-search",
|
|
147
|
+
{
|
|
148
|
+
"navds-search--disabled": !!inputProps.disabled,
|
|
149
|
+
}
|
|
150
|
+
)}
|
|
158
151
|
>
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
className={cl("navds-text-field__description", {
|
|
152
|
+
<Label
|
|
153
|
+
htmlFor={inputProps.id}
|
|
154
|
+
size={size}
|
|
155
|
+
as="label"
|
|
156
|
+
className={cl("navds-text-field__label", {
|
|
165
157
|
"navds-sr-only": hideLabel,
|
|
166
158
|
})}
|
|
167
|
-
id={inputDescriptionId}
|
|
168
|
-
size={size}
|
|
169
159
|
>
|
|
170
|
-
{
|
|
171
|
-
</
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
{
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
className
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
"
|
|
192
|
-
|
|
160
|
+
{label}
|
|
161
|
+
</Label>
|
|
162
|
+
{!!description && (
|
|
163
|
+
<BodyShort
|
|
164
|
+
as="div"
|
|
165
|
+
className={cl("navds-text-field__description", {
|
|
166
|
+
"navds-sr-only": hideLabel,
|
|
167
|
+
})}
|
|
168
|
+
id={inputDescriptionId}
|
|
169
|
+
size={size}
|
|
170
|
+
>
|
|
171
|
+
{description}
|
|
172
|
+
</BodyShort>
|
|
173
|
+
)}
|
|
174
|
+
<div className="navds-search__wrapper">
|
|
175
|
+
<div className="navds-search__wrapper-inner">
|
|
176
|
+
{variant === "simple" && (
|
|
177
|
+
<SearchIcon aria-hidden className="navds-search__search-icon" />
|
|
178
|
+
)}
|
|
179
|
+
<input
|
|
180
|
+
ref={mergedRef}
|
|
181
|
+
{...omit(rest, ["size"])}
|
|
182
|
+
{...inputProps}
|
|
183
|
+
value={value ?? internalValue}
|
|
184
|
+
onChange={(e) => handleChange(e.target.value)}
|
|
185
|
+
type="search"
|
|
186
|
+
role="searchbox"
|
|
187
|
+
className={cl(
|
|
188
|
+
className,
|
|
189
|
+
"navds-search__input",
|
|
190
|
+
`navds-search__input--${variant}`,
|
|
191
|
+
"navds-text-field__input",
|
|
192
|
+
"navds-body-short",
|
|
193
|
+
`navds-body-${size}`
|
|
194
|
+
)}
|
|
195
|
+
/>
|
|
196
|
+
{(value ?? internalValue) && clearButton && (
|
|
197
|
+
<button
|
|
198
|
+
type="button"
|
|
199
|
+
onClick={(e) => handleClear({ trigger: "Click", event: e })}
|
|
200
|
+
className="navds-search__button-clear"
|
|
201
|
+
>
|
|
202
|
+
<span className="navds-sr-only">
|
|
203
|
+
{clearButtonLabel ? clearButtonLabel : "Tøm"}
|
|
204
|
+
</span>
|
|
205
|
+
<Close aria-hidden />
|
|
206
|
+
</button>
|
|
193
207
|
)}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
<Close aria-hidden />
|
|
205
|
-
</button>
|
|
206
|
-
)}
|
|
208
|
+
</div>
|
|
209
|
+
<SearchContext.Provider
|
|
210
|
+
value={{
|
|
211
|
+
size,
|
|
212
|
+
disabled: inputProps.disabled,
|
|
213
|
+
variant,
|
|
214
|
+
}}
|
|
215
|
+
>
|
|
216
|
+
{children ? children : variant !== "simple" && <SearchButton />}
|
|
217
|
+
</SearchContext.Provider>
|
|
207
218
|
</div>
|
|
208
|
-
<SearchContext.Provider
|
|
209
|
-
value={{
|
|
210
|
-
size,
|
|
211
|
-
disabled: inputProps.disabled,
|
|
212
|
-
variant,
|
|
213
|
-
}}
|
|
214
|
-
>
|
|
215
|
-
{children ? children : variant !== "simple" && <SearchButton />}
|
|
216
|
-
</SearchContext.Provider>
|
|
217
219
|
</div>
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
) as SearchComponent;
|
|
221
223
|
|
|
222
224
|
Search.Button = SearchButton;
|
|
223
225
|
|
package/src/grid/Cell.tsx
CHANGED
|
@@ -25,7 +25,7 @@ export interface CellProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
25
25
|
lg?: Column;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
const Cell = forwardRef<HTMLDivElement, CellProps>(
|
|
28
|
+
export const Cell = forwardRef<HTMLDivElement, CellProps>(
|
|
29
29
|
({ children, xs, sm, md, lg, className, ...rest }, ref) => {
|
|
30
30
|
return (
|
|
31
31
|
<div
|
|
@@ -8,14 +8,15 @@ export interface ContentContainerProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
8
8
|
children: React.ReactNode;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
const ContentContainer = forwardRef<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
export const ContentContainer = forwardRef<
|
|
12
|
+
HTMLDivElement,
|
|
13
|
+
ContentContainerProps
|
|
14
|
+
>(({ className, ...rest }, ref) => (
|
|
15
|
+
<div
|
|
16
|
+
ref={ref}
|
|
17
|
+
className={cl("navds-content-container", className)}
|
|
18
|
+
{...rest}
|
|
19
|
+
/>
|
|
20
|
+
));
|
|
20
21
|
|
|
21
22
|
export default ContentContainer;
|
package/src/grid/Grid.tsx
CHANGED
|
@@ -7,7 +7,8 @@ export interface GridProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
7
7
|
*/
|
|
8
8
|
children: React.ReactNode;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
export const Grid = forwardRef<HTMLDivElement, GridProps>(
|
|
11
12
|
({ children, className, ...rest }, ref) => (
|
|
12
13
|
<div ref={ref} className={cl("navds-grid", className)} {...rest}>
|
|
13
14
|
{children}
|
package/src/grid/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { default as Cell } from "./Cell";
|
|
2
|
-
export
|
|
3
|
-
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
export { default as Cell, CellProps } from "./Cell";
|
|
2
|
+
export { default as Grid, GridProps } from "./Grid";
|
|
3
|
+
export {
|
|
4
|
+
default as ContentContainer,
|
|
5
|
+
ContentContainerProps,
|
|
6
|
+
} from "./ContentContainer";
|
|
@@ -18,7 +18,7 @@ export interface GuidePanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
18
18
|
poster?: boolean;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
const GuidePanel = forwardRef<HTMLDivElement, GuidePanelProps>(
|
|
21
|
+
export const GuidePanel = forwardRef<HTMLDivElement, GuidePanelProps>(
|
|
22
22
|
(
|
|
23
23
|
{ children, className, illustration, poster = false, color, ...rest },
|
|
24
24
|
ref
|
package/src/guide-panel/index.ts
CHANGED
package/src/help-text/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as HelpText } from "./HelpText";
|
|
2
|
-
export
|
|
2
|
+
export { HelpTextProps } from "./HelpText";
|
package/src/link/Link.tsx
CHANGED
package/src/link/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as Link } from "./Link";
|
|
2
|
-
export
|
|
2
|
+
export { LinkProps } from "./Link";
|
package/src/link-panel/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as LinkPanel } from "./LinkPanel";
|
|
2
|
-
export
|
|
2
|
+
export { LinkPanelProps } from "./LinkPanel";
|
package/src/loader/Loader.tsx
CHANGED
|
@@ -25,7 +25,7 @@ export interface LoaderProps extends SVGProps<SVGSVGElement> {
|
|
|
25
25
|
variant?: "neutral" | "interaction" | "inverted";
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
const Loader = forwardRef<SVGSVGElement, LoaderProps>(
|
|
28
|
+
export const Loader = forwardRef<SVGSVGElement, LoaderProps>(
|
|
29
29
|
(
|
|
30
30
|
{
|
|
31
31
|
children,
|
package/src/loader/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as Loader } from "./Loader";
|
|
2
|
-
export
|
|
2
|
+
export { LoaderProps } from "./Loader";
|
package/src/menu/Menu.tsx
CHANGED
|
@@ -35,7 +35,7 @@ export type MenuCollapseType = React.ForwardRefExoticComponent<
|
|
|
35
35
|
MenuCollapseProps & React.RefAttributes<HTMLDivElement>
|
|
36
36
|
>;
|
|
37
37
|
|
|
38
|
-
const Collapse: MenuCollapseType = forwardRef(
|
|
38
|
+
export const Collapse: MenuCollapseType = forwardRef(
|
|
39
39
|
({ children, defaultOpen = false, title, className, ...rest }, ref) => {
|
|
40
40
|
const [isOpen, setIsOpen] = useState(defaultOpen);
|
|
41
41
|
const context = useContext(NestingContext);
|
package/src/menu/MenuItem.tsx
CHANGED
package/src/modal/Modal.tsx
CHANGED
package/src/modal/index.ts
CHANGED
package/src/page-header/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as PageHeader } from "./PageHeader";
|
|
2
|
-
export
|
|
2
|
+
export { PageHeaderProps } from "./PageHeader";
|
|
@@ -3,7 +3,7 @@ import cl from "classnames";
|
|
|
3
3
|
import { Back, Next } from "@navikt/ds-icons";
|
|
4
4
|
import { BodyShort } from "..";
|
|
5
5
|
|
|
6
|
-
interface PaginationProps extends React.HTMLAttributes<HTMLElement> {
|
|
6
|
+
export interface PaginationProps extends React.HTMLAttributes<HTMLElement> {
|
|
7
7
|
/**
|
|
8
8
|
* Current page
|
|
9
9
|
*/
|
|
@@ -71,7 +71,7 @@ export const getSteps = ({
|
|
|
71
71
|
];
|
|
72
72
|
};
|
|
73
73
|
|
|
74
|
-
const Pagination = forwardRef<HTMLElement, PaginationProps>(
|
|
74
|
+
export const Pagination = forwardRef<HTMLElement, PaginationProps>(
|
|
75
75
|
(
|
|
76
76
|
{
|
|
77
77
|
page,
|
package/src/pagination/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as Pagination } from "./Pagination";
|
|
2
|
-
export
|
|
2
|
+
export { PaginationProps } from "./Pagination";
|
package/src/panel/Panel.tsx
CHANGED
|
@@ -16,7 +16,7 @@ export interface PanelProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
16
16
|
|
|
17
17
|
export type PanelType = OverridableComponent<PanelProps, HTMLElement>;
|
|
18
18
|
|
|
19
|
-
const Panel: PanelType = forwardRef(
|
|
19
|
+
export const Panel: PanelType = forwardRef(
|
|
20
20
|
(
|
|
21
21
|
{ children, className, border = false, as: Component = "div", ...rest },
|
|
22
22
|
ref
|
package/src/panel/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as Panel } from "./Panel";
|
|
2
|
-
export
|
|
2
|
+
export { PanelProps } from "./Panel";
|
package/src/popover/Popover.tsx
CHANGED
package/src/popover/index.ts
CHANGED
package/src/read-more/index.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { default as ReadMore } from "./ReadMore";
|
|
2
|
-
export * from "./ReadMore";
|
|
1
|
+
export { default as ReadMore, ReadMoreProps } from "./ReadMore";
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { default as SpeechBubble } from "./SpeechBubble";
|
|
2
|
-
export * from "./SpeechBubble";
|
|
1
|
+
export { default as SpeechBubble, SpeechBubbleProps } from "./SpeechBubble";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { forwardRef, useContext } from "react";
|
|
2
2
|
import cl from "classnames";
|
|
3
|
-
import { StepContext } from "
|
|
3
|
+
import { StepContext } from "./StepIndicator";
|
|
4
4
|
import { BodyShort, Label, OverridableComponent } from "..";
|
|
5
5
|
|
|
6
6
|
export interface StepIndicatorStepProps
|
|
@@ -22,7 +22,7 @@ export interface StepIndicatorStepProps
|
|
|
22
22
|
export interface StepIndicatorStepType
|
|
23
23
|
extends OverridableComponent<StepIndicatorStepProps, HTMLButtonElement> {}
|
|
24
24
|
|
|
25
|
-
const
|
|
25
|
+
export const StepIndicatorStepComponent: OverridableComponent<
|
|
26
26
|
StepIndicatorStepProps,
|
|
27
27
|
HTMLButtonElement
|
|
28
28
|
> = forwardRef(
|
|
@@ -74,6 +74,6 @@ const StepComponent: OverridableComponent<
|
|
|
74
74
|
}
|
|
75
75
|
);
|
|
76
76
|
|
|
77
|
-
const Step =
|
|
77
|
+
const Step = StepIndicatorStepComponent as StepIndicatorStepType;
|
|
78
78
|
|
|
79
79
|
export default Step;
|
|
@@ -8,7 +8,10 @@ import React, {
|
|
|
8
8
|
useState,
|
|
9
9
|
} from "react";
|
|
10
10
|
import mergeRefs from "react-merge-refs";
|
|
11
|
-
import
|
|
11
|
+
import StepIndicatorStep, {
|
|
12
|
+
StepIndicatorStepProps,
|
|
13
|
+
StepIndicatorStepType,
|
|
14
|
+
} from "./Step";
|
|
12
15
|
|
|
13
16
|
export interface StepIndicatorProps
|
|
14
17
|
extends React.HTMLAttributes<HTMLOListElement> {
|
|
@@ -55,7 +58,7 @@ interface StepContextProps {
|
|
|
55
58
|
|
|
56
59
|
export const StepContext = createContext<StepContextProps | null>(null);
|
|
57
60
|
|
|
58
|
-
const StepIndicator: StepIndicatorComponent = forwardRef<
|
|
61
|
+
export const StepIndicator: StepIndicatorComponent = forwardRef<
|
|
59
62
|
HTMLOListElement,
|
|
60
63
|
StepIndicatorProps
|
|
61
64
|
>(
|
|
@@ -140,6 +143,6 @@ const StepIndicator: StepIndicatorComponent = forwardRef<
|
|
|
140
143
|
}
|
|
141
144
|
) as StepIndicatorComponent;
|
|
142
145
|
|
|
143
|
-
StepIndicator.Step =
|
|
146
|
+
StepIndicator.Step = StepIndicatorStep;
|
|
144
147
|
|
|
145
148
|
export default StepIndicator;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { default as StepIndicator } from "./StepIndicator";
|
|
2
|
-
export * from "./StepIndicator";
|
|
1
|
+
export { default as StepIndicator, StepIndicatorProps } from "./StepIndicator";
|
package/src/stepper/Step.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import cl from "classnames";
|
|
2
2
|
import React, { forwardRef, useContext } from "react";
|
|
3
|
-
import { StepperContext } from "
|
|
3
|
+
import { StepperContext } from "./Stepper";
|
|
4
4
|
import { Label, OverridableComponent } from "..";
|
|
5
5
|
|
|
6
6
|
export interface StepperStepProps
|
|
@@ -18,7 +18,7 @@ export interface StepperStepProps
|
|
|
18
18
|
export interface StepperStepType
|
|
19
19
|
extends OverridableComponent<StepperStepProps, HTMLAnchorElement> {}
|
|
20
20
|
|
|
21
|
-
const StepComponent: OverridableComponent<
|
|
21
|
+
export const StepComponent: OverridableComponent<
|
|
22
22
|
StepperStepProps,
|
|
23
23
|
HTMLAnchorElement
|
|
24
24
|
> = forwardRef(
|
package/src/stepper/Stepper.tsx
CHANGED
|
@@ -36,7 +36,10 @@ interface StepperContextProps {
|
|
|
36
36
|
|
|
37
37
|
export const StepperContext = createContext<StepperContextProps | null>(null);
|
|
38
38
|
|
|
39
|
-
const Stepper: StepperComponent = forwardRef<
|
|
39
|
+
export const Stepper: StepperComponent = forwardRef<
|
|
40
|
+
HTMLOListElement,
|
|
41
|
+
StepperProps
|
|
42
|
+
>(
|
|
40
43
|
(
|
|
41
44
|
{ children, className, activeStep, onStepChange = () => {}, ...rest },
|
|
42
45
|
ref
|