@dartcom/ui-kit 10.2.11 → 10.2.13

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.
@@ -0,0 +1,4 @@
1
+ export type TestingProps = {
2
+ ['data-testid']?: string;
3
+ };
4
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/__test__/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IACzB,CAAC,aAAa,CAAC,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=button.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.spec.d.ts","sourceRoot":"","sources":["../../../../src/components/buttons/delete/button.spec.tsx"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../../src/components/buttons/delete/delete.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgB/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAW5C,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAmF7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../../src/components/buttons/delete/delete.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgB/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAW5C,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA4F7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -4,5 +4,7 @@ declare const meta: Meta<typeof DeleteButton>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
6
  export declare const Primary: Story;
7
+ export declare const Disabled: Story;
7
8
  export declare const WithNotification: Story;
9
+ export declare const DisabledWithNotification: Story;
8
10
  //# sourceMappingURL=delete.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"delete.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/buttons/delete/delete.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,CAAC;AAEjC,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAG5D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,YAAY,CASnC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAS9B,CAAC"}
1
+ {"version":3,"file":"delete.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/buttons/delete/delete.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,CAAC;AAEjC,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAK5D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,YAAY,CAcnC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAgBrB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAItB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAS9B,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,KAUtC,CAAC"}
@@ -1,5 +1,7 @@
1
- export type DeleteButtonProps = {
1
+ import { TestingProps } from '../../../__test__/types';
2
+ export type DeleteButtonProps = TestingProps & {
2
3
  onDelete: () => void;
4
+ disabled?: boolean;
3
5
  notification?: {
4
6
  title: string;
5
7
  description: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/buttons/delete/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,MAAM,IAAI,CAAC;IAErB,YAAY,CAAC,EAAE;QACb,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/buttons/delete/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG;IAC7C,QAAQ,EAAE,MAAM,IAAI,CAAC;IAErB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,YAAY,CAAC,EAAE;QACb,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH,CAAC"}
package/dist/index.cjs CHANGED
@@ -14803,7 +14803,7 @@ const IconButton = ({ title, iconProps, ...props }) => {
14803
14803
  const Transition = React__namespace.forwardRef(function Transition(props, ref) {
14804
14804
  return jsxRuntime.jsx(material.Slide, { direction: "up", ref: ref, ...props });
14805
14805
  });
14806
- const DeleteButton = ({ notification, onDelete, }) => {
14806
+ const DeleteButton = ({ notification, onDelete, disabled = false, ...props }) => {
14807
14807
  const id = React__namespace.useId();
14808
14808
  const [openNotification, setOpenNotification] = React__namespace.useState(false);
14809
14809
  const handleOpenNotification = () => {
@@ -14812,13 +14812,13 @@ const DeleteButton = ({ notification, onDelete, }) => {
14812
14812
  const handleCloseNotification = () => {
14813
14813
  setOpenNotification(false);
14814
14814
  };
14815
- return (jsxRuntime.jsxs(React__namespace.Fragment, { children: [notification ? (jsxRuntime.jsx(material.Tooltip, { title: notification.title, children: jsxRuntime.jsx(IconButton, { iconProps: {
14816
- name: 'delete',
14817
- color: 'error',
14818
- }, onClick: handleOpenNotification }) })) : (jsxRuntime.jsx(IconButton, { iconProps: {
14819
- name: 'delete',
14820
- color: 'error',
14821
- }, onClick: onDelete })), notification ? (jsxRuntime.jsxs(material.Dialog, { slots: {
14815
+ const iconProps = React__namespace.useMemo(() => {
14816
+ return {
14817
+ name: 'delete',
14818
+ color: disabled ? 'disabled' : 'error',
14819
+ };
14820
+ }, [disabled]);
14821
+ return (jsxRuntime.jsxs(React__namespace.Fragment, { children: [notification ? (jsxRuntime.jsx(material.Tooltip, { title: notification.title, children: jsxRuntime.jsx(IconButton, { ...props, iconProps: iconProps, onClick: handleOpenNotification, disabled: disabled }) })) : (jsxRuntime.jsx(IconButton, { ...props, iconProps: iconProps, onClick: onDelete, disabled: disabled })), notification ? (jsxRuntime.jsxs(material.Dialog, { slots: {
14822
14822
  transition: Transition,
14823
14823
  }, open: openNotification, onClose: handleCloseNotification, children: [jsxRuntime.jsx(material.DialogTitle, { id: `${id}-dialog-title`, children: notification.title }), jsxRuntime.jsx(material.DialogContent, { children: jsxRuntime.jsx(material.DialogContentText, { id: `${id}-dialog-text`, children: notification.description }) }), jsxRuntime.jsxs(material.DialogActions, { children: [jsxRuntime.jsx(material.Button, { variant: "contained", color: "error", sx: {
14824
14824
  textTransform: 'none',