@staffbase/design 18.8.1 → 19.0.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/dist/main.cjs CHANGED
@@ -273,36 +273,17 @@ ActionMenuItemIcon.displayName = "ActionMenuItemIcon";
273
273
  ActionMenuItemLabel.displayName = "ActionMenuItemLabel";
274
274
  //#endregion
275
275
  //#region src/components/button/Button.tsx
276
- var Button = (0, react.forwardRef)(function Button(props, ref) {
277
- const { children, className = "", variant = "primary", icon = null, disabled, iconPosition = "leading", ...rest } = props;
278
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
279
- "data-c13y-component": "button",
280
- className: `ds-button ds-button--${variant} ${className}`,
281
- disabled,
282
- ...rest,
283
- ref,
284
- children: [
285
- iconPosition === "leading" ? icon : null,
286
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
287
- className: (0, clsx.default)("ds-button__content"),
288
- children
289
- }),
290
- iconPosition === "trailing" ? icon : null
291
- ]
292
- });
293
- });
294
- var IconButton = (0, react.forwardRef)(function IconButton(props, ref) {
295
- const { icon, className = "", variant = "primary", ...rest } = props;
276
+ var Button = (0, react.forwardRef)((props, ref) => {
277
+ const { children, className, variant = "solid", color = "primary", iconOnly = false, ...rest } = props;
296
278
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
297
279
  "data-c13y-component": "button",
298
- className: (0, clsx.default)("ds-button", "ds-icon-button", `ds-button--${variant}`, `${className}`),
280
+ className: (0, clsx.default)("ds-button", `ds-button--${variant}`, `ds-button--${color}`, { "ds-button--icon-only": iconOnly }, className),
299
281
  ...rest,
300
282
  ref,
301
- children: icon
283
+ children
302
284
  });
303
285
  });
304
286
  Button.displayName = "Button";
305
- IconButton.displayName = "IconButton";
306
287
  //#endregion
307
288
  //#region src/components/alertDialog/AlertDialog.tsx
