@ssa-ui-kit/core 2.2.0 → 2.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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2023 SSA Group
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2023 SSA Group
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,6 +1,6 @@
1
- import { UseDrawerStore } from './useDrawer';
2
- export interface DrawerProps {
3
- children: React.ReactElement;
1
+ import { UseDrawerStore, UseDrawerOptions } from './useDrawer';
2
+ export interface DrawerProps extends UseDrawerOptions {
3
+ children?: React.ReactElement;
4
4
  store?: UseDrawerStore;
5
5
  }
6
- export declare const Drawer: ({ children, store: controlledStore }: DrawerProps) => import("@emotion/react/jsx-runtime").JSX.Element | null;
6
+ export declare const Drawer: ({ children, store: controlledStore, ...drawerProps }: DrawerProps) => import("@emotion/react/jsx-runtime").JSX.Element | null;
@@ -8,9 +8,5 @@ export interface FieldContextValue {
8
8
  }
9
9
  export declare const FieldProvider: ({ children, value, }: {
10
10
  value: FieldContextValue;
11
- children: React.
12
- /**
13
- * If true, ReactElement children will be focused if FieldControl is clicked.
14
- */
15
- ReactNode;
11
+ children: React.ReactNode;
16
12
  }) => import("react").FunctionComponentElement<import("react").ProviderProps<FieldContextValue | null>>, useFieldContext: () => FieldContextValue;
@@ -1,6 +1,7 @@
1
1
  import { type HTMLAttributes } from 'react';
2
2
  import { FieldContextValue } from './FieldProvider';
3
3
  export interface FieldRootProps extends Partial<FieldContextValue>, HTMLAttributes<HTMLDivElement> {
4
+ asChild?: boolean;
4
5
  children: React.ReactNode;
5
6
  }
6
7
  export declare const FieldRoot: ({ children, ...props }: FieldRootProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -9,6 +9,7 @@ export interface FiltersMultiSelectProps extends Pick<FieldProps, 'status' | 'di
9
9
  error?: string;
10
10
  icon?: React.ReactNode;
11
11
  inputProps?: InputProps['inputProps'];
12
+ fieldProps?: FieldProps;
12
13
  label?: string;
13
14
  placeholder?: string;
14
15
  searchable?: boolean;
@@ -21,4 +22,4 @@ export interface FiltersMultiSelectProps extends Pick<FieldProps, 'status' | 'di
21
22
  onChange?: (value: SelectedFilter[]) => void;
22
23
  register?: UseFormReturn['register'];
23
24
  }
24
- export declare const FiltersMultiSelect: ({ children, description, disabled, emptyNode: controlledEmptyNode, error, icon, inputProps, label, placeholder, searchable, selectedFilters: controlledSelectedFilters, status, store: controlledStore, success, badgeClassName, inputClassName, wrapperClassName, onChange, register, }: FiltersMultiSelectProps) => import("@emotion/react/jsx-runtime").JSX.Element;
25
+ export declare const FiltersMultiSelect: ({ children, description, disabled, emptyNode: controlledEmptyNode, error, icon, fieldProps, inputProps, label, placeholder, searchable, selectedFilters: controlledSelectedFilters, status, store: controlledStore, success, badgeClassName, inputClassName, wrapperClassName, onChange, register, }: FiltersMultiSelectProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,4 +1,3 @@
1
- import { NestedTableRowChildren } from './types';
2
1
  export declare const WithNestedTableRow: ({ children, }: {
3
- children: NestedTableRowChildren | NestedTableRowChildren[];
4
- }) => import("@emotion/react/jsx-runtime").JSX.Element[];
2
+ children: React.ReactNode | React.ReactNode[];
3
+ }) => import("@emotion/react/jsx-runtime").JSX.Element[] | null | undefined;
@@ -1,6 +1,3 @@
1
- export type NestedTableRowChildren = React.ReactElement<React.PropsWithChildren<{
2
- isCollapsed?: boolean;
3
- }>>;
4
1
  export type NestedTableRowContextType = {
5
2
  isCollapsed: boolean;
6
3
  isSubHeader: boolean;
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { JSONObject } from '@global-types/json';
2
+ import { JSONObject } from '../../types/json';
3
3
  import { TranslationContextContent } from './types';
4
4
  export declare const TranslationContext: import("react").Context<TranslationContextContent>;
5
5
  export declare const TranslationProvider: ({ children, defaultTranslations, }: {
@@ -1,5 +1,5 @@
1
1
  import { Dispatch, SetStateAction } from 'react';
2
- import { JSONObject } from '@global-types/json';
2
+ import { JSONObject } from '../../types/json';
3
3
  export type TranslationContextContent = {
4
4
  language: string;
5
5
  t: (translationKey: string) => string;
package/dist/index.js CHANGED
@@ -4111,16 +4111,16 @@ function Dropdown_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to s
4111
4111
 
4112
4112
 
4113
4113
 
4114
- /**
4115
- * The structure of the component:
4116
- *
4117
- * Dropdown
4118
- * DropdownToggle
4119
- * DropdownOptions
4120
- * DropdownOption
4121
- *
4122
- * Aria attributes are set according to
4123
- * https://www.w3.org/WAI/ARIA/apg/example-index/combobox/combobox-select-only.html
4114
+ /**
4115
+ * The structure of the component:
4116
+ *
4117
+ * Dropdown
4118
+ * DropdownToggle
4119
+ * DropdownOptions
4120
+ * DropdownOption
4121
+ *
4122
+ * Aria attributes are set according to
4123
+ * https://www.w3.org/WAI/ARIA/apg/example-index/combobox/combobox-select-only.html
4124
4124
  **/
4125
4125
 
4126
4126
  const DropdownBase = /*#__PURE__*/base_default()("div", true ? {
@@ -5229,16 +5229,16 @@ const DropdownPlaceholderLabel = /*#__PURE__*/base_default()("div", true ? {
5229
5229
  styles: "white-space:nowrap;overflow:hidden;text-overflow:ellipsis"
5230
5230
  } : 0);
5231
5231
 
5232
- /**
5233
- * The structure of the component:
5234
- *
5235
- * MultipleDropdown
5236
- * DropdownToggle
5237
- * MultipleDropdownOptions
5238
- * DropdownOption
5239
- *
5240
- * Aria attributes are set according to
5241
- * https://www.w3.org/WAI/ARIA/apg/example-index/combobox/combobox-select-only.html
5232
+ /**
5233
+ * The structure of the component:
5234
+ *
5235
+ * MultipleDropdown
5236
+ * DropdownToggle
5237
+ * MultipleDropdownOptions
5238
+ * DropdownOption
5239
+ *
5240
+ * Aria attributes are set according to
5241
+ * https://www.w3.org/WAI/ARIA/apg/example-index/combobox/combobox-select-only.html
5242
5242
  **/
5243
5243
  function MultipleDropdownInner({
5244
5244
  selectedItems = [],
@@ -5483,8 +5483,8 @@ const NavToggle = ({
5483
5483
 
5484
5484
 
5485
5485
 
5486
- /**
5487
- * UI Component that shows the navigation bar
5486
+ /**
5487
+ * UI Component that shows the navigation bar
5488
5488
  */
5489
5489
  const NavBar = ({
5490
5490
  items
@@ -6734,12 +6734,12 @@ const ProgressVertical = ({
6734
6734
  /* harmony default export */ const ProgressVertical_ProgressVertical = (ProgressVertical);
6735
6735
  ;// ./src/components/ResponsiveImage/ResponsiveImage.tsx
6736
6736
 
6737
- /**
6738
- * A simple wrapper over the `<img />` tag.
6739
- *
6740
- * Don't forget to adjust Device Pixel Ratio in DevTools
6741
- * when testing srcSet, and use Hard Reload to force the
6742
- * browser to load an image of another resolution.
6737
+ /**
6738
+ * A simple wrapper over the `<img />` tag.
6739
+ *
6740
+ * Don't forget to adjust Device Pixel Ratio in DevTools
6741
+ * when testing srcSet, and use Hard Reload to force the
6742
+ * browser to load an image of another resolution.
6743
6743
  * */
6744
6744
  const ResponsiveImage = ({
6745
6745
  src,
@@ -7150,12 +7150,12 @@ const TabBarBase = /*#__PURE__*/base_default()("div", true ? {
7150
7150
  target: "e1hg26v10"
7151
7151
  } : 0)( true ? "" : 0);
7152
7152
 
7153
- /**
7154
- * This component doesn't show contents of the selected tab,
7155
- * however it accepts a required `renderContent()` render
7156
- * prop and stores it into the Context. This lets the parent
7157
- * component to decide where to render the contents of the
7158
- * selected tab.
7153
+ /**
7154
+ * This component doesn't show contents of the selected tab,
7155
+ * however it accepts a required `renderContent()` render
7156
+ * prop and stores it into the Context. This lets the parent
7157
+ * component to decide where to render the contents of the
7158
+ * selected tab.
7159
7159
  * */
7160
7160
  const TabBar = ({
7161
7161
  children
@@ -7472,13 +7472,13 @@ const useTooltipContext = () => {
7472
7472
 
7473
7473
 
7474
7474
 
7475
- /*
7476
- * <Tooltip>
7477
- * <TooltipTrigger>
7478
- * <Button />
7479
- * </TooltipTrigger>
7480
- * <TooltipContent>Tooltip</TooltipContent>
7481
- * </Tooltip>
7475
+ /*
7476
+ * <Tooltip>
7477
+ * <TooltipTrigger>
7478
+ * <Button />
7479
+ * </TooltipTrigger>
7480
+ * <TooltipContent>Tooltip</TooltipContent>
7481
+ * </Tooltip>
7482
7482
  * */
7483
7483
  const Tooltip = ({
7484
7484
  children,
@@ -7952,9 +7952,9 @@ var CardList_ref = true ? {
7952
7952
  name: "1fgo50s",
7953
7953
  styles: "list-style:none;padding:0;li{margin-bottom:15px;}"
7954
7954
  } : 0;
7955
- /**
7956
- *
7957
- * UI Component that renders a list of items with a custom render function
7955
+ /**
7956
+ *
7957
+ * UI Component that renders a list of items with a custom render function
7958
7958
  */
7959
7959
  const CardList = ({
7960
7960
  title,
@@ -8824,8 +8824,8 @@ const SCREEN_SIZES = {
8824
8824
 
8825
8825
 
8826
8826
 
8827
- /**
8828
- * UI Component that shows the collapsible navigation bar
8827
+ /**
8828
+ * UI Component that shows the collapsible navigation bar
8829
8829
  */
8830
8830
 
8831
8831
  const CollapsibleNavBar = ({
@@ -10063,6 +10063,7 @@ const [FieldProvider, useFieldContext] = (0,hooks_namespaceObject.createSafeCont
10063
10063
  ;// ./src/components/Field/FieldRoot.tsx
10064
10064
 
10065
10065
 
10066
+
10066
10067
  const FieldRoot = ({
10067
10068
  children,
10068
10069
  ...props
@@ -10071,10 +10072,13 @@ const FieldRoot = ({
10071
10072
  disabled = false,
10072
10073
  status = 'basic',
10073
10074
  forwardFocus = true,
10075
+ asChild = false,
10074
10076
  ...divProps
10075
10077
  } = props;
10076
- return (0,jsx_runtime_namespaceObject.jsx)("div", {
10077
- ...divProps,
10078
+ const Wrapper = asChild ? external_react_namespaceObject.Fragment : 'div';
10079
+ const wrapperProps = asChild ? {} : divProps;
10080
+ return (0,jsx_runtime_namespaceObject.jsx)(Wrapper, {
10081
+ ...wrapperProps,
10078
10082
  children: (0,jsx_runtime_namespaceObject.jsx)(FieldProvider, {
10079
10083
  value: {
10080
10084
  disabled,
@@ -10540,9 +10544,10 @@ const useDrawer = ({
10540
10544
 
10541
10545
  const Drawer = ({
10542
10546
  children,
10543
- store: controlledStore
10547
+ store: controlledStore,
10548
+ ...drawerProps
10544
10549
  }) => {
10545
- const uncontrolledStore = useDrawer({});
10550
+ const uncontrolledStore = useDrawer(drawerProps);
10546
10551
  const store = controlledStore || uncontrolledStore;
10547
10552
  if (!store.transition.isMounted) {
10548
10553
  return null;
@@ -11898,6 +11903,7 @@ const FiltersMultiSelect = ({
11898
11903
  emptyNode: controlledEmptyNode,
11899
11904
  error,
11900
11905
  icon,
11906
+ fieldProps,
11901
11907
  inputProps,
11902
11908
  label,
11903
11909
  placeholder,
@@ -11934,6 +11940,7 @@ const FiltersMultiSelect = ({
11934
11940
  children: (0,jsx_runtime_namespaceObject.jsxs)(FieldRoot, {
11935
11941
  disabled: disabled,
11936
11942
  status: status,
11943
+ ...fieldProps,
11937
11944
  children: [label && (0,jsx_runtime_namespaceObject.jsx)(FieldLabel, {
11938
11945
  htmlFor: `formElement-search-${id}`,
11939
11946
  children: label
@@ -12404,8 +12411,12 @@ const NestedTableRow = ({
12404
12411
  background: theme.colors.greyLighter60
12405
12412
  } : {};
12406
12413
  const notSubHeaderCSS = !isSubHeader && isCollapsed ? {
12407
- height: 0,
12408
- maxHeight: 0
12414
+ maxHeight: 0,
12415
+ padding: 0,
12416
+ '& td': {
12417
+ maxHeight: 0,
12418
+ padding: 0
12419
+ }
12409
12420
  } : {};
12410
12421
  return (0,jsx_runtime_namespaceObject.jsxs)(TableRow_TableRow, {
12411
12422
  css: /*#__PURE__*/(0,react_namespaceObject.css)({
@@ -13918,29 +13929,29 @@ const BarLineComplexChartView = ({
13918
13929
  debouncedFn();
13919
13930
  };
13920
13931
  const handleHover = () => {
13921
- /**
13922
- * Show tooltip on hover
13923
- * event: Readonly<Plotly.PlotHoverEvent>
13924
- * - event = {}
13925
- * - points:
13926
- * Array<{
13927
- * bbox: { x0: number; x1: number; y0: number; y1: number; };
13928
- * curveNumber: number;
13929
- * data: Plotly.Data;
13930
- * fullData: Plotly.Data;
13931
- * label: number;
13932
- * pointIndex: number;
13933
- * pointNumber: number;
13934
- * value: number;
13935
- * x: number;
13936
- * y: number;
13937
- * xaxis: string;
13938
- * yaxis: string;
13939
- * }>
13940
- * - xaxes: Array<{}>
13941
- * - xvals: Array<number>
13942
- * - yaxes: Array<{}>
13943
- * - yvals: Array<number>
13932
+ /**
13933
+ * Show tooltip on hover
13934
+ * event: Readonly<Plotly.PlotHoverEvent>
13935
+ * - event = {}
13936
+ * - points:
13937
+ * Array<{
13938
+ * bbox: { x0: number; x1: number; y0: number; y1: number; };
13939
+ * curveNumber: number;
13940
+ * data: Plotly.Data;
13941
+ * fullData: Plotly.Data;
13942
+ * label: number;
13943
+ * pointIndex: number;
13944
+ * pointNumber: number;
13945
+ * value: number;
13946
+ * x: number;
13947
+ * y: number;
13948
+ * xaxis: string;
13949
+ * yaxis: string;
13950
+ * }>
13951
+ * - xaxes: Array<{}>
13952
+ * - xvals: Array<number>
13953
+ * - yaxes: Array<{}>
13954
+ * - yvals: Array<number>
13944
13955
  */
13945
13956
  setIsOpen(false);
13946
13957
  };
@@ -15116,14 +15127,14 @@ var Typeahead_ref = true ? {
15116
15127
  name: "1d3w5wq",
15117
15128
  styles: "width:100%"
15118
15129
  } : 0;
15119
- /**
15120
- * The structure of the component:
15121
- * - TypeaheadTrigger
15122
- * - TypeaheadOptions
15123
- * - FormHelperText
15124
- *
15125
- * Aria attributes are set according to
15126
- * https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/
15130
+ /**
15131
+ * The structure of the component:
15132
+ * - TypeaheadTrigger
15133
+ * - TypeaheadOptions
15134
+ * - FormHelperText
15135
+ *
15136
+ * Aria attributes are set according to
15137
+ * https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/
15127
15138
  **/
15128
15139
  const Typeahead = ({
15129
15140
  name = 'typeahead-search',