@payfit/unity-components 1.0.0 → 1.1.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/esm/components/action-bar/ActionBar.d.ts +153 -0
- package/dist/esm/components/action-bar/ActionBar.js +173 -0
- package/dist/esm/components/action-bar/parts/ActionBarAction.d.ts +44 -0
- package/dist/esm/components/action-bar/parts/ActionBarAction.js +45 -0
- package/dist/esm/components/action-bar/parts/ActionBarRoot.d.ts +44 -0
- package/dist/esm/components/action-bar/parts/ActionBarRoot.js +46 -0
- package/dist/esm/components/actionable/Actionable.js +20 -21
- package/dist/esm/components/alert/Alert.d.ts +1 -1
- package/dist/esm/components/alert/Alert.js +1 -1
- package/dist/esm/components/alert/parts/AlertActions.d.ts +1 -1
- package/dist/esm/components/alert/parts/AlertActions.js +1 -1
- package/dist/esm/components/alert/parts/AlertContent.d.ts +1 -1
- package/dist/esm/components/alert/parts/AlertTitle.d.ts +1 -1
- package/dist/esm/components/anchor/Anchor.js +1 -1
- package/dist/esm/components/app-layout/AppLayout.js +6 -6
- package/dist/esm/components/app-menu/parts/AppMenuFooter.js +30 -30
- package/dist/esm/components/app-menu/parts/AppMenuNavContent.js +1 -1
- package/dist/esm/components/autocomplete/Autocomplete.d.ts +1 -1
- package/dist/esm/components/autocomplete/Autocomplete.js +14 -14
- package/dist/esm/components/autocomplete/parts/AutocompleteClearButton.js +5 -5
- package/dist/esm/components/autocomplete/parts/AutocompleteItem.d.ts +1 -1
- package/dist/esm/components/autocomplete/parts/AutocompleteItem.js +4 -4
- package/dist/esm/components/autocomplete/parts/AutocompleteItemGroup.d.ts +1 -1
- package/dist/esm/components/autocomplete/parts/AutocompleteItemGroup.js +12 -12
- package/dist/esm/components/autocomplete/parts/AutocompletePanel.d.ts +1 -1
- package/dist/esm/components/autocomplete/parts/AutocompletePanel.js +7 -7
- package/dist/esm/components/avatar/Avatar.d.ts +1 -1
- package/dist/esm/components/avatar/Avatar.js +15 -16
- package/dist/esm/components/avatar/Avatar.variants.js +1 -1
- package/dist/esm/components/avatar/parts/AvatarFallback.d.ts +1 -1
- package/dist/esm/components/avatar/parts/AvatarFallback.js +9 -10
- package/dist/esm/components/avatar/parts/AvatarImage.js +12 -12
- package/dist/esm/components/avatar/parts/AvatarPair.d.ts +1 -1
- package/dist/esm/components/avatar/parts/AvatarPair.js +4 -4
- package/dist/esm/components/badge/Badge.d.ts +1 -1
- package/dist/esm/components/badge/Badge.js +31 -35
- package/dist/esm/components/bottom-sheet/BottomSheet.d.ts +1 -1
- package/dist/esm/components/bottom-sheet/BottomSheet.js +14 -14
- package/dist/esm/components/bottom-sheet/parts/BottomSheetContent.d.ts +1 -1
- package/dist/esm/components/bottom-sheet/parts/BottomSheetContent.js +4 -4
- package/dist/esm/components/bottom-sheet/parts/BottomSheetDragIndicator.js +11 -11
- package/dist/esm/components/bottom-sheet/parts/BottomSheetFooter.d.ts +1 -1
- package/dist/esm/components/bottom-sheet/parts/BottomSheetFooter.js +4 -4
- package/dist/esm/components/bottom-sheet/parts/BottomSheetHeader.d.ts +4 -4
- package/dist/esm/components/bottom-sheet/parts/BottomSheetHeader.js +6 -6
- package/dist/esm/components/breadcrumbs/Breadcrumbs.context.d.ts +1 -1
- package/dist/esm/components/breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/esm/components/breadcrumbs/Breadcrumbs.variant.js +3 -3
- package/dist/esm/components/button/Button.js +33 -41
- package/dist/esm/components/button/Button.variants.d.ts +1 -1
- package/dist/esm/components/button/Button.variants.js +1 -1
- package/dist/esm/components/checkbox/Checkbox.js +53 -49
- package/dist/esm/components/checkbox/Checkbox.variants.js +1 -1
- package/dist/esm/components/checkbox/parts/CheckboxIndicator.js +1 -1
- package/dist/esm/components/checkbox-field/CheckboxField.js +39 -34
- package/dist/esm/components/checkbox-group/CheckboxGroup.d.ts +1 -1
- package/dist/esm/components/checkbox-group/CheckboxGroup.js +12 -12
- package/dist/esm/components/collapsible/Collapsible.js +22 -16
- package/dist/esm/components/collapsible/parts/CollapsibleContent.js +16 -7
- package/dist/esm/components/collapsible/parts/CollapsibleTitle.js +23 -23
- package/dist/esm/components/data-table/DataTable.d.ts +48 -17
- package/dist/esm/components/data-table/DataTable.js +104 -60
- package/dist/esm/components/data-table/mocks/employee-columns.d.ts +4 -0
- package/dist/esm/components/data-table/parts/DataTableBulkActions.d.ts +55 -0
- package/dist/esm/components/data-table/parts/DataTableBulkActions.js +65 -0
- package/dist/esm/components/data-table/parts/DataTableRoot.d.ts +37 -0
- package/dist/esm/components/data-table/parts/DataTableRoot.js +13 -0
- package/dist/esm/components/date-calendar/DateCalendar.js +8 -8
- package/dist/esm/components/date-picker/DatePicker.js +9 -9
- package/dist/esm/components/date-picker/parts/DateInput.js +7 -7
- package/dist/esm/components/date-picker-field/DatePickerField.js +12 -12
- package/dist/esm/components/definition-tooltip/DefinitionTooltip.js +4 -4
- package/dist/esm/components/dialog/Dialog.d.ts +1 -1
- package/dist/esm/components/dialog/Dialog.js +9 -9
- package/dist/esm/components/dialog/parts/DialogActions/DialogButton.d.ts +1 -1
- package/dist/esm/components/fieldset/Fieldset.d.ts +1 -1
- package/dist/esm/components/fieldset/Fieldset.js +4 -4
- package/dist/esm/components/flex/Flex.d.ts +1 -1
- package/dist/esm/components/flex/Flex.variants.js +189 -207
- package/dist/esm/components/flex/FlexItem.d.ts +1 -1
- package/dist/esm/components/form/Form.context.d.ts +1 -4
- package/dist/esm/components/form/Form.context.js +11 -13
- package/dist/esm/components/form/Form.d.ts +13 -11
- package/dist/esm/components/form/Form.js +45 -48
- package/dist/esm/components/form-field/FormField.context.d.ts +1 -6
- package/dist/esm/components/form-field/FormField.context.js +39 -47
- package/dist/esm/components/form-field/FormField.d.ts +0 -2
- package/dist/esm/components/form-field/FormField.js +37 -42
- package/dist/esm/components/form-field/parts/FormContextualLink.js +17 -17
- package/dist/esm/components/form-field/parts/FormControl.js +39 -35
- package/dist/esm/components/form-field/parts/FormFeedbackText.js +15 -17
- package/dist/esm/components/full-page-loader/FullPageLoader.js +7 -7
- package/dist/esm/components/funnel-layout/FunnelLayout.d.ts +2 -2
- package/dist/esm/components/funnel-layout/FunnelLayout.js +26 -26
- package/dist/esm/components/funnel-layout/parts/FunnelBody.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelBody.js +4 -4
- package/dist/esm/components/funnel-layout/parts/FunnelPage.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelPage.js +10 -10
- package/dist/esm/components/funnel-layout/parts/FunnelPageAction.d.ts +1 -1
- package/dist/esm/components/funnel-layout/parts/FunnelPageActions.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelPageActions.js +13 -13
- package/dist/esm/components/funnel-layout/parts/FunnelPageContent.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelPageContent.js +1 -1
- package/dist/esm/components/funnel-layout/parts/FunnelPageFooter.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelPageFooter.js +7 -7
- package/dist/esm/components/funnel-layout/parts/FunnelPageHeader.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelPageHeader.js +4 -4
- package/dist/esm/components/funnel-layout/parts/FunnelProgressBar.d.ts +1 -1
- package/dist/esm/components/funnel-layout/parts/FunnelProgressBar.js +4 -4
- package/dist/esm/components/funnel-layout/parts/FunnelSidebar.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelSidebar.js +7 -7
- package/dist/esm/components/funnel-layout/parts/FunnelTopBar.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelTopBar.js +9 -9
- package/dist/esm/components/grid/Grid.d.ts +1 -1
- package/dist/esm/components/grid/Grid.variants.d.ts +1 -1
- package/dist/esm/components/grid/Grid.variants.js +3 -3
- package/dist/esm/components/grid/GridItem.d.ts +1 -1
- package/dist/esm/components/icon/Icon.d.ts +1 -1
- package/dist/esm/components/icon/Icon.js +1 -1
- package/dist/esm/components/icon-button/CircularIconButton.d.ts +1 -1
- package/dist/esm/components/icon-button/CircularIconButton.js +21 -20
- package/dist/esm/components/icon-button/IconButton.variants.d.ts +1 -1
- package/dist/esm/components/icon-button/IconButton.variants.js +2 -2
- package/dist/esm/components/input/Input.js +6 -6
- package/dist/esm/components/label/Label.js +13 -13
- package/dist/esm/components/link/Link.d.ts +11 -1
- package/dist/esm/components/link/Link.js +32 -30
- package/dist/esm/components/link/Link.variants.d.ts +141 -30
- package/dist/esm/components/link/Link.variants.js +44 -16
- package/dist/esm/components/menu/parts/MenuItem.js +8 -8
- package/dist/esm/components/multi-select/parts/MultiSelectButton.js +14 -14
- package/dist/esm/components/multi-select/parts/MultiSelectOptGroup.js +5 -5
- package/dist/esm/components/multi-select/parts/MultiSelectOption.js +3 -3
- package/dist/esm/components/multi-select/parts/MultiSelectPopover.js +1 -1
- package/dist/esm/components/multi-select-field/MultiSelectField.js +6 -6
- package/dist/esm/components/nav/parts/NavGroup.js +28 -29
- package/dist/esm/components/nav/parts/NavItem.d.ts +1 -1
- package/dist/esm/components/nav/parts/NavItem.js +13 -14
- package/dist/esm/components/number-field/NumberField.js +14 -14
- package/dist/esm/components/number-input/NumberInput.d.ts +2 -2
- package/dist/esm/components/number-input/NumberInput.js +37 -37
- package/dist/esm/components/page/Page.d.ts +1 -1
- package/dist/esm/components/page/Page.js +5 -5
- package/dist/esm/components/page/parts/PageHeader.d.ts +1 -1
- package/dist/esm/components/page/parts/PageHeader.js +4 -4
- package/dist/esm/components/pagination/Pagination.d.ts +1 -1
- package/dist/esm/components/pagination/Pagination.js +16 -16
- package/dist/esm/components/pagination/parts/PaginationEllipsis.d.ts +1 -1
- package/dist/esm/components/pagination/parts/PaginationEllipsis.js +8 -8
- package/dist/esm/components/pagination/parts/PaginationJumpDialog.js +9 -9
- package/dist/esm/components/pagination/parts/PaginationLink.d.ts +1 -1
- package/dist/esm/components/pagination/parts/PaginationLink.js +6 -6
- package/dist/esm/components/payfit-brand/PayFitBrand.js +4 -4
- package/dist/esm/components/pill/Pill.d.ts +1 -1
- package/dist/esm/components/pill/Pill.js +1 -1
- package/dist/esm/components/popover/Popover.js +5 -5
- package/dist/esm/components/popover/parts/PopoverHeader.js +7 -7
- package/dist/esm/components/progress-bar/ProgressBar.js +11 -11
- package/dist/esm/components/radio-button-group/parts/RadioButton.d.ts +1 -1
- package/dist/esm/components/radio-button-group/parts/RadioButton.js +5 -5
- package/dist/esm/components/search/Search.d.ts +1 -1
- package/dist/esm/components/search/Search.js +14 -14
- package/dist/esm/components/segmented-button-group/parts/ToggleButton.js +10 -10
- package/dist/esm/components/select/Select.js +12 -12
- package/dist/esm/components/select/parts/SearchInput.js +7 -7
- package/dist/esm/components/select/parts/SelectButton.js +17 -14
- package/dist/esm/components/select/parts/SelectOption.js +4 -4
- package/dist/esm/components/select/parts/SelectOptionGroup.js +8 -8
- package/dist/esm/components/select/parts/SelectOptionHelper.js +1 -1
- package/dist/esm/components/select-field/SelectField.d.ts +1 -1
- package/dist/esm/components/select-field/SelectField.js +16 -16
- package/dist/esm/components/selectable-button-group/SelectableButtonGroup.d.ts +1 -1
- package/dist/esm/components/selectable-button-group/SelectableButtonGroup.js +8 -8
- package/dist/esm/components/selectable-button-group/parts/SelectableButton.js +10 -10
- package/dist/esm/components/selectable-card/internals/Content.js +5 -5
- package/dist/esm/components/selectable-card/internals/Description.js +1 -1
- package/dist/esm/components/selectable-card/internals/Illustration.js +3 -3
- package/dist/esm/components/selectable-card/internals/SelectedIndicator.js +4 -4
- package/dist/esm/components/selectable-card/selectable-card-checkbox-group/parts/SelectableCardCheckbox.d.ts +1 -1
- package/dist/esm/components/selectable-card/selectable-card-radio-group/parts/RadioIndicator.js +3 -3
- package/dist/esm/components/selectable-card/selectable-card-radio-group/parts/SelectableCardRadio.d.ts +1 -1
- package/dist/esm/components/selectable-card/selectableCard.variant.js +1 -1
- package/dist/esm/components/selectable-card-radio-group-field/SelectableCardRadioGroupField.js +22 -22
- package/dist/esm/components/side-panel/SidePanel.d.ts +1 -1
- package/dist/esm/components/side-panel/SidePanel.js +6 -6
- package/dist/esm/components/side-panel/parts/SidePanelContent.d.ts +1 -1
- package/dist/esm/components/side-panel/parts/SidePanelContent.js +9 -9
- package/dist/esm/components/side-panel/parts/SidePanelDragIndicator.js +11 -11
- package/dist/esm/components/side-panel/parts/SidePanelFooter.d.ts +1 -1
- package/dist/esm/components/side-panel/parts/SidePanelFooter.js +4 -4
- package/dist/esm/components/side-panel/parts/SidePanelHeader.d.ts +4 -4
- package/dist/esm/components/side-panel/parts/SidePanelHeader.js +6 -6
- package/dist/esm/components/skip-links/SkipLinks.d.ts +79 -0
- package/dist/esm/components/skip-links/SkipLinks.js +80 -0
- package/dist/esm/components/spinner/Spinner.js +5 -5
- package/dist/esm/components/table/Table.js +101 -100
- package/dist/esm/components/table/hooks/useTableKeyboardNavigation.d.ts +1 -19
- package/dist/esm/components/table/hooks/useTableKeyboardNavigation.js +147 -95
- package/dist/esm/components/table/parts/TableBody.js +1 -1
- package/dist/esm/components/table/parts/TableCell.d.ts +17 -1
- package/dist/esm/components/table/parts/TableCell.js +45 -41
- package/dist/esm/components/table/parts/TableColumnHeader.d.ts +2 -1
- package/dist/esm/components/table/parts/TableColumnHeader.js +63 -57
- package/dist/esm/components/table/parts/TableEmptyState.d.ts +1 -1
- package/dist/esm/components/table/parts/TableEmptyState.js +1 -1
- package/dist/esm/components/table/parts/TableHeader.d.ts +3 -3
- package/dist/esm/components/table/parts/TableHeader.js +28 -26
- package/dist/esm/components/table/parts/TablePagination.d.ts +1 -1
- package/dist/esm/components/table/parts/TablePagination.js +9 -9
- package/dist/esm/components/table/parts/TableRow.d.ts +1 -1
- package/dist/esm/components/table/parts/TableRow.js +36 -34
- package/dist/esm/components/tabs/Tabs.context.d.ts +1 -1
- package/dist/esm/components/tabs/Tabs.d.ts +1 -1
- package/dist/esm/components/tabs/Tabs.variant.js +1 -1
- package/dist/esm/components/tabs/parts/NavigationButton.js +12 -12
- package/dist/esm/components/tabs/parts/Tab.d.ts +3 -2
- package/dist/esm/components/tabs/parts/Tab.js +12 -12
- package/dist/esm/components/tabs/parts/TabPanel.d.ts +4 -2
- package/dist/esm/components/tabs/parts/TabPanel.js +7 -7
- package/dist/esm/components/task-menu/TaskMenu.d.ts +1 -1
- package/dist/esm/components/task-menu/TaskMenu.js +7 -7
- package/dist/esm/components/task-menu/parts/Content.js +6 -6
- package/dist/esm/components/task-menu/parts/Header.js +7 -7
- package/dist/esm/components/task-menu/parts/SubTask.js +6 -6
- package/dist/esm/components/task-menu/parts/Task.d.ts +1 -1
- package/dist/esm/components/task-menu/parts/Task.js +12 -12
- package/dist/esm/components/task-menu/parts/TaskGroup.js +7 -7
- package/dist/esm/components/task-menu/parts/task.variants.js +1 -1
- package/dist/esm/components/text/Text.d.ts +1 -1
- package/dist/esm/components/text/Text.variants.js +1 -1
- package/dist/esm/components/text-area/TextArea.js +6 -6
- package/dist/esm/components/text-field/TextField.js +5 -5
- package/dist/esm/components/toast/UnityToast.d.ts +1 -1
- package/dist/esm/components/toast/UnityToast.js +11 -11
- package/dist/esm/components/toggle-switch/ToggleSwitch.d.ts +1 -1
- package/dist/esm/components/toggle-switch/ToggleSwitch.js +4 -4
- package/dist/esm/components/toggle-switch-field/ToggleSwitchField.js +35 -31
- package/dist/esm/components/toggle-switch-group/ToggleSwitchGroup.d.ts +1 -1
- package/dist/esm/components/toggle-switch-group/ToggleSwitchGroup.js +5 -5
- package/dist/esm/components/toggle-switch-group-field/ToggleSwitchGroupField.js +43 -38
- package/dist/esm/components/tooltip/Tooltip.d.ts +2 -0
- package/dist/esm/components/tooltip/Tooltip.js +27 -19
- package/dist/esm/hooks/use-form.js +7 -7
- package/dist/esm/index.d.ts +6 -1
- package/dist/esm/index.js +366 -352
- package/dist/esm/integrations/react-router/v5/UnityReactRouterV5Provider.js +28 -0
- package/dist/esm/integrations/react-router/v5/index.d.ts +1 -0
- package/dist/esm/integrations/react-router/v5.js +4 -0
- package/i18n/en-GB.json +6 -0
- package/i18n/es-ES.json +6 -0
- package/i18n/fr-FR.json +6 -0
- package/package.json +38 -35
- package/dist/esm/providers/router/integrations/UnityReactRouterV5Provider.js +0 -28
- /package/dist/esm/{providers/router/integrations → integrations/react-router/v5}/UnityReactRouterV5Provider.d.ts +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as v } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { uyTv as w } from "@payfit/unity-themes";
|
|
4
|
+
import { TextArea as M } from "react-aria-components";
|
|
5
|
+
import { useIntl as z } from "react-intl";
|
|
6
6
|
import { useResizable as L } from "../../hooks/use-resizable.js";
|
|
7
7
|
import { Icon as D } from "../icon/Icon.js";
|
|
8
8
|
import { Spinner as N } from "../spinner/Spinner.js";
|
|
9
|
-
const W =
|
|
9
|
+
const W = w({
|
|
10
10
|
slots: {
|
|
11
11
|
base: "uy:flex uy:border uy:border-solid uy:rounded-100 uy:focus-within:outline-none uy:focus-within:ring-2 uy:focus-within:ring-utility-focus-ring uy:focus-within:ring-offset-2 uy:active:border-border-form-active uy:overflow-hidden uy:relative",
|
|
12
12
|
inputWrapper: "uy:flex uy:gap-50 uy:flex-grow uy:pt-100 uy:pb-100 uy:pl-150 uy:pr-150 uy:rounded-100",
|
|
@@ -65,7 +65,7 @@ const W = z({
|
|
|
65
65
|
isResizable: i = !1,
|
|
66
66
|
...y
|
|
67
67
|
}, b) => {
|
|
68
|
-
const o =
|
|
68
|
+
const o = z(), { containerRef: l, handleResizeStart: m } = L({
|
|
69
69
|
isDisabled: !i || a || r
|
|
70
70
|
}), { base: c, inputWrapper: p, input: g, state: x, resizeHandle: h } = W({
|
|
71
71
|
isInvalid: n,
|
|
@@ -75,7 +75,7 @@ const W = z({
|
|
|
75
75
|
return /* @__PURE__ */ t("div", { ref: l, className: c(), children: [
|
|
76
76
|
/* @__PURE__ */ t("div", { className: p(), children: [
|
|
77
77
|
/* @__PURE__ */ e(
|
|
78
|
-
|
|
78
|
+
M,
|
|
79
79
|
{
|
|
80
80
|
"data-dd-privacy": "mask",
|
|
81
81
|
...y,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as B, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as I } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { uyTv as g } from "@payfit/unity-themes";
|
|
4
|
+
import { useFormContext as j } from "react-hook-form";
|
|
5
5
|
import { FormField as k } from "../form-field/FormField.js";
|
|
6
6
|
import { FormControl as L } from "../form-field/parts/FormControl.js";
|
|
7
7
|
import { FormFeedbackText as N } from "../form-field/parts/FormFeedbackText.js";
|
|
@@ -9,7 +9,7 @@ import { FormHelperText as P } from "../form-field/parts/FormHelperText.js";
|
|
|
9
9
|
import { FormLabel as v } from "../form-field/parts/FormLabel.js";
|
|
10
10
|
import { Input as w } from "../input/Input.js";
|
|
11
11
|
import { TextArea as A } from "../text-area/TextArea.js";
|
|
12
|
-
const H =
|
|
12
|
+
const H = g({
|
|
13
13
|
base: "uy:flex uy:flex-col uy:gap-100"
|
|
14
14
|
});
|
|
15
15
|
function R({
|
|
@@ -28,13 +28,13 @@ function R({
|
|
|
28
28
|
requiredVariant: x,
|
|
29
29
|
...n
|
|
30
30
|
}, s) {
|
|
31
|
-
const { control: F, setValue: C } =
|
|
31
|
+
const { control: F, setValue: C } = j(), T = {
|
|
32
32
|
isRequired: p,
|
|
33
33
|
isInvalid: a,
|
|
34
34
|
isLoading: f,
|
|
35
35
|
isDisabled: d,
|
|
36
36
|
isReadOnly: u
|
|
37
|
-
},
|
|
37
|
+
}, y = !i, { onClearButtonPress: h } = y ? n : {}, b = h ?? (() => {
|
|
38
38
|
C(t, "");
|
|
39
39
|
});
|
|
40
40
|
return /* @__PURE__ */ B(
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as o, jsxs as n } from "react/jsx-runtime";
|
|
2
|
-
import { isValidElement as l, Fragment as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { isValidElement as l, Fragment as d, Children as m } from "react";
|
|
3
|
+
import { uyTv as p } from "@payfit/unity-themes";
|
|
4
|
+
import { useIntl as f } from "react-intl";
|
|
5
5
|
import { IconButton as b } from "../icon-button/IconButton.js";
|
|
6
6
|
import { Icon as g } from "../icon/Icon.js";
|
|
7
7
|
import { ToastTitle as x } from "./parts/ToastTitle.js";
|
|
8
|
-
import { ToastProvider as
|
|
9
|
-
const
|
|
8
|
+
import { ToastProvider as T } from "./Toast.context.js";
|
|
9
|
+
const h = p({
|
|
10
10
|
slots: {
|
|
11
11
|
base: "uy:sm:w-[416px] uy:border uy:border-solid uy:rounded-150 uy:text-content-neutral uy:bg-surface-neutral uy:shadow-floating uy:p-100 uy:flex uy:gap-125 uy:border-border-neutral-high",
|
|
12
12
|
contentWrapper: "uy:flex uy:grow uy:ml-125",
|
|
@@ -27,8 +27,8 @@ const T = f({
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
}), v = (e) => {
|
|
30
|
-
const s = l(e) && e.type ===
|
|
31
|
-
if (
|
|
30
|
+
const s = l(e) && e.type === d ? e.props.children : e;
|
|
31
|
+
if (m.toArray(s).filter(
|
|
32
32
|
(r) => l(r) && r.type === x
|
|
33
33
|
).length !== 1)
|
|
34
34
|
throw new Error("UnityToast must have one ToastTitle component");
|
|
@@ -39,13 +39,13 @@ const T = f({
|
|
|
39
39
|
inline: r = !0,
|
|
40
40
|
...i
|
|
41
41
|
}) => {
|
|
42
|
-
const a =
|
|
42
|
+
const a = f();
|
|
43
43
|
v(e);
|
|
44
|
-
const { base: u, contentWrapper: c, divider:
|
|
44
|
+
const { base: u, contentWrapper: c, divider: y } = h({
|
|
45
45
|
variant: t,
|
|
46
46
|
isInline: r
|
|
47
47
|
});
|
|
48
|
-
return /* @__PURE__ */ o(
|
|
48
|
+
return /* @__PURE__ */ o(T, { inline: r, children: /* @__PURE__ */ n(
|
|
49
49
|
"div",
|
|
50
50
|
{
|
|
51
51
|
"data-dd-privacy": "mask",
|
|
@@ -71,7 +71,7 @@ const T = f({
|
|
|
71
71
|
),
|
|
72
72
|
/* @__PURE__ */ o("div", { className: c(), children: e })
|
|
73
73
|
] }),
|
|
74
|
-
/* @__PURE__ */ o("div", { role: "presentation", className:
|
|
74
|
+
/* @__PURE__ */ o("div", { role: "presentation", className: y() }),
|
|
75
75
|
/* @__PURE__ */ o(
|
|
76
76
|
b,
|
|
77
77
|
{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { VariantProps } from '@payfit/unity-themes';
|
|
1
2
|
import { SwitchProps as AriaSwitchProps } from 'react-aria-components';
|
|
2
|
-
import { VariantProps } from 'tailwind-variants';
|
|
3
3
|
export declare const toggleSwitch: import('tailwind-variants').TVReturnType<{
|
|
4
4
|
isDisabled: {
|
|
5
5
|
false: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as f } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
const v =
|
|
3
|
+
import { uyTv as g } from "@payfit/unity-themes";
|
|
4
|
+
import { Switch as m } from "react-aria-components";
|
|
5
|
+
const v = g({
|
|
6
6
|
slots: {
|
|
7
7
|
container: ["uy:flex uy:gap-100 uy:group"],
|
|
8
8
|
textWrapper: ["uy:flex uy:flex-col uy:gap-50"],
|
|
@@ -48,7 +48,7 @@ const v = m({
|
|
|
48
48
|
}, s) => {
|
|
49
49
|
const { container: l, indicator: i, knob: y, textWrapper: c, label: p, hintText: b } = v({ isDisabled: a }), n = { ...t, role: "switch" };
|
|
50
50
|
return /* @__PURE__ */ o(
|
|
51
|
-
|
|
51
|
+
m,
|
|
52
52
|
{
|
|
53
53
|
...n,
|
|
54
54
|
ref: s,
|
|
@@ -1,53 +1,57 @@
|
|
|
1
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
1
|
+
import { jsxs as h, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as u } from "react";
|
|
3
|
-
import { useFormContext as
|
|
4
|
-
import { FormField as
|
|
3
|
+
import { useFormContext as a } from "react-hook-form";
|
|
4
|
+
import { FormField as x } from "../form-field/FormField.js";
|
|
5
5
|
import { FormControl as w } from "../form-field/parts/FormControl.js";
|
|
6
|
-
import {
|
|
7
|
-
|
|
6
|
+
import { FormFeedbackText as T } from "../form-field/parts/FormFeedbackText.js";
|
|
7
|
+
import { ToggleSwitch as S } from "../toggle-switch/ToggleSwitch.js";
|
|
8
|
+
function y({
|
|
8
9
|
name: o,
|
|
9
10
|
label: r,
|
|
10
11
|
defaultSelected: e,
|
|
11
12
|
switchHelperText: i,
|
|
12
|
-
isInvalid:
|
|
13
|
-
isLoading:
|
|
13
|
+
isInvalid: m,
|
|
14
|
+
isLoading: l,
|
|
14
15
|
isDisabled: c,
|
|
15
16
|
isReadOnly: n,
|
|
16
17
|
isLabelSrOnly: p,
|
|
17
|
-
...
|
|
18
|
-
},
|
|
19
|
-
const { control:
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
|
|
18
|
+
...s
|
|
19
|
+
}, f) {
|
|
20
|
+
const { control: d, watch: g } = a(), F = g(o);
|
|
21
|
+
return /* @__PURE__ */ h(
|
|
22
|
+
x,
|
|
22
23
|
{
|
|
23
|
-
control:
|
|
24
|
+
control: d,
|
|
24
25
|
name: o,
|
|
25
26
|
className: "uy:flex uy:flex-col uy:gap-100",
|
|
26
27
|
...{
|
|
27
|
-
isInvalid:
|
|
28
|
-
isLoading:
|
|
28
|
+
isInvalid: m,
|
|
29
|
+
isLoading: l,
|
|
29
30
|
isDisabled: c,
|
|
30
31
|
isReadOnly: n
|
|
31
32
|
},
|
|
32
|
-
children:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ t(w, { children: /* @__PURE__ */ t(
|
|
35
|
+
S,
|
|
36
|
+
{
|
|
37
|
+
ref: f,
|
|
38
|
+
defaultSelected: e,
|
|
39
|
+
isSelected: F,
|
|
40
|
+
label: r,
|
|
41
|
+
isLabelSrOnly: p,
|
|
42
|
+
helperText: i,
|
|
43
|
+
...s
|
|
44
|
+
}
|
|
45
|
+
) }),
|
|
46
|
+
/* @__PURE__ */ t(T, {})
|
|
47
|
+
]
|
|
44
48
|
}
|
|
45
49
|
);
|
|
46
50
|
}
|
|
47
|
-
const
|
|
48
|
-
return
|
|
51
|
+
const j = u(function(r, e) {
|
|
52
|
+
return y(r, e);
|
|
49
53
|
});
|
|
50
|
-
|
|
54
|
+
j.displayName = "ToggleSwitchField";
|
|
51
55
|
export {
|
|
52
|
-
|
|
56
|
+
j as ToggleSwitchField
|
|
53
57
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { VariantProps } from '@payfit/unity-themes';
|
|
1
2
|
import { ReactNode } from 'react';
|
|
2
|
-
import { VariantProps } from 'tailwind-variants';
|
|
3
3
|
export declare const toggleSwitchGroup: import('tailwind-variants').TVReturnType<{} | {} | {}, undefined, "uy:flex uy:flex-col uy:gap-50", {} | {}, undefined, import('tailwind-variants').TVReturnType<unknown, undefined, "uy:flex uy:flex-col uy:gap-50", unknown, unknown, undefined>>;
|
|
4
4
|
export interface ToggleSwitchGroupProps extends VariantProps<typeof toggleSwitchGroup> {
|
|
5
5
|
/** The label for the group. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as A, jsx as d } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as B, useState as H, useId as J, useRef as K, useCallback as Q, isValidElement as V, cloneElement as N, Children as U } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { uyTv as W } from "@payfit/unity-themes";
|
|
4
4
|
import { Label as X } from "../label/Label.js";
|
|
5
5
|
import { Text as R } from "../text/Text.js";
|
|
6
6
|
const Y = W({
|
|
@@ -25,17 +25,17 @@ const _ = B(
|
|
|
25
25
|
value: g,
|
|
26
26
|
defaultValue: M,
|
|
27
27
|
onChange: a,
|
|
28
|
-
onFocus:
|
|
29
|
-
onBlur:
|
|
28
|
+
onFocus: u,
|
|
29
|
+
onBlur: p,
|
|
30
30
|
onFocusChange: t,
|
|
31
31
|
...O
|
|
32
32
|
}, $) => {
|
|
33
33
|
const f = g !== void 0, [x, D] = H(
|
|
34
34
|
M ?? []
|
|
35
35
|
), s = f ? g : x, w = J(), j = r ? `${w}-helper` : void 0, y = c && l ? `${w}-feedback` : void 0, L = [j, y].filter(Boolean).join(" ") || void 0, E = K(!1), P = (e) => {
|
|
36
|
-
E.current = !0,
|
|
36
|
+
E.current = !0, u == null || u(e), t == null || t(!0);
|
|
37
37
|
}, k = (e) => {
|
|
38
|
-
E.current = !1,
|
|
38
|
+
E.current = !1, p == null || p(e), t == null || t(!1);
|
|
39
39
|
}, q = Q(
|
|
40
40
|
(e) => {
|
|
41
41
|
let i;
|
|
@@ -1,54 +1,59 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { useFormContext as
|
|
4
|
-
import { FormField as
|
|
5
|
-
import { FormControl as
|
|
6
|
-
import { FormFeedbackText as
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as x, useMemo as G } from "react";
|
|
3
|
+
import { useFormContext as R } from "react-hook-form";
|
|
4
|
+
import { FormField as q } from "../form-field/FormField.js";
|
|
5
|
+
import { FormControl as y } from "../form-field/parts/FormControl.js";
|
|
6
|
+
import { FormFeedbackText as P } from "../form-field/parts/FormFeedbackText.js";
|
|
7
|
+
import { isFieldRequired as j } from "../form-field/utils/isFieldRequired.js";
|
|
8
|
+
import { useUnityFormProvider as v } from "../form/Form.context.js";
|
|
9
|
+
import { ToggleSwitchGroup as C } from "../toggle-switch-group/ToggleSwitchGroup.js";
|
|
10
|
+
function U({
|
|
9
11
|
name: o,
|
|
10
12
|
label: r,
|
|
11
|
-
defaultValue:
|
|
13
|
+
defaultValue: i,
|
|
12
14
|
helperText: m,
|
|
13
|
-
contextualLink:
|
|
14
|
-
isRequired:
|
|
15
|
-
isInvalid:
|
|
16
|
-
isLoading:
|
|
17
|
-
isDisabled:
|
|
18
|
-
isReadOnly:
|
|
19
|
-
requiredVariant:
|
|
20
|
-
children:
|
|
21
|
-
...
|
|
15
|
+
contextualLink: c,
|
|
16
|
+
isRequired: s,
|
|
17
|
+
isInvalid: p,
|
|
18
|
+
isLoading: l,
|
|
19
|
+
isDisabled: n,
|
|
20
|
+
isReadOnly: u,
|
|
21
|
+
requiredVariant: d,
|
|
22
|
+
children: f,
|
|
23
|
+
...F
|
|
22
24
|
}, g) {
|
|
23
|
-
const { control:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
const { control: h, watch: w } = R(), { schema: t } = v(), S = G(
|
|
26
|
+
() => j(t, o),
|
|
27
|
+
[t, o]
|
|
28
|
+
), T = w(o);
|
|
29
|
+
return /* @__PURE__ */ a(q, { control: h, name: o, ...{
|
|
30
|
+
isInvalid: p,
|
|
31
|
+
isLoading: l,
|
|
32
|
+
isDisabled: n,
|
|
33
|
+
isReadOnly: u
|
|
30
34
|
}, children: [
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
|
|
35
|
+
/* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(
|
|
36
|
+
C,
|
|
33
37
|
{
|
|
34
38
|
ref: g,
|
|
35
39
|
label: r,
|
|
36
|
-
defaultValue:
|
|
37
|
-
value:
|
|
40
|
+
defaultValue: i,
|
|
41
|
+
value: T,
|
|
38
42
|
helperText: m,
|
|
39
|
-
requiredVariant:
|
|
40
|
-
...
|
|
41
|
-
|
|
43
|
+
requiredVariant: d,
|
|
44
|
+
...F,
|
|
45
|
+
isRequired: S ?? s,
|
|
46
|
+
children: f
|
|
42
47
|
}
|
|
43
48
|
) }),
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
|
|
49
|
+
/* @__PURE__ */ e(P, {}),
|
|
50
|
+
c
|
|
46
51
|
] });
|
|
47
52
|
}
|
|
48
|
-
const
|
|
49
|
-
return
|
|
53
|
+
const b = x(function(r, i) {
|
|
54
|
+
return U(r, i);
|
|
50
55
|
});
|
|
51
|
-
|
|
56
|
+
b.displayName = "ToggleSwitchGroupField";
|
|
52
57
|
export {
|
|
53
|
-
|
|
58
|
+
b as ToggleSwitchGroupField
|
|
54
59
|
};
|
|
@@ -4,5 +4,7 @@ export interface TooltipProps {
|
|
|
4
4
|
title: string;
|
|
5
5
|
/** The trigger element that displays the tooltip. */
|
|
6
6
|
children: ReactElement;
|
|
7
|
+
/** The duration of delay/close delay for the tooltip. */
|
|
8
|
+
duration?: 'short' | 'standard' | 'long' | 'very-long';
|
|
7
9
|
}
|
|
8
10
|
export declare const Tooltip: import('react').ForwardRefExoticComponent<TooltipProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1,22 +1,30 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { TooltipTrigger as
|
|
4
|
-
import { Button as
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { jsxs as y, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as n } from "react";
|
|
3
|
+
import { TooltipTrigger as p, Tooltip as u, Button as i } from "react-aria-components";
|
|
4
|
+
import { Button as d } from "../button/Button.js";
|
|
5
|
+
const c = (o) => o.type === d || o.type === i, m = {
|
|
6
|
+
short: [100, 150],
|
|
7
|
+
standard: [150, 200],
|
|
8
|
+
long: [200, 300],
|
|
9
|
+
"very-long": [300, 400]
|
|
10
|
+
}, T = n(
|
|
11
|
+
({ title: o, children: t, duration: a = "standard" }, e) => {
|
|
12
|
+
const [l, s] = m[a];
|
|
13
|
+
return /* @__PURE__ */ y(p, { delay: l, closeDelay: s, children: [
|
|
14
|
+
t,
|
|
15
|
+
/* @__PURE__ */ r(
|
|
16
|
+
u,
|
|
17
|
+
{
|
|
18
|
+
ref: e,
|
|
19
|
+
"data-dd-privacy": "allow",
|
|
20
|
+
offset: c(t) ? 6 : 8,
|
|
21
|
+
className: "uy:inline-flex uy:rounded-50 uy:pl-100 uy:pr-100 uy:pt-50 uy:pb-50 uy:bg-grayscale-l12 uy:max-w-[300px]",
|
|
22
|
+
children: /* @__PURE__ */ r("p", { className: "uy:typography-body-small uy:text-content-inverted uy:overflow-hidden uy:text-ellipsis uy:line-clamp-3", children: o })
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
] });
|
|
26
|
+
}
|
|
19
27
|
);
|
|
20
28
|
export {
|
|
21
|
-
|
|
29
|
+
T as Tooltip
|
|
22
30
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as n } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { standardSchemaResolver as l } from "@hookform/resolvers/standard-schema";
|
|
4
4
|
import { useForm as c } from "react-hook-form";
|
|
5
|
-
import { FormField as
|
|
6
|
-
import { Form as
|
|
7
|
-
function
|
|
5
|
+
import { FormField as a } from "../components/form-field/FormField.js";
|
|
6
|
+
import { Form as u } from "../components/form/Form.js";
|
|
7
|
+
function S(m, i = {
|
|
8
8
|
mode: "onTouched",
|
|
9
9
|
reValidateMode: "onChange"
|
|
10
10
|
}) {
|
|
@@ -12,12 +12,12 @@ function v(m, i = {
|
|
|
12
12
|
...i,
|
|
13
13
|
resolver: l(m)
|
|
14
14
|
}), d = n(() => {
|
|
15
|
-
const o = (e) => /* @__PURE__ */ t(
|
|
15
|
+
const o = (e) => /* @__PURE__ */ t(u, { ...e, form: r, schema: m, children: e.children });
|
|
16
16
|
return o.displayName = "FormWithSchema", o;
|
|
17
17
|
}, [r, m]), F = n(() => {
|
|
18
18
|
const o = (e) => (
|
|
19
19
|
// @ts-expect-error: REACT-18-MIGRATION
|
|
20
|
-
/* @__PURE__ */ t(
|
|
20
|
+
/* @__PURE__ */ t(a, { ...e, control: r.control, children: e.children })
|
|
21
21
|
);
|
|
22
22
|
return o.displayName = "FormFieldWithSchema", o;
|
|
23
23
|
}, [r]);
|
|
@@ -28,5 +28,5 @@ function v(m, i = {
|
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
export {
|
|
31
|
-
|
|
31
|
+
S as useUnityForm
|
|
32
32
|
};
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -35,6 +35,8 @@ export * from './components/collapsible/Collapsible.js';
|
|
|
35
35
|
export * from './components/collapsible/parts/CollapsibleContent.js';
|
|
36
36
|
export * from './components/collapsible/parts/CollapsibleTitle.js';
|
|
37
37
|
export * from './components/data-table/DataTable.js';
|
|
38
|
+
export * from './components/data-table/parts/DataTableRoot.js';
|
|
39
|
+
export * from './components/data-table/parts/DataTableBulkActions.js';
|
|
38
40
|
export * from './components/date-calendar/DateCalendar.js';
|
|
39
41
|
export * from './components/date-picker-field/DatePickerField.js';
|
|
40
42
|
export * from './components/date-picker/DatePicker.js';
|
|
@@ -125,6 +127,7 @@ export * from './components/side-panel/SidePanel.js';
|
|
|
125
127
|
export * from './components/side-panel/parts/SidePanelContent.js';
|
|
126
128
|
export * from './components/side-panel/parts/SidePanelFooter.js';
|
|
127
129
|
export * from './components/side-panel/parts/SidePanelHeader.js';
|
|
130
|
+
export * from './components/skip-links/SkipLinks.js';
|
|
128
131
|
export * from './components/spinner/Spinner.js';
|
|
129
132
|
export * from './components/table/Table.js';
|
|
130
133
|
export * from './components/table/parts/TableBody.js';
|
|
@@ -158,4 +161,6 @@ export * from './hooks/use-breakpoint-listener.js';
|
|
|
158
161
|
export * from './hooks/use-form.js';
|
|
159
162
|
export * from './hooks/use-media-query.js';
|
|
160
163
|
export * from './providers/router/RouterProvider.js';
|
|
161
|
-
export * from './
|
|
164
|
+
export * from './components/action-bar/ActionBar.js';
|
|
165
|
+
export * from './components/action-bar/parts/ActionBarAction.js';
|
|
166
|
+
export * from './components/action-bar/parts/ActionBarRoot.js';
|