308
289
  var Trigger$7 = (props) => {
@@ -326,7 +307,7 @@ var Cancel = (0, react.forwardRef)((props, ref) => {
326
307
  const { children, className, ...rest } = props;
327
308
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react.AlertDialog.Close, { render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
328
309
  "data-c13y-purpose": "close",
329
- variant: "secondary",
310
+ color: "neutral",
330
311
  className: (0, clsx.default)("ds-alert-dialog__cancel", className),
331
312
  ...rest,
332
313
  ref,
@@ -336,7 +317,6 @@ var Cancel = (0, react.forwardRef)((props, ref) => {
336
317
  var Action$1 = (0, react.forwardRef)((props, ref) => {
337
318
  const { children, className, ...rest } = props;
338
319
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
339
- "data-c13y-component": "button",
340
320
  className: (0, clsx.default)("ds-alert-dialog__action", className),
341
321
  ...rest,
342
322
  ref,
@@ -8932,6 +8912,40 @@ var BottomSheet = {
8932
8912
  Header: Header$1
8933
8913
  };
8934
8914
  //#endregion
8915
+ //#region src/components/buttonDeprecated/ButtonDeprecated.tsx
8916
+ /** @deprecated Use Button instead */
8917
+ var ButtonDeprecated = (0, react.forwardRef)(function Button(props, ref) {
8918
+ const { children, className = "", variant = "primary", icon = null, disabled, iconPosition = "leading", ...rest } = props;
8919
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
8920
+ "data-c13y-component": "button",
8921
+ className: `ds-button-deprecated ds-button-deprecated--${variant} ${className}`,
8922
+ disabled,
8923
+ ...rest,
8924
+ ref,
8925
+ children: [
8926
+ iconPosition === "leading" ? icon : null,
8927
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8928
+ className: (0, clsx.default)("ds-button__content"),
8929
+ children
8930
+ }),
8931
+ iconPosition === "trailing" ? icon : null
8932
+ ]
8933
+ });
8934
+ });
8935
+ /** @deprecated Use Button with iconOnly instead */
8936
+ var IconButton = (0, react.forwardRef)(function IconButton(props, ref) {
8937
+ const { icon, className = "", variant = "primary", ...rest } = props;
8938
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
8939
+ "data-c13y-component": "button",
8940
+ className: (0, clsx.default)("ds-button-deprecated", "ds-icon-button", `ds-button-deprecated--${variant}`, `${className}`),
8941
+ ...rest,
8942
+ ref,
8943
+ children: icon
8944
+ });
8945
+ });
8946
+ ButtonDeprecated.displayName = "Button";
8947
+ IconButton.displayName = "IconButton";
8948
+ //#endregion
8935
8949
  //#region src/components/card/Card.tsx
8936
8950
  var Card = (0, react.forwardRef)((props, ref) => {
8937
8951
  const { className, ...rest } = props;
@@ -9354,38 +9368,6 @@ Wrapper.displayName = "FileUpload.Wrapper";
9354
9368
  Preview.displayName = "FileUploadPreview";
9355
9369
  Overlay.displayName = "FileUploadOverlay";
9356
9370
  //#endregion
9357
- //#region src/components/ghostButton/GhostButton.tsx
9358
- var GhostButton = (0, react.forwardRef)(function GhostButton(props, ref) {
9359
- const { children, className = "", variant = "primary", icon = null, disabled, iconPosition = "leading", ...rest } = props;
9360
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
9361
- "data-c13y-component": "ghost-button",
9362
- className: `ds-ghost-button ds-ghost-button--${variant} ${className}`,
9363
- disabled,
9364
- ...rest,
9365
- ref,
9366
- children: [
9367
- iconPosition === "leading" ? icon : null,
9368
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9369
- className: (0, clsx.default)("ds-ghost-button__content"),
9370
- children
9371
- }),
9372
- iconPosition === "trailing" ? icon : null
9373
- ]
9374
- });
9375
- });
9376
- var IconGhostButton = (0, react.forwardRef)(function IconGhostButton(props, ref) {
9377
- const { icon, className = "", variant = "primary", ...rest } = props;
9378
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
9379
- "data-c13y-component": "ghost-button",
9380
- className: (0, clsx.default)("ds-ghost-button", "ds-ghost-icon-button", `ds-ghost-button--${variant}`, `${className}`),
9381
- ...rest,
9382
- ref,
9383
- children: icon
9384
- });
9385
- });
9386
- GhostButton.displayName = "GhostButton";
9387
- IconGhostButton.displayName = "IconGhostButton";
9388
- //#endregion
9389
9371
  //#region src/components/loadingSpinner/LoadingSpinner.tsx
9390
9372
  var getProgressOffset = (circumference, progress) => {
9391
9373
  if (progress) return circumference - circumference * progress / 100;
@@ -9692,15 +9674,16 @@ var Filter = (attr) => {
9692
9674
  })]
9693
9675
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9694
9676
  className: (0, clsx.default)("ds-filter__footer"),
9695
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(GhostButton, {
9677
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
9678
+ variant: "ghost",
9679
+ color: "neutral",
9696
9680
  onClick: () => {
9697
9681
  cancelAll([...localOptions]);
9698
9682
  },
9699
- variant: "secondary",
9700
9683
  disabled: !hasSelected || !!loading,
9701
9684
  children: clearButtonText
9702
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GhostButton, {
9703
- variant: "primary",
9685
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
9686
+ variant: "ghost",
9704
9687
  onClick: handleApply,
9705
9688
  disabled: !dirty || !!loading,
9706
9689
  children: applyButtonText
@@ -9853,6 +9836,40 @@ var FilterTrigger = (0, react.memo)((0, react.forwardRef)(function FilterTrigger
9853
9836
  }));
9854
9837
  Filter.displayName = "Filter";
9855
9838
  //#endregion
9839
+ //#region src/components/ghostButton/GhostButton.tsx
9840
+ /** @deprecated Use Button with variant="ghost" instead */
9841
+ var GhostButton = (0, react.forwardRef)(function GhostButton(props, ref) {
9842
+ const { children, className = "", variant = "primary", icon = null, disabled, iconPosition = "leading", ...rest } = props;
9843
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
9844
+ "data-c13y-component": "ghost-button",
9845
+ className: `ds-ghost-button ds-ghost-button--${variant} ${className}`,
9846
+ disabled,
9847
+ ...rest,
9848
+ ref,
9849
+ children: [
9850
+ iconPosition === "leading" ? icon : null,
9851
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9852
+ className: (0, clsx.default)("ds-ghost-button__content"),
9853
+ children
9854
+ }),
9855
+ iconPosition === "trailing" ? icon : null
9856
+ ]
9857
+ });
9858
+ });
9859
+ /** @deprecated Use Button with variant="ghost" and iconOnly instead */
9860
+ var IconGhostButton = (0, react.forwardRef)(function IconGhostButton(props, ref) {
9861
+ const { icon, className = "", variant = "primary", ...rest } = props;
9862
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
9863
+ "data-c13y-component": "ghost-button",
9864
+ className: (0, clsx.default)("ds-ghost-button", "ds-ghost-icon-button", `ds-ghost-button--${variant}`, `${className}`),
9865
+ ...rest,
9866
+ ref,
9867
+ children: icon
9868
+ });
9869
+ });
9870
+ GhostButton.displayName = "GhostButton";
9871
+ IconGhostButton.displayName = "IconGhostButton";
9872
+ //#endregion
9856
9873
  //#region src/components/growl/Growl.tsx
9857
9874
  var PlainGrowl = (0, react.forwardRef)(function PlainGrowl(props, ref) {
9858
9875
  const { variant = "success", className = "", ...rest } = props;
@@ -10121,7 +10138,7 @@ var ModalHeader = (0, react.forwardRef)(function ModalHeader(props, ref) {
10121
10138
  onClick: () => onHeaderButtonClick(),
10122
10139
  children: headerButtonText
10123
10140
  });
10124
- else headerButton = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
10141
+ else headerButton = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ButtonDeprecated, {
10125
10142
  className: (0, clsx.default)("ds-modal__button--accept"),
10126
10143
  variant: "primary",
10127
10144
  onClick: () => onHeaderButtonClick(),
@@ -10234,12 +10251,12 @@ var ModalFooter = (0, react.forwardRef)(function ModalFooter(props, ref) {
10234
10251
  ref,
10235
10252
  children: [props.children, /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
10236
10253
  className: "ds-modal__footer-buttons",
10237
- children: [cancelButtonText && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
10254
+ children: [cancelButtonText && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ButtonDeprecated, {
10238
10255
  className: (0, clsx.default)("ds-modal__button--cancel"),
10239
10256
  variant: "secondary",
10240
10257
  onClick: () => onCancel(),
10241
10258
  children: cancelButtonText
10242
- }), footerButtonText && onFooterButtonClick && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
10259
+ }), footerButtonText && onFooterButtonClick && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ButtonDeprecated, {
10243
10260
  className: (0, clsx.default)("ds-modal__button--accept"),
10244
10261
  variant: footerButtonVariant,
10245
10262
  disabled: disableFooterButton,
@@ -10345,11 +10362,11 @@ function ModalDialog(props) {
10345
10362
  }),
10346
10363
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
10347
10364
  className: "ds-modal-dialog__content",
10348
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
10365
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ButtonDeprecated, {
10349
10366
  variant: confirmButtonVariant,
10350
10367
  onClick: onConfirm,
10351
10368
  children: confirmButtonText
10352
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
10369
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ButtonDeprecated, {
10353
10370
  variant: "secondary",
10354
10371
  onClick: onCancel,
10355
10372
  children: cancelButtonText
@@ -11758,6 +11775,7 @@ exports.BulbIcon = BulbIcon_default;
11758
11775
  exports.BulletListIcon = BulletListIcon_default;
11759
11776
  exports.BurgerIcon = BurgerIcon_default;
11760
11777
  exports.Button = Button;
11778
+ exports.ButtonDeprecated = ButtonDeprecated;
11761
11779
  exports.CalendarIcon = CalendarIcon_default;
11762
11780
  exports.CameraIcon = CameraIcon_default;
11763
11781
  exports.Card = Card;