@helpwave/hightide 0.1.23 → 0.1.25

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.
Files changed (167) hide show
  1. package/dist/components/date/DatePicker.js +48 -53
  2. package/dist/components/date/DatePicker.js.map +1 -1
  3. package/dist/components/date/DatePicker.mjs +58 -63
  4. package/dist/components/date/DatePicker.mjs.map +1 -1
  5. package/dist/components/date/DayPicker.js.map +1 -1
  6. package/dist/components/date/DayPicker.mjs +4 -4
  7. package/dist/components/date/DayPicker.mjs.map +1 -1
  8. package/dist/components/date/TimeDisplay.js.map +1 -1
  9. package/dist/components/date/TimeDisplay.mjs +2 -2
  10. package/dist/components/date/TimeDisplay.mjs.map +1 -1
  11. package/dist/components/date/YearMonthPicker.js +26 -29
  12. package/dist/components/date/YearMonthPicker.js.map +1 -1
  13. package/dist/components/date/YearMonthPicker.mjs +31 -34
  14. package/dist/components/date/YearMonthPicker.mjs.map +1 -1
  15. package/dist/components/dialogs/ConfirmDialog.js +40 -43
  16. package/dist/components/dialogs/ConfirmDialog.js.map +1 -1
  17. package/dist/components/dialogs/ConfirmDialog.mjs +48 -51
  18. package/dist/components/dialogs/ConfirmDialog.mjs.map +1 -1
  19. package/dist/components/layout-and-navigation/Carousel.js +40 -43
  20. package/dist/components/layout-and-navigation/Carousel.js.map +1 -1
  21. package/dist/components/layout-and-navigation/Carousel.mjs +40 -43
  22. package/dist/components/layout-and-navigation/Carousel.mjs.map +1 -1
  23. package/dist/components/layout-and-navigation/Overlay.js +40 -43
  24. package/dist/components/layout-and-navigation/Overlay.js.map +1 -1
  25. package/dist/components/layout-and-navigation/Overlay.mjs +46 -49
  26. package/dist/components/layout-and-navigation/Overlay.mjs.map +1 -1
  27. package/dist/components/layout-and-navigation/Pagination.js +40 -43
  28. package/dist/components/layout-and-navigation/Pagination.js.map +1 -1
  29. package/dist/components/layout-and-navigation/Pagination.mjs +50 -53
  30. package/dist/components/layout-and-navigation/Pagination.mjs.map +1 -1
  31. package/dist/components/layout-and-navigation/SearchableList.js +40 -43
  32. package/dist/components/layout-and-navigation/SearchableList.js.map +1 -1
  33. package/dist/components/layout-and-navigation/SearchableList.mjs +50 -53
  34. package/dist/components/layout-and-navigation/SearchableList.mjs.map +1 -1
  35. package/dist/components/layout-and-navigation/StepperBar.js +26 -29
  36. package/dist/components/layout-and-navigation/StepperBar.js.map +1 -1
  37. package/dist/components/layout-and-navigation/StepperBar.mjs +30 -33
  38. package/dist/components/layout-and-navigation/StepperBar.mjs.map +1 -1
  39. package/dist/components/layout-and-navigation/TextImage.js.map +1 -1
  40. package/dist/components/layout-and-navigation/TextImage.mjs +2 -2
  41. package/dist/components/layout-and-navigation/TextImage.mjs.map +1 -1
  42. package/dist/components/loading-states/ErrorComponent.js.map +1 -1
  43. package/dist/components/loading-states/ErrorComponent.mjs +2 -2
  44. package/dist/components/loading-states/ErrorComponent.mjs.map +1 -1
  45. package/dist/components/loading-states/LoadingAnimation.js.map +1 -1
  46. package/dist/components/loading-states/LoadingAnimation.mjs +2 -2
  47. package/dist/components/loading-states/LoadingAnimation.mjs.map +1 -1
  48. package/dist/components/loading-states/LoadingButton.js +26 -29
  49. package/dist/components/loading-states/LoadingButton.js.map +1 -1
  50. package/dist/components/loading-states/LoadingButton.mjs +26 -29
  51. package/dist/components/loading-states/LoadingButton.mjs.map +1 -1
  52. package/dist/components/modals/ConfirmModal.js +40 -43
  53. package/dist/components/modals/ConfirmModal.js.map +1 -1
  54. package/dist/components/modals/ConfirmModal.mjs +48 -51
  55. package/dist/components/modals/ConfirmModal.mjs.map +1 -1
  56. package/dist/components/modals/DiscardChangesModal.js +40 -43
  57. package/dist/components/modals/DiscardChangesModal.js.map +1 -1
  58. package/dist/components/modals/DiscardChangesModal.mjs +48 -51
  59. package/dist/components/modals/DiscardChangesModal.mjs.map +1 -1
  60. package/dist/components/modals/InputModal.js +40 -43
  61. package/dist/components/modals/InputModal.js.map +1 -1
  62. package/dist/components/modals/InputModal.mjs +48 -51
  63. package/dist/components/modals/InputModal.mjs.map +1 -1
  64. package/dist/components/modals/LanguageModal.js +43 -49
  65. package/dist/components/modals/LanguageModal.js.map +1 -1
  66. package/dist/components/modals/LanguageModal.mjs +67 -73
  67. package/dist/components/modals/LanguageModal.mjs.map +1 -1
  68. package/dist/components/modals/ThemeModal.js +43 -49
  69. package/dist/components/modals/ThemeModal.js.map +1 -1
  70. package/dist/components/modals/ThemeModal.mjs +68 -74
  71. package/dist/components/modals/ThemeModal.mjs.map +1 -1
  72. package/dist/components/properties/CheckboxProperty.js +96 -75
  73. package/dist/components/properties/CheckboxProperty.js.map +1 -1
  74. package/dist/components/properties/CheckboxProperty.mjs +98 -77
  75. package/dist/components/properties/CheckboxProperty.mjs.map +1 -1
  76. package/dist/components/properties/DateProperty.js +48 -53
  77. package/dist/components/properties/DateProperty.js.map +1 -1
  78. package/dist/components/properties/DateProperty.mjs +50 -55
  79. package/dist/components/properties/DateProperty.mjs.map +1 -1
  80. package/dist/components/properties/MultiSelectProperty.js +114 -93
  81. package/dist/components/properties/MultiSelectProperty.js.map +1 -1
  82. package/dist/components/properties/MultiSelectProperty.mjs +135 -114
  83. package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
  84. package/dist/components/properties/NumberProperty.js +48 -53
  85. package/dist/components/properties/NumberProperty.js.map +1 -1
  86. package/dist/components/properties/NumberProperty.mjs +50 -55
  87. package/dist/components/properties/NumberProperty.mjs.map +1 -1
  88. package/dist/components/properties/PropertyBase.js +48 -53
  89. package/dist/components/properties/PropertyBase.js.map +1 -1
  90. package/dist/components/properties/PropertyBase.mjs +50 -55
  91. package/dist/components/properties/PropertyBase.mjs.map +1 -1
  92. package/dist/components/properties/SelectProperty.js +65 -73
  93. package/dist/components/properties/SelectProperty.js.map +1 -1
  94. package/dist/components/properties/SelectProperty.mjs +86 -94
  95. package/dist/components/properties/SelectProperty.mjs.map +1 -1
  96. package/dist/components/properties/TextProperty.js +51 -56
  97. package/dist/components/properties/TextProperty.js.map +1 -1
  98. package/dist/components/properties/TextProperty.mjs +57 -62
  99. package/dist/components/properties/TextProperty.mjs.map +1 -1
  100. package/dist/components/table/Table.js +88 -65
  101. package/dist/components/table/Table.js.map +1 -1
  102. package/dist/components/table/Table.mjs +114 -91
  103. package/dist/components/table/Table.mjs.map +1 -1
  104. package/dist/components/table/TableFilterButton.js +40 -43
  105. package/dist/components/table/TableFilterButton.js.map +1 -1
  106. package/dist/components/table/TableFilterButton.mjs +44 -47
  107. package/dist/components/table/TableFilterButton.mjs.map +1 -1
  108. package/dist/components/table/TableSortButton.js +40 -43
  109. package/dist/components/table/TableSortButton.js.map +1 -1
  110. package/dist/components/table/TableSortButton.mjs +40 -43
  111. package/dist/components/table/TableSortButton.mjs.map +1 -1
  112. package/dist/components/user-action/Button.d.mts +3 -3
  113. package/dist/components/user-action/Button.d.ts +3 -3
  114. package/dist/components/user-action/Button.js +76 -84
  115. package/dist/components/user-action/Button.js.map +1 -1
  116. package/dist/components/user-action/Button.mjs +76 -84
  117. package/dist/components/user-action/Button.mjs.map +1 -1
  118. package/dist/components/user-action/Checkbox.js +48 -22
  119. package/dist/components/user-action/Checkbox.js.map +1 -1
  120. package/dist/components/user-action/Checkbox.mjs +48 -22
  121. package/dist/components/user-action/Checkbox.mjs.map +1 -1
  122. package/dist/components/user-action/CopyToClipboardWrapper.js.map +1 -1
  123. package/dist/components/user-action/CopyToClipboardWrapper.mjs +2 -2
  124. package/dist/components/user-action/CopyToClipboardWrapper.mjs.map +1 -1
  125. package/dist/components/user-action/DateAndTimePicker.js +48 -53
  126. package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
  127. package/dist/components/user-action/DateAndTimePicker.mjs +60 -65
  128. package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
  129. package/dist/components/user-action/MultiSelect.js +92 -69
  130. package/dist/components/user-action/MultiSelect.js.map +1 -1
  131. package/dist/components/user-action/MultiSelect.mjs +114 -91
  132. package/dist/components/user-action/MultiSelect.mjs.map +1 -1
  133. package/dist/components/user-action/SearchBar.js +40 -43
  134. package/dist/components/user-action/SearchBar.js.map +1 -1
  135. package/dist/components/user-action/SearchBar.mjs +42 -45
  136. package/dist/components/user-action/SearchBar.mjs.map +1 -1
  137. package/dist/components/user-action/Select.js +43 -49
  138. package/dist/components/user-action/Select.js.map +1 -1
  139. package/dist/components/user-action/Select.mjs +49 -55
  140. package/dist/components/user-action/Select.mjs.map +1 -1
  141. package/dist/components/user-action/Textarea.js +3 -3
  142. package/dist/components/user-action/Textarea.js.map +1 -1
  143. package/dist/components/user-action/Textarea.mjs +3 -3
  144. package/dist/components/user-action/Textarea.mjs.map +1 -1
  145. package/dist/css/globals.css +269 -136
  146. package/dist/css/uncompiled/theme/index.css +1 -2
  147. package/dist/hooks/useLocalStorage.js +1 -3
  148. package/dist/hooks/useLocalStorage.js.map +1 -1
  149. package/dist/hooks/useLocalStorage.mjs +3 -4
  150. package/dist/hooks/useLocalStorage.mjs.map +1 -1
  151. package/dist/index.js +141 -129
  152. package/dist/index.js.map +1 -1
  153. package/dist/index.mjs +216 -204
  154. package/dist/index.mjs.map +1 -1
  155. package/dist/localization/LanguageProvider.js +0 -3
  156. package/dist/localization/LanguageProvider.js.map +1 -1
  157. package/dist/localization/LanguageProvider.mjs +5 -8
  158. package/dist/localization/LanguageProvider.mjs.map +1 -1
  159. package/dist/localization/useTranslation.js.map +1 -1
  160. package/dist/localization/useTranslation.mjs +2 -2
  161. package/dist/localization/useTranslation.mjs.map +1 -1
  162. package/dist/theming/useTheme.js +3 -6
  163. package/dist/theming/useTheme.js.map +1 -1
  164. package/dist/theming/useTheme.mjs +8 -11
  165. package/dist/theming/useTheme.mjs.map +1 -1
  166. package/package.json +1 -1
  167. package/dist/css/uncompiled/theme/theme.css +0 -0
@@ -63,7 +63,6 @@ var ButtonUtil = {
63
63
  };
64
64
  var SolidButton = (0, import_react.forwardRef)(function SolidButton2({
65
65
  children,
66
- disabled = false,
67
66
  color = "primary",
68
67
  size = "medium",
69
68
  startIcon,
@@ -73,35 +72,33 @@ var SolidButton = (0, import_react.forwardRef)(function SolidButton2({
73
72
  ...restProps
74
73
  }, ref) {
75
74
  const colorClasses = {
76
- primary: "bg-button-solid-primary-background text-button-solid-primary-text",
77
- secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
78
- tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
79
- positive: "bg-button-solid-positive-background text-button-solid-positive-text",
80
- warning: "bg-button-solid-warning-background text-button-solid-warning-text",
81
- negative: "bg-button-solid-negative-background text-button-solid-negative-text",
82
- neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
75
+ primary: "not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text",
76
+ secondary: "not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text",
77
+ tertiary: "not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text",
78
+ positive: "not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text",
79
+ warning: "not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text",
80
+ negative: "not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text",
81
+ neutral: "not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text"
83
82
  }[color];
84
83
  const iconColorClasses = {
85
- primary: "text-button-solid-primary-icon",
86
- secondary: "text-button-solid-secondary-icon",
87
- tertiary: "text-button-solid-tertiary-icon",
88
- positive: "text-button-solid-positive-icon",
89
- warning: "text-button-solid-warning-icon",
90
- negative: "text-button-solid-negative-icon",
91
- neutral: "text-button-solid-neutral-icon"
84
+ primary: "not-group-disabled:text-button-solid-primary-icon",
85
+ secondary: "not-group-disabled:text-button-solid-secondary-icon",
86
+ tertiary: "not-group-disabled:text-button-solid-tertiary-icon",
87
+ positive: "not-group-disabled:text-button-solid-positive-icon",
88
+ warning: "not-group-disabled:text-button-solid-warning-icon",
89
+ negative: "not-group-disabled:text-button-solid-negative-icon",
90
+ neutral: "not-group-disabled:text-button-solid-neutral-icon"
92
91
  }[color];
93
92
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
94
93
  "button",
95
94
  {
96
95
  ref,
97
96
  onClick,
98
- disabled,
99
97
  className: (0, import_clsx.default)(
100
- "font-semibold",
101
- {
102
- "text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
103
- [(0, import_clsx.default)(colorClasses, "hover:brightness-90")]: !disabled
104
- },
98
+ "group font-semibold",
99
+ colorClasses,
100
+ "not-disabled:hover:brightness-90",
101
+ "disabled:text-disabled-text disabled:bg-disabled-background",
105
102
  ButtonUtil.paddingMapping[size],
106
103
  className
107
104
  ),
@@ -110,10 +107,10 @@ var SolidButton = (0, import_react.forwardRef)(function SolidButton2({
110
107
  startIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
111
108
  "span",
112
109
  {
113
- className: (0, import_clsx.default)({
114
- [iconColorClasses]: !disabled,
115
- [`text-disabled-icon`]: disabled
116
- }),
110
+ className: (0, import_clsx.default)(
111
+ iconColorClasses,
112
+ "group-disabled:text-disabled-icon"
113
+ ),
117
114
  children: startIcon
118
115
  }
119
116
  ),
@@ -121,10 +118,10 @@ var SolidButton = (0, import_react.forwardRef)(function SolidButton2({
121
118
  endIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
122
119
  "span",
123
120
  {
124
- className: (0, import_clsx.default)({
125
- [iconColorClasses]: !disabled,
126
- [`text-disabled-icon`]: disabled
127
- }),
121
+ className: (0, import_clsx.default)(
122
+ iconColorClasses,
123
+ "group-disabled:text-disabled-icon"
124
+ ),
128
125
  children: endIcon
129
126
  }
130
127
  )
@@ -134,32 +131,32 @@ var SolidButton = (0, import_react.forwardRef)(function SolidButton2({
134
131
  });
135
132
  var IconButton = ({
136
133
  children,
137
- disabled = false,
138
134
  color = "primary",
139
135
  size = "medium",
140
136
  className,
141
137
  ...restProps
142
138
  }) => {
143
139
  const colorClasses = {
144
- primary: "bg-button-solid-primary-background text-button-solid-primary-text",
145
- secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
146
- tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
147
- positive: "bg-button-solid-positive-background text-button-solid-positive-text",
148
- warning: "bg-button-solid-warning-background text-button-solid-warning-text",
149
- negative: "bg-button-solid-negative-background text-button-solid-negative-text",
150
- neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
151
- transparent: "bg-transparent"
140
+ primary: "not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text",
141
+ secondary: "not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text",
142
+ tertiary: "not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text",
143
+ positive: "not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text",
144
+ warning: "not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text",
145
+ negative: "not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text",
146
+ neutral: "not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text",
147
+ transparent: "not-disabled:bg-transparent"
152
148
  }[color];
153
149
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
154
150
  "button",
155
151
  {
156
- disabled,
157
152
  className: (0, import_clsx.default)(
153
+ colorClasses,
154
+ "not-disabled:hover:brightness-90",
155
+ "disabled:text-disabled-text",
158
156
  {
159
- "text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
160
- "text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
161
- "hover:bg-button-text-hover-background": !disabled && color === "transparent",
162
- [(0, import_clsx.default)(colorClasses, "hover:brightness-90")]: !disabled
157
+ "disabled:bg-disabled-background": color !== "transparent",
158
+ "disabled:opacity-70": color === "transparent",
159
+ "not-disabled:hover:bg-button-text-hover-background": color === "transparent"
163
160
  },
164
161
  ButtonUtil.iconPaddingMapping[size],
165
162
  className
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/table/TableSortButton.tsx","../../../src/components/user-action/Button.tsx"],"sourcesContent":["import { ChevronDown, ChevronsUpDown, ChevronUp } from 'lucide-react'\nimport type { IconButtonProps } from '../user-action/Button'\nimport { IconButton } from '../user-action/Button'\nimport clsx from 'clsx'\nimport type { SortDirection } from '@tanstack/react-table'\n\nexport type TableSortButtonProps = IconButtonProps & {\n sortDirection: SortDirection | false,\n invert?: boolean,\n}\n\n/**\n * An Extension of the normal button that displays the sorting state right of the content\n */\nexport const TableSortButton = ({\n sortDirection,\n invert = false,\n color = 'neutral',\n className,\n ...buttonProps\n }: TableSortButtonProps) => {\n let icon = <ChevronsUpDown className=\"w-full h-full\"/>\n if (sortDirection) {\n let usedSortDirection = sortDirection\n if (invert) {\n usedSortDirection = usedSortDirection === 'desc' ? 'asc' : 'desc'\n }\n icon = usedSortDirection === 'asc' ? (<ChevronUp className=\"w-full h-full\"/>) : (\n <ChevronDown className=\"w-full h-full\"/>)\n }\n\n return (\n <IconButton\n size=\"tiny\"\n color={color}\n className={clsx(className)}\n {...buttonProps}\n >\n {icon}\n </IconButton>\n )\n}","import type { ButtonHTMLAttributes, PropsWithChildren, ReactNode } from 'react'\nimport { forwardRef } from 'react'\nimport clsx from 'clsx'\n\n\nexport const ButtonColorUtil = {\n solid: ['primary', 'secondary', 'tertiary', 'positive', 'warning', 'negative', 'neutral'] as const,\n text: ['primary', 'negative', 'neutral'] as const,\n outline: ['primary'] as const,\n}\n\nexport const IconButtonUtil = {\n icon: [...ButtonColorUtil.solid, 'transparent'] as const,\n}\n\n\n/**\n * The allowed colors for the SolidButton and IconButton\n */\nexport type SolidButtonColor = typeof ButtonColorUtil.solid[number]\n/**\n * The allowed colors for the OutlineButton\n */\nexport type OutlineButtonColor = typeof ButtonColorUtil.outline[number]\n/**\n * The allowed colors for the TextButton\n */\nexport type TextButtonColor = typeof ButtonColorUtil.text[number]\n/**\n * The allowed colors for the IconButton\n */\nexport type IconButtonColor = typeof IconButtonUtil.icon[number]\n\n\n/**\n * The different sizes for a button\n */\ntype ButtonSizes = 'small' | 'medium' | 'large'\n\ntype IconButtonSize = 'tiny' | 'small' | 'medium' | 'large'\n\n/**\n * The shard properties between all button types\n */\nexport type ButtonProps = PropsWithChildren<{\n /**\n * @default 'medium'\n */\n size?: ButtonSizes,\n}> & ButtonHTMLAttributes<Element>\n\nconst paddingMapping: Record<ButtonSizes, string> = {\n small: 'btn-sm',\n medium: 'btn-md',\n large: 'btn-lg'\n}\n\nconst iconPaddingMapping: Record<IconButtonSize, string> = {\n tiny: 'icon-btn-xs',\n small: 'icon-btn-sm',\n medium: 'icon-btn-md',\n large: 'icon-btn-lg'\n}\n\nexport const ButtonUtil = {\n paddingMapping,\n iconPaddingMapping\n}\n\ntype ButtonWithIconsProps = ButtonProps & {\n startIcon?: ReactNode,\n endIcon?: ReactNode,\n}\n\nexport type SolidButtonProps = ButtonWithIconsProps & {\n color?: SolidButtonColor,\n}\n\nexport type OutlineButtonProps = ButtonWithIconsProps & {\n color?: OutlineButtonColor,\n}\n\nexport type TextButtonProps = ButtonWithIconsProps & {\n color?: TextButtonColor,\n coloredHoverBackground?: boolean,\n}\n\n/**\n * The shard properties between all button types\n */\nexport type IconButtonProps = PropsWithChildren<{\n /**\n * @default 'medium'\n */\n size?: IconButtonSize,\n color?: IconButtonColor,\n}> & ButtonHTMLAttributes<Element>\n\n/**\n * A button with a solid background and different sizes\n */\nconst SolidButton = forwardRef<HTMLButtonElement, SolidButtonProps>(function SolidButton({\n children,\n disabled = false,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }, ref) {\n const colorClasses = {\n primary: 'bg-button-solid-primary-background text-button-solid-primary-text',\n secondary: 'bg-button-solid-secondary-background text-button-solid-secondary-text',\n tertiary: 'bg-button-solid-tertiary-background text-button-solid-tertiary-text',\n positive: 'bg-button-solid-positive-background text-button-solid-positive-text',\n warning: 'bg-button-solid-warning-background text-button-solid-warning-text',\n negative: 'bg-button-solid-negative-background text-button-solid-negative-text',\n neutral: 'bg-button-solid-neutral-background text-button-solid-neutral-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'text-button-solid-primary-icon',\n secondary: 'text-button-solid-secondary-icon',\n tertiary: 'text-button-solid-tertiary-icon',\n positive: 'text-button-solid-positive-icon',\n warning: 'text-button-solid-warning-icon',\n negative: 'text-button-solid-negative-icon',\n neutral: 'text-button-solid-neutral-icon',\n }[color]\n\n return (\n <button\n ref={ref}\n onClick={onClick}\n disabled={disabled}\n className={clsx(\n 'font-semibold',\n {\n 'text-disabled-text bg-disabled-background cursor-not-allowed': disabled,\n [clsx(colorClasses, 'hover:brightness-90')]: !disabled\n },\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n})\n\n/**\n * A button with an outline border and different sizes\n */\nconst OutlineButton = ({\n children,\n disabled = false,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: OutlineButtonProps) => {\n const colorClasses = {\n primary: 'bg-transparent border-2 border-button-outline-primary-text text-button-outline-primary-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'text-button-outline-primary-icon',\n }[color]\n return (\n <button\n onClick={onClick}\n disabled={disabled}\n className={clsx(\n 'font-semibold',\n {\n 'text-disabled-text border-disabled-outline cursor-not-allowed': disabled,\n [clsx(colorClasses, 'hover:brightness-80')]: !disabled,\n },\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n/**\n * A text that is a button that can have different sizes\n */\nconst TextButton = ({\n children,\n disabled = false,\n color = 'neutral',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n coloredHoverBackground = true,\n className,\n ...restProps\n }: TextButtonProps) => {\n const colorClasses = {\n primary: 'bg-transparent text-button-text-primary-text',\n negative: 'bg-transparent text-button-text-negative-text',\n neutral: 'bg-transparent text-button-text-neutral-text',\n }[color]\n\n const backgroundColor = {\n primary: 'hover:bg-button-text-primary-text/20',\n negative: 'hover:bg-button-text-negative-text/20',\n neutral: 'hover:bg-button-text-neutral-text/20',\n }[color]\n\n const iconColorClasses = {\n primary: 'text-button-text-primary-icon',\n negative: 'text-button-text-negative-icon',\n neutral: 'text-button-text-neutral-icon',\n }[color]\n\n return (\n <button\n onClick={onClick}\n disabled={disabled}\n className={clsx(\n 'font-semibold',\n {\n 'text-disabled-text cursor-not-allowed': disabled,\n [colorClasses]: !disabled,\n [backgroundColor]: !disabled && coloredHoverBackground,\n 'hover:bg-button-text-hover-background': !disabled && !coloredHoverBackground,\n },\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n\n/**\n * A button for icons with a solid background and different sizes\n */\nconst IconButton = ({\n children,\n disabled = false,\n color = 'primary',\n size = 'medium',\n className,\n ...restProps\n }: IconButtonProps) => {\n const colorClasses = {\n primary: 'bg-button-solid-primary-background text-button-solid-primary-text',\n secondary: 'bg-button-solid-secondary-background text-button-solid-secondary-text',\n tertiary: 'bg-button-solid-tertiary-background text-button-solid-tertiary-text',\n positive: 'bg-button-solid-positive-background text-button-solid-positive-text',\n warning: 'bg-button-solid-warning-background text-button-solid-warning-text',\n negative: 'bg-button-solid-negative-background text-button-solid-negative-text',\n neutral: 'bg-button-solid-neutral-background text-button-solid-neutral-text',\n transparent: 'bg-transparent',\n }[color]\n\n return (\n <button\n disabled={disabled}\n className={clsx(\n {\n 'text-disabled-text bg-disabled-background cursor-not-allowed': disabled && color !== 'transparent',\n 'text-disabled-text cursor-not-allowed opacity-70': disabled && color === 'transparent',\n 'hover:bg-button-text-hover-background': !disabled && color === 'transparent',\n [clsx(colorClasses, 'hover:brightness-90')]: !disabled,\n },\n ButtonUtil.iconPaddingMapping[size],\n className\n )}\n {...restProps}\n >\n {children}\n </button>\n )\n}\n\nexport { SolidButton, OutlineButton, TextButton, IconButton }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAuD;;;ACCvD,mBAA2B;AAC3B,kBAAiB;AAmIb;AAhIG,IAAM,kBAAkB;AAAA,EAC7B,OAAO,CAAC,WAAW,aAAa,YAAY,YAAY,WAAW,YAAY,SAAS;AAAA,EACxF,MAAM,CAAC,WAAW,YAAY,SAAS;AAAA,EACvC,SAAS,CAAC,SAAS;AACrB;AAEO,IAAM,iBAAiB;AAAA,EAC5B,MAAM,CAAC,GAAG,gBAAgB,OAAO,aAAa;AAChD;AAsCA,IAAM,iBAA8C;AAAA,EAClD,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AACT;AAEA,IAAM,qBAAqD;AAAA,EACzD,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AACT;AAEO,IAAM,aAAa;AAAA,EACxB;AAAA,EACA;AACF;AAkCA,IAAM,kBAAc,yBAAgD,SAASA,aAAY;AAAA,EAClE;AAAA,EACA,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,OAAO;AAAA,EACP;A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,IACnB,SAAS;AAAA,IACT,WAAW;AAAA,IACX,UAAU;AAAA,IACV,UAAU;AAAA,IACV,SAAS;AAAA,IACT,UAAU;AAAA,IACV,SAAS;AAAA,IACT,aAAa;AAAA,EACf,EAAE,KAAK;AAEP,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,eAAW,YAAAC;AAAA,QACT;AAAA,UACE,gEAAgE,YAAY,UAAU;AAAA,UACtF,oDAAoD,YAAY,UAAU;AAAA,UAC1E,yCAAyC,CAAC,YAAY,UAAU;AAAA,UAChE,KAAC,YAAAA,SAAK,cAAc,qBAAqB,CAAC,GAAG,CAAC;AAAA,QAChD;AAAA,QACA,WAAW,mBAAmB,IAAI;AAAA,QAClC;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;;;AD3VA,IAAAC,eAAiB;AAkBJ,IAAAC,sBAAA;AAPN,IAAM,kBAAkB,CAAC;AAAA,EACH;AAAA,EACA,SAAS;AAAA,EACT,QAAQ;AAAA,EACR;AAAA,EACA,GAAG;AACL,MAA4B;AACrD,MAAI,OAAO,6CAAC,sCAAe,WAAU,iBAAe;AACpD,MAAI,eAAe;AACjB,QAAI,oBAAoB;AACxB,QAAI,QAAQ;AACV,0BAAoB,sBAAsB,SAAS,QAAQ;AAAA,IAC7D;AACA,WAAO,sBAAsB,QAAS,6CAAC,iCAAU,WAAU,iBAAe,IACxE,6CAAC,mCAAY,WAAU,iBAAe;AAAA,EAC1C;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL;AAAA,MACA,eAAW,aAAAC,SAAK,SAAS;AAAA,MACxB,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;","names":["SolidButton","clsx","clsx","import_clsx","import_jsx_runtime","clsx"]}
1
+ {"version":3,"sources":["../../../src/components/table/TableSortButton.tsx","../../../src/components/user-action/Button.tsx"],"sourcesContent":["import { ChevronDown, ChevronsUpDown, ChevronUp } from 'lucide-react'\nimport type { IconButtonProps } from '../user-action/Button'\nimport { IconButton } from '../user-action/Button'\nimport clsx from 'clsx'\nimport type { SortDirection } from '@tanstack/react-table'\n\nexport type TableSortButtonProps = IconButtonProps & {\n sortDirection: SortDirection | false,\n invert?: boolean,\n}\n\n/**\n * An Extension of the normal button that displays the sorting state right of the content\n */\nexport const TableSortButton = ({\n sortDirection,\n invert = false,\n color = 'neutral',\n className,\n ...buttonProps\n }: TableSortButtonProps) => {\n let icon = <ChevronsUpDown className=\"w-full h-full\"/>\n if (sortDirection) {\n let usedSortDirection = sortDirection\n if (invert) {\n usedSortDirection = usedSortDirection === 'desc' ? 'asc' : 'desc'\n }\n icon = usedSortDirection === 'asc' ? (<ChevronUp className=\"w-full h-full\"/>) : (\n <ChevronDown className=\"w-full h-full\"/>)\n }\n\n return (\n <IconButton\n size=\"tiny\"\n color={color}\n className={clsx(className)}\n {...buttonProps}\n >\n {icon}\n </IconButton>\n )\n}","import type { ButtonHTMLAttributes, PropsWithChildren, ReactNode } from 'react'\nimport { forwardRef } from 'react'\nimport clsx from 'clsx'\n\n\nexport const ButtonColorUtil = {\n solid: ['primary', 'secondary', 'tertiary', 'positive', 'warning', 'negative', 'neutral'] as const,\n text: ['primary', 'negative', 'neutral'] as const,\n outline: ['primary'] as const,\n}\n\nexport const IconButtonUtil = {\n icon: [...ButtonColorUtil.solid, 'transparent'] as const,\n}\n\n\n/**\n * The allowed colors for the SolidButton and IconButton\n */\nexport type SolidButtonColor = typeof ButtonColorUtil.solid[number]\n/**\n * The allowed colors for the OutlineButton\n */\nexport type OutlineButtonColor = typeof ButtonColorUtil.outline[number]\n/**\n * The allowed colors for the TextButton\n */\nexport type TextButtonColor = typeof ButtonColorUtil.text[number]\n/**\n * The allowed colors for the IconButton\n */\nexport type IconButtonColor = typeof IconButtonUtil.icon[number]\n\n\n/**\n * The different sizes for a button\n */\ntype ButtonSizes = 'small' | 'medium' | 'large'\n\ntype IconButtonSize = 'tiny' | 'small' | 'medium' | 'large'\n\n/**\n * The shard properties between all button types\n */\nexport type ButtonProps = PropsWithChildren<{\n /**\n * @default 'medium'\n */\n size?: ButtonSizes,\n}> & ButtonHTMLAttributes<Element>\n\nconst paddingMapping: Record<ButtonSizes, string> = {\n small: 'btn-sm',\n medium: 'btn-md',\n large: 'btn-lg'\n}\n\nconst iconPaddingMapping: Record<IconButtonSize, string> = {\n tiny: 'icon-btn-xs',\n small: 'icon-btn-sm',\n medium: 'icon-btn-md',\n large: 'icon-btn-lg'\n}\n\nexport const ButtonUtil = {\n paddingMapping,\n iconPaddingMapping\n}\n\ntype ButtonWithIconsProps = ButtonProps & {\n startIcon?: ReactNode,\n endIcon?: ReactNode,\n}\n\nexport type SolidButtonProps = ButtonWithIconsProps & {\n color?: SolidButtonColor,\n}\n\nexport type OutlineButtonProps = ButtonWithIconsProps & {\n color?: OutlineButtonColor,\n}\n\nexport type TextButtonProps = ButtonWithIconsProps & {\n color?: TextButtonColor,\n coloredHoverBackground?: boolean,\n}\n\n/**\n * The shard properties between all button types\n */\nexport type IconButtonProps = PropsWithChildren<{\n /**\n * @default 'medium'\n */\n size?: IconButtonSize,\n color?: IconButtonColor,\n}> & ButtonHTMLAttributes<Element>\n\n/**\n * A button with a solid background and different sizes\n */\nconst SolidButton = forwardRef<HTMLButtonElement, SolidButtonProps>(function SolidButton({\n children,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }, ref) {\n const colorClasses = {\n primary: 'not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text',\n secondary: 'not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text',\n tertiary: 'not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text',\n positive: 'not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text',\n warning: 'not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text',\n negative: 'not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text',\n neutral: 'not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'not-group-disabled:text-button-solid-primary-icon',\n secondary: 'not-group-disabled:text-button-solid-secondary-icon',\n tertiary: 'not-group-disabled:text-button-solid-tertiary-icon',\n positive: 'not-group-disabled:text-button-solid-positive-icon',\n warning: 'not-group-disabled:text-button-solid-warning-icon',\n negative: 'not-group-disabled:text-button-solid-negative-icon',\n neutral: 'not-group-disabled:text-button-solid-neutral-icon',\n }[color]\n\n return (\n <button\n ref={ref}\n onClick={onClick}\n className={clsx(\n 'group font-semibold',\n colorClasses,\n 'not-disabled:hover:brightness-90',\n 'disabled:text-disabled-text disabled:bg-disabled-background',\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n})\n\n/**\n * A button with an outline border and different sizes\n */\nconst OutlineButton = ({\n children,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: OutlineButtonProps) => {\n const colorClasses = {\n primary: 'not-disabled:border-button-outline-primary-text not-disabled:text-button-outline-primary-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'not-group-disabled:text-button-outline-primary-icon',\n }[color]\n return (\n <button\n onClick={onClick}\n className={clsx(\n 'group font-semibold bg-transparent border-2 ',\n 'not-disabled:hover:brightness-80',\n colorClasses,\n 'disabled:text-disabled-text disabled:border-disabled-outline',\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n/**\n * A text that is a button that can have different sizes\n */\nconst TextButton = ({\n children,\n color = 'neutral',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n coloredHoverBackground = true,\n className,\n ...restProps\n }: TextButtonProps) => {\n const colorClasses = {\n primary: 'not-disabled:bg-transparent not-disabled:text-button-text-primary-text',\n negative: 'not-disabled:bg-transparent not-disabled:text-button-text-negative-text',\n neutral: 'not-disabled:bg-transparent not-disabled:text-button-text-neutral-text',\n }[color]\n\n const backgroundColor = {\n primary: 'not-disabled:hover:bg-button-text-primary-text/20',\n negative: 'not-disabled:hover:bg-button-text-negative-text/20',\n neutral: 'not-disabled:hover:bg-button-text-neutral-text/20',\n }[color]\n\n const iconColorClasses = {\n primary: 'not-group-disabled:text-button-text-primary-icon',\n negative: 'not-group-disabled:text-button-text-negative-icon',\n neutral: 'not-group-disabled:text-button-text-neutral-icon',\n }[color]\n\n return (\n <button\n onClick={onClick}\n className={clsx(\n 'group font-semibold',\n 'disabled:text-disabled-text',\n colorClasses,\n {\n [backgroundColor]: coloredHoverBackground,\n 'not-disabled:hover:bg-button-text-hover-background': !coloredHoverBackground,\n },\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n\n/**\n * A button for icons with a solid background and different sizes\n */\nconst IconButton = ({\n children,\n color = 'primary',\n size = 'medium',\n className,\n ...restProps\n }: IconButtonProps) => {\n const colorClasses = {\n primary: 'not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text',\n secondary: 'not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text',\n tertiary: 'not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text',\n positive: 'not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text',\n warning: 'not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text',\n negative: 'not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text',\n neutral: 'not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text',\n transparent: 'not-disabled:bg-transparent',\n }[color]\n\n return (\n <button\n className={clsx(\n colorClasses,\n 'not-disabled:hover:brightness-90',\n 'disabled:text-disabled-text',\n {\n 'disabled:bg-disabled-background': color !== 'transparent',\n 'disabled:opacity-70': color === 'transparent',\n 'not-disabled:hover:bg-button-text-hover-background': color === 'transparent',\n },\n ButtonUtil.iconPaddingMapping[size],\n className\n )}\n {...restProps}\n >\n {children}\n </button>\n )\n}\n\nexport { SolidButton, OutlineButton, TextButton, IconButton }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAuD;;;ACCvD,mBAA2B;AAC3B,kBAAiB;AAkIb;AA/HG,IAAM,kBAAkB;AAAA,EAC7B,OAAO,CAAC,WAAW,aAAa,YAAY,YAAY,WAAW,YAAY,SAAS;AAAA,EACxF,MAAM,CAAC,WAAW,YAAY,SAAS;AAAA,EACvC,SAAS,CAAC,SAAS;AACrB;AAEO,IAAM,iBAAiB;AAAA,EAC5B,MAAM,CAAC,GAAG,gBAAgB,OAAO,aAAa;AAChD;AAsCA,IAAM,iBAA8C;AAAA,EAClD,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AACT;AAEA,IAAM,qBAAqD;AAAA,EACzD,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AACT;AAEO,IAAM,aAAa;AAAA,EACxB;AAAA,EACA;AACF;AAkCA,IAAM,kBAAc,yBAAg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AEP,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAW,YAAAC;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,UACE,mCAAmC,UAAU;AAAA,UAC7C,uBAAuB,UAAU;AAAA,UACjC,sDAAsD,UAAU;AAAA,QAClE;AAAA,QACA,WAAW,mBAAmB,IAAI;AAAA,QAClC;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;;;ADnVA,IAAAC,eAAiB;AAkBJ,IAAAC,sBAAA;AAPN,IAAM,kBAAkB,CAAC;AAAA,EACH;AAAA,EACA,SAAS;AAAA,EACT,QAAQ;AAAA,EACR;AAAA,EACA,GAAG;AACL,MAA4B;AACrD,MAAI,OAAO,6CAAC,sCAAe,WAAU,iBAAe;AACpD,MAAI,eAAe;AACjB,QAAI,oBAAoB;AACxB,QAAI,QAAQ;AACV,0BAAoB,sBAAsB,SAAS,QAAQ;AAAA,IAC7D;AACA,WAAO,sBAAsB,QAAS,6CAAC,iCAAU,WAAU,iBAAe,IACxE,6CAAC,mCAAY,WAAU,iBAAe;AAAA,EAC1C;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL;AAAA,MACA,eAAW,aAAAC,SAAK,SAAS;AAAA,MACxB,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;","names":["SolidButton","clsx","clsx","import_clsx","import_jsx_runtime","clsx"]}
@@ -30,7 +30,6 @@ var ButtonUtil = {
30
30
  };
31
31
  var SolidButton = forwardRef(function SolidButton2({
32
32
  children,
33
- disabled = false,
34
33
  color = "primary",
35
34
  size = "medium",
36
35
  startIcon,
@@ -40,35 +39,33 @@ var SolidButton = forwardRef(function SolidButton2({
40
39
  ...restProps
41
40
  }, ref) {
42
41
  const colorClasses = {
43
- primary: "bg-button-solid-primary-background text-button-solid-primary-text",
44
- secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
45
- tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
46
- positive: "bg-button-solid-positive-background text-button-solid-positive-text",
47
- warning: "bg-button-solid-warning-background text-button-solid-warning-text",
48
- negative: "bg-button-solid-negative-background text-button-solid-negative-text",
49
- neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
42
+ primary: "not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text",
43
+ secondary: "not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text",
44
+ tertiary: "not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text",
45
+ positive: "not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text",
46
+ warning: "not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text",
47
+ negative: "not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text",
48
+ neutral: "not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text"
50
49
  }[color];
51
50
  const iconColorClasses = {
52
- primary: "text-button-solid-primary-icon",
53
- secondary: "text-button-solid-secondary-icon",
54
- tertiary: "text-button-solid-tertiary-icon",
55
- positive: "text-button-solid-positive-icon",
56
- warning: "text-button-solid-warning-icon",
57
- negative: "text-button-solid-negative-icon",
58
- neutral: "text-button-solid-neutral-icon"
51
+ primary: "not-group-disabled:text-button-solid-primary-icon",
52
+ secondary: "not-group-disabled:text-button-solid-secondary-icon",
53
+ tertiary: "not-group-disabled:text-button-solid-tertiary-icon",
54
+ positive: "not-group-disabled:text-button-solid-positive-icon",
55
+ warning: "not-group-disabled:text-button-solid-warning-icon",
56
+ negative: "not-group-disabled:text-button-solid-negative-icon",
57
+ neutral: "not-group-disabled:text-button-solid-neutral-icon"
59
58
  }[color];
60
59
  return /* @__PURE__ */ jsxs(
61
60
  "button",
62
61
  {
63
62
  ref,
64
63
  onClick,
65
- disabled,
66
64
  className: clsx(
67
- "font-semibold",
68
- {
69
- "text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
70
- [clsx(colorClasses, "hover:brightness-90")]: !disabled
71
- },
65
+ "group font-semibold",
66
+ colorClasses,
67
+ "not-disabled:hover:brightness-90",
68
+ "disabled:text-disabled-text disabled:bg-disabled-background",
72
69
  ButtonUtil.paddingMapping[size],
73
70
  className
74
71
  ),
@@ -77,10 +74,10 @@ var SolidButton = forwardRef(function SolidButton2({
77
74
  startIcon && /* @__PURE__ */ jsx(
78
75
  "span",
79
76
  {
80
- className: clsx({
81
- [iconColorClasses]: !disabled,
82
- [`text-disabled-icon`]: disabled
83
- }),
77
+ className: clsx(
78
+ iconColorClasses,
79
+ "group-disabled:text-disabled-icon"
80
+ ),
84
81
  children: startIcon
85
82
  }
86
83
  ),
@@ -88,10 +85,10 @@ var SolidButton = forwardRef(function SolidButton2({
88
85
  endIcon && /* @__PURE__ */ jsx(
89
86
  "span",
90
87
  {
91
- className: clsx({
92
- [iconColorClasses]: !disabled,
93
- [`text-disabled-icon`]: disabled
94
- }),
88
+ className: clsx(
89
+ iconColorClasses,
90
+ "group-disabled:text-disabled-icon"
91
+ ),
95
92
  children: endIcon
96
93
  }
97
94
  )
@@ -101,32 +98,32 @@ var SolidButton = forwardRef(function SolidButton2({
101
98
  });
102
99
  var IconButton = ({
103
100
  children,
104
- disabled = false,
105
101
  color = "primary",
106
102
  size = "medium",
107
103
  className,
108
104
  ...restProps
109
105
  }) => {
110
106
  const colorClasses = {
111
- primary: "bg-button-solid-primary-background text-button-solid-primary-text",
112
- secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
113
- tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
114
- positive: "bg-button-solid-positive-background text-button-solid-positive-text",
115
- warning: "bg-button-solid-warning-background text-button-solid-warning-text",
116
- negative: "bg-button-solid-negative-background text-button-solid-negative-text",
117
- neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
118
- transparent: "bg-transparent"
107
+ primary: "not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text",
108
+ secondary: "not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text",
109
+ tertiary: "not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text",
110
+ positive: "not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text",
111
+ warning: "not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text",
112
+ negative: "not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text",
113
+ neutral: "not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text",
114
+ transparent: "not-disabled:bg-transparent"
119
115
  }[color];
120
116
  return /* @__PURE__ */ jsx(
121
117
  "button",
122
118
  {
123
- disabled,
124
119
  className: clsx(
120
+ colorClasses,
121
+ "not-disabled:hover:brightness-90",
122
+ "disabled:text-disabled-text",
125
123
  {
126
- "text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
127
- "text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
128
- "hover:bg-button-text-hover-background": !disabled && color === "transparent",
129
- [clsx(colorClasses, "hover:brightness-90")]: !disabled
124
+ "disabled:bg-disabled-background": color !== "transparent",
125
+ "disabled:opacity-70": color === "transparent",
126
+ "not-disabled:hover:bg-button-text-hover-background": color === "transparent"
130
127
  },
131
128
  ButtonUtil.iconPaddingMapping[size],
132
129
  className
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/table/TableSortButton.tsx","../../../src/components/user-action/Button.tsx"],"sourcesContent":["import { ChevronDown, ChevronsUpDown, ChevronUp } from 'lucide-react'\nimport type { IconButtonProps } from '../user-action/Button'\nimport { IconButton } from '../user-action/Button'\nimport clsx from 'clsx'\nimport type { SortDirection } from '@tanstack/react-table'\n\nexport type TableSortButtonProps = IconButtonProps & {\n sortDirection: SortDirection | false,\n invert?: boolean,\n}\n\n/**\n * An Extension of the normal button that displays the sorting state right of the content\n */\nexport const TableSortButton = ({\n sortDirection,\n invert = false,\n color = 'neutral',\n className,\n ...buttonProps\n }: TableSortButtonProps) => {\n let icon = <ChevronsUpDown className=\"w-full h-full\"/>\n if (sortDirection) {\n let usedSortDirection = sortDirection\n if (invert) {\n usedSortDirection = usedSortDirection === 'desc' ? 'asc' : 'desc'\n }\n icon = usedSortDirection === 'asc' ? (<ChevronUp className=\"w-full h-full\"/>) : (\n <ChevronDown className=\"w-full h-full\"/>)\n }\n\n return (\n <IconButton\n size=\"tiny\"\n color={color}\n className={clsx(className)}\n {...buttonProps}\n >\n {icon}\n </IconButton>\n )\n}","import type { ButtonHTMLAttributes, PropsWithChildren, ReactNode } from 'react'\nimport { forwardRef } from 'react'\nimport clsx from 'clsx'\n\n\nexport const ButtonColorUtil = {\n solid: ['primary', 'secondary', 'tertiary', 'positive', 'warning', 'negative', 'neutral'] as const,\n text: ['primary', 'negative', 'neutral'] as const,\n outline: ['primary'] as const,\n}\n\nexport const IconButtonUtil = {\n icon: [...ButtonColorUtil.solid, 'transparent'] as const,\n}\n\n\n/**\n * The allowed colors for the SolidButton and IconButton\n */\nexport type SolidButtonColor = typeof ButtonColorUtil.solid[number]\n/**\n * The allowed colors for the OutlineButton\n */\nexport type OutlineButtonColor = typeof ButtonColorUtil.outline[number]\n/**\n * The allowed colors for the TextButton\n */\nexport type TextButtonColor = typeof ButtonColorUtil.text[number]\n/**\n * The allowed colors for the IconButton\n */\nexport type IconButtonColor = typeof IconButtonUtil.icon[number]\n\n\n/**\n * The different sizes for a button\n */\ntype ButtonSizes = 'small' | 'medium' | 'large'\n\ntype IconButtonSize = 'tiny' | 'small' | 'medium' | 'large'\n\n/**\n * The shard properties between all button types\n */\nexport type ButtonProps = PropsWithChildren<{\n /**\n * @default 'medium'\n */\n size?: ButtonSizes,\n}> & ButtonHTMLAttributes<Element>\n\nconst paddingMapping: Record<ButtonSizes, string> = {\n small: 'btn-sm',\n medium: 'btn-md',\n large: 'btn-lg'\n}\n\nconst iconPaddingMapping: Record<IconButtonSize, string> = {\n tiny: 'icon-btn-xs',\n small: 'icon-btn-sm',\n medium: 'icon-btn-md',\n large: 'icon-btn-lg'\n}\n\nexport const ButtonUtil = {\n paddingMapping,\n iconPaddingMapping\n}\n\ntype ButtonWithIconsProps = ButtonProps & {\n startIcon?: ReactNode,\n endIcon?: ReactNode,\n}\n\nexport type SolidButtonProps = ButtonWithIconsProps & {\n color?: SolidButtonColor,\n}\n\nexport type OutlineButtonProps = ButtonWithIconsProps & {\n color?: OutlineButtonColor,\n}\n\nexport type TextButtonProps = ButtonWithIconsProps & {\n color?: TextButtonColor,\n coloredHoverBackground?: boolean,\n}\n\n/**\n * The shard properties between all button types\n */\nexport type IconButtonProps = PropsWithChildren<{\n /**\n * @default 'medium'\n */\n size?: IconButtonSize,\n color?: IconButtonColor,\n}> & ButtonHTMLAttributes<Element>\n\n/**\n * A button with a solid background and different sizes\n */\nconst SolidButton = forwardRef<HTMLButtonElement, SolidButtonProps>(function SolidButton({\n children,\n disabled = false,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }, ref) {\n const colorClasses = {\n primary: 'bg-button-solid-primary-background text-button-solid-primary-text',\n secondary: 'bg-button-solid-secondary-background text-button-solid-secondary-text',\n tertiary: 'bg-button-solid-tertiary-background text-button-solid-tertiary-text',\n positive: 'bg-button-solid-positive-background text-button-solid-positive-text',\n warning: 'bg-button-solid-warning-background text-button-solid-warning-text',\n negative: 'bg-button-solid-negative-background text-button-solid-negative-text',\n neutral: 'bg-button-solid-neutral-background text-button-solid-neutral-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'text-button-solid-primary-icon',\n secondary: 'text-button-solid-secondary-icon',\n tertiary: 'text-button-solid-tertiary-icon',\n positive: 'text-button-solid-positive-icon',\n warning: 'text-button-solid-warning-icon',\n negative: 'text-button-solid-negative-icon',\n neutral: 'text-button-solid-neutral-icon',\n }[color]\n\n return (\n <button\n ref={ref}\n onClick={onClick}\n disabled={disabled}\n className={clsx(\n 'font-semibold',\n {\n 'text-disabled-text bg-disabled-background cursor-not-allowed': disabled,\n [clsx(colorClasses, 'hover:brightness-90')]: !disabled\n },\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n})\n\n/**\n * A button with an outline border and different sizes\n */\nconst OutlineButton = ({\n children,\n disabled = false,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: OutlineButtonProps) => {\n const colorClasses = {\n primary: 'bg-transparent border-2 border-button-outline-primary-text text-button-outline-primary-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'text-button-outline-primary-icon',\n }[color]\n return (\n <button\n onClick={onClick}\n disabled={disabled}\n className={clsx(\n 'font-semibold',\n {\n 'text-disabled-text border-disabled-outline cursor-not-allowed': disabled,\n [clsx(colorClasses, 'hover:brightness-80')]: !disabled,\n },\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n/**\n * A text that is a button that can have different sizes\n */\nconst TextButton = ({\n children,\n disabled = false,\n color = 'neutral',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n coloredHoverBackground = true,\n className,\n ...restProps\n }: TextButtonProps) => {\n const colorClasses = {\n primary: 'bg-transparent text-button-text-primary-text',\n negative: 'bg-transparent text-button-text-negative-text',\n neutral: 'bg-transparent text-button-text-neutral-text',\n }[color]\n\n const backgroundColor = {\n primary: 'hover:bg-button-text-primary-text/20',\n negative: 'hover:bg-button-text-negative-text/20',\n neutral: 'hover:bg-button-text-neutral-text/20',\n }[color]\n\n const iconColorClasses = {\n primary: 'text-button-text-primary-icon',\n negative: 'text-button-text-negative-icon',\n neutral: 'text-button-text-neutral-icon',\n }[color]\n\n return (\n <button\n onClick={onClick}\n disabled={disabled}\n className={clsx(\n 'font-semibold',\n {\n 'text-disabled-text cursor-not-allowed': disabled,\n [colorClasses]: !disabled,\n [backgroundColor]: !disabled && coloredHoverBackground,\n 'hover:bg-button-text-hover-background': !disabled && !coloredHoverBackground,\n },\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n\n/**\n * A button for icons with a solid background and different sizes\n */\nconst IconButton = ({\n children,\n disabled = false,\n color = 'primary',\n size = 'medium',\n className,\n ...restProps\n }: IconButtonProps) => {\n const colorClasses = {\n primary: 'bg-button-solid-primary-background text-button-solid-primary-text',\n secondary: 'bg-button-solid-secondary-background text-button-solid-secondary-text',\n tertiary: 'bg-button-solid-tertiary-background text-button-solid-tertiary-text',\n positive: 'bg-button-solid-positive-background text-button-solid-positive-text',\n warning: 'bg-button-solid-warning-background text-button-solid-warning-text',\n negative: 'bg-button-solid-negative-background text-button-solid-negative-text',\n neutral: 'bg-button-solid-neutral-background text-button-solid-neutral-text',\n transparent: 'bg-transparent',\n }[color]\n\n return (\n <button\n disabled={disabled}\n className={clsx(\n {\n 'text-disabled-text bg-disabled-background cursor-not-allowed': disabled && color !== 'transparent',\n 'text-disabled-text cursor-not-allowed opacity-70': disabled && color === 'transparent',\n 'hover:bg-button-text-hover-background': !disabled && color === 'transparent',\n [clsx(colorClasses, 'hover:brightness-90')]: !disabled,\n },\n ButtonUtil.iconPaddingMapping[size],\n className\n )}\n {...restProps}\n >\n {children}\n </button>\n )\n}\n\nexport { SolidButton, OutlineButton, TextButton, IconButton }\n"],"mappings":";AAAA,SAAS,aAAa,gBAAgB,iBAAiB;;;ACCvD,SAAS,kBAAkB;AAC3B,OAAO,UAAU;AAmIb,SAgBI,KAhBJ;AAhIG,IAAM,kBAAkB;AAAA,EAC7B,OAAO,CAAC,WAAW,aAAa,YAAY,YAAY,WAAW,YAAY,SAAS;AAAA,EACxF,MAAM,CAAC,WAAW,YAAY,SAAS;AAAA,EACvC,SAAS,CAAC,SAAS;AACrB;AAEO,IAAM,iBAAiB;AAAA,EAC5B,MAAM,CAAC,GAAG,gBAAgB,OAAO,aAAa;AAChD;AAsCA,IAAM,iBAA8C;AAAA,EAClD,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AACT;AAEA,IAAM,qBAAqD;AAAA,EACzD,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AACT;AAEO,IAAM,aAAa;AAAA,EACxB;AAAA,EACA;AACF;AAkCA,IAAM,cAAc,WAAgD,SAASA,aAAY;AAAA,EAClE;AAAA,EACA,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAG,KAAK;AAC3B,QAAM,eAAe;AAAA,IACnB,SAAS;AAAA,IACT,WAAW;AAAA,IACX,UAAU;AAAA,IACV,UAAU;AAAA,IACV,SAAS;AAAA,IACT,UAAU;AAAA,IACV,SAAS;AAAA,EACX,EAAE,KAAK;AAEP,QAAM,mBAAmB;AAAA,IACvB,SAAS;AAAA,IACT,WAAW;AAAA,IACX,UAAU;AAAA,IACV,UAAU;AAAA,IACV,SAAS;AAAA,IACT,UAAU;AAAA,IACV,SAAS;AAAA,EACX,EAAE,KAAK;AAEP,SACE;AAAA,IAA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AAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;;;AD3VA,OAAOC,WAAU;AAkBJ,gBAAAC,YAAA;AAPN,IAAM,kBAAkB,CAAC;AAAA,EACH;AAAA,EACA,SAAS;AAAA,EACT,QAAQ;AAAA,EACR;AAAA,EACA,GAAG;AACL,MAA4B;AACrD,MAAI,OAAO,gBAAAA,KAAC,kBAAe,WAAU,iBAAe;AACpD,MAAI,eAAe;AACjB,QAAI,oBAAoB;AACxB,QAAI,QAAQ;AACV,0BAAoB,sBAAsB,SAAS,QAAQ;AAAA,IAC7D;AACA,WAAO,sBAAsB,QAAS,gBAAAA,KAAC,aAAU,WAAU,iBAAe,IACxE,gBAAAA,KAAC,eAAY,WAAU,iBAAe;AAAA,EAC1C;AAEA,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL;AAAA,MACA,WAAWD,MAAK,SAAS;AAAA,MACxB,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;","names":["SolidButton","clsx","jsx"]}
1
+ {"version":3,"sources":["../../../src/components/table/TableSortButton.tsx","../../../src/components/user-action/Button.tsx"],"sourcesContent":["import { ChevronDown, ChevronsUpDown, ChevronUp } from 'lucide-react'\nimport type { IconButtonProps } from '../user-action/Button'\nimport { IconButton } from '../user-action/Button'\nimport clsx from 'clsx'\nimport type { SortDirection } from '@tanstack/react-table'\n\nexport type TableSortButtonProps = IconButtonProps & {\n sortDirection: SortDirection | false,\n invert?: boolean,\n}\n\n/**\n * An Extension of the normal button that displays the sorting state right of the content\n */\nexport const TableSortButton = ({\n sortDirection,\n invert = false,\n color = 'neutral',\n className,\n ...buttonProps\n }: TableSortButtonProps) => {\n let icon = <ChevronsUpDown className=\"w-full h-full\"/>\n if (sortDirection) {\n let usedSortDirection = sortDirection\n if (invert) {\n usedSortDirection = usedSortDirection === 'desc' ? 'asc' : 'desc'\n }\n icon = usedSortDirection === 'asc' ? (<ChevronUp className=\"w-full h-full\"/>) : (\n <ChevronDown className=\"w-full h-full\"/>)\n }\n\n return (\n <IconButton\n size=\"tiny\"\n color={color}\n className={clsx(className)}\n {...buttonProps}\n >\n {icon}\n </IconButton>\n )\n}","import type { ButtonHTMLAttributes, PropsWithChildren, ReactNode } from 'react'\nimport { forwardRef } from 'react'\nimport clsx from 'clsx'\n\n\nexport const ButtonColorUtil = {\n solid: ['primary', 'secondary', 'tertiary', 'positive', 'warning', 'negative', 'neutral'] as const,\n text: ['primary', 'negative', 'neutral'] as const,\n outline: ['primary'] as const,\n}\n\nexport const IconButtonUtil = {\n icon: [...ButtonColorUtil.solid, 'transparent'] as const,\n}\n\n\n/**\n * The allowed colors for the SolidButton and IconButton\n */\nexport type SolidButtonColor = typeof ButtonColorUtil.solid[number]\n/**\n * The allowed colors for the OutlineButton\n */\nexport type OutlineButtonColor = typeof ButtonColorUtil.outline[number]\n/**\n * The allowed colors for the TextButton\n */\nexport type TextButtonColor = typeof ButtonColorUtil.text[number]\n/**\n * The allowed colors for the IconButton\n */\nexport type IconButtonColor = typeof IconButtonUtil.icon[number]\n\n\n/**\n * The different sizes for a button\n */\ntype ButtonSizes = 'small' | 'medium' | 'large'\n\ntype IconButtonSize = 'tiny' | 'small' | 'medium' | 'large'\n\n/**\n * The shard properties between all button types\n */\nexport type ButtonProps = PropsWithChildren<{\n /**\n * @default 'medium'\n */\n size?: ButtonSizes,\n}> & ButtonHTMLAttributes<Element>\n\nconst paddingMapping: Record<ButtonSizes, string> = {\n small: 'btn-sm',\n medium: 'btn-md',\n large: 'btn-lg'\n}\n\nconst iconPaddingMapping: Record<IconButtonSize, string> = {\n tiny: 'icon-btn-xs',\n small: 'icon-btn-sm',\n medium: 'icon-btn-md',\n large: 'icon-btn-lg'\n}\n\nexport const ButtonUtil = {\n paddingMapping,\n iconPaddingMapping\n}\n\ntype ButtonWithIconsProps = ButtonProps & {\n startIcon?: ReactNode,\n endIcon?: ReactNode,\n}\n\nexport type SolidButtonProps = ButtonWithIconsProps & {\n color?: SolidButtonColor,\n}\n\nexport type OutlineButtonProps = ButtonWithIconsProps & {\n color?: OutlineButtonColor,\n}\n\nexport type TextButtonProps = ButtonWithIconsProps & {\n color?: TextButtonColor,\n coloredHoverBackground?: boolean,\n}\n\n/**\n * The shard properties between all button types\n */\nexport type IconButtonProps = PropsWithChildren<{\n /**\n * @default 'medium'\n */\n size?: IconButtonSize,\n color?: IconButtonColor,\n}> & ButtonHTMLAttributes<Element>\n\n/**\n * A button with a solid background and different sizes\n */\nconst SolidButton = forwardRef<HTMLButtonElement, SolidButtonProps>(function SolidButton({\n children,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }, ref) {\n const colorClasses = {\n primary: 'not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text',\n secondary: 'not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text',\n tertiary: 'not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text',\n positive: 'not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text',\n warning: 'not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text',\n negative: 'not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text',\n neutral: 'not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'not-group-disabled:text-button-solid-primary-icon',\n secondary: 'not-group-disabled:text-button-solid-secondary-icon',\n tertiary: 'not-group-disabled:text-button-solid-tertiary-icon',\n positive: 'not-group-disabled:text-button-solid-positive-icon',\n warning: 'not-group-disabled:text-button-solid-warning-icon',\n negative: 'not-group-disabled:text-button-solid-negative-icon',\n neutral: 'not-group-disabled:text-button-solid-neutral-icon',\n }[color]\n\n return (\n <button\n ref={ref}\n onClick={onClick}\n className={clsx(\n 'group font-semibold',\n colorClasses,\n 'not-disabled:hover:brightness-90',\n 'disabled:text-disabled-text disabled:bg-disabled-background',\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n})\n\n/**\n * A button with an outline border and different sizes\n */\nconst OutlineButton = ({\n children,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: OutlineButtonProps) => {\n const colorClasses = {\n primary: 'not-disabled:border-button-outline-primary-text not-disabled:text-button-outline-primary-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'not-group-disabled:text-button-outline-primary-icon',\n }[color]\n return (\n <button\n onClick={onClick}\n className={clsx(\n 'group font-semibold bg-transparent border-2 ',\n 'not-disabled:hover:brightness-80',\n colorClasses,\n 'disabled:text-disabled-text disabled:border-disabled-outline',\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n/**\n * A text that is a button that can have different sizes\n */\nconst TextButton = ({\n children,\n color = 'neutral',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n coloredHoverBackground = true,\n className,\n ...restProps\n }: TextButtonProps) => {\n const colorClasses = {\n primary: 'not-disabled:bg-transparent not-disabled:text-button-text-primary-text',\n negative: 'not-disabled:bg-transparent not-disabled:text-button-text-negative-text',\n neutral: 'not-disabled:bg-transparent not-disabled:text-button-text-neutral-text',\n }[color]\n\n const backgroundColor = {\n primary: 'not-disabled:hover:bg-button-text-primary-text/20',\n negative: 'not-disabled:hover:bg-button-text-negative-text/20',\n neutral: 'not-disabled:hover:bg-button-text-neutral-text/20',\n }[color]\n\n const iconColorClasses = {\n primary: 'not-group-disabled:text-button-text-primary-icon',\n negative: 'not-group-disabled:text-button-text-negative-icon',\n neutral: 'not-group-disabled:text-button-text-neutral-icon',\n }[color]\n\n return (\n <button\n onClick={onClick}\n className={clsx(\n 'group font-semibold',\n 'disabled:text-disabled-text',\n colorClasses,\n {\n [backgroundColor]: coloredHoverBackground,\n 'not-disabled:hover:bg-button-text-hover-background': !coloredHoverBackground,\n },\n ButtonUtil.paddingMapping[size],\n className\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx(\n iconColorClasses,\n 'group-disabled:text-disabled-icon'\n )}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n\n/**\n * A button for icons with a solid background and different sizes\n */\nconst IconButton = ({\n children,\n color = 'primary',\n size = 'medium',\n className,\n ...restProps\n }: IconButtonProps) => {\n const colorClasses = {\n primary: 'not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text',\n secondary: 'not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text',\n tertiary: 'not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text',\n positive: 'not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text',\n warning: 'not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text',\n negative: 'not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text',\n neutral: 'not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text',\n transparent: 'not-disabled:bg-transparent',\n }[color]\n\n return (\n <button\n className={clsx(\n colorClasses,\n 'not-disabled:hover:brightness-90',\n 'disabled:text-disabled-text',\n {\n 'disabled:bg-disabled-background': color !== 'transparent',\n 'disabled:opacity-70': color === 'transparent',\n 'not-disabled:hover:bg-button-text-hover-background': color === 'transparent',\n },\n ButtonUtil.iconPaddingMapping[size],\n className\n )}\n {...restProps}\n >\n {children}\n </button>\n )\n}\n\nexport { SolidButton, OutlineButton, TextButton, IconButton }\n"],"mappings":";AAAA,SAAS,aAAa,gBAAgB,iBAAiB;;;ACCvD,SAAS,kBAAkB;AAC3B,OAAO,UAAU;AAkIb,SAcI,KAdJ;AA/HG,IAAM,kBAAkB;AAAA,EAC7B,OAAO,CAAC,WAAW,aAAa,YAAY,YAAY,WAAW,YAAY,SAAS;AAAA,EACxF,MAAM,CAAC,WAAW,YAAY,SAAS;AAAA,EACvC,SAAS,CAAC,SAAS;AACrB;AAEO,IAAM,iBAAiB;AAAA,EAC5B,MAAM,CAAC,GAAG,gBAAgB,OAAO,aAAa;AAChD;AAsCA,IAAM,iBAA8C;AAAA,EAClD,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AACT;AAEA,IAAM,qBAAqD;AAAA,EACzD,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AACT;AAEO,IAAM,aAAa;AAAA,EACxB;AAAA,EACA;AACF;AAkCA,IAAM,cAAc,WAAgD,SAASA,aAAY;AAAA,EACE;AAAA,EACA,QAAQ;AAAA,EACR,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAG,KAAK;AAC/F,QAAM,eAAe;AAAA,IACnB,SAAS;AAAA,IACT,WAAW;AAAA,IACX,UAAU;AAAA,IACV,UAAU;AAAA,IACV,SAAS;AAAA,IACT,UAAU;AAAA,IACV,SAAS;AAAA,EACX,EAAE,KAAK;AAEP,QAAM,mBAAmB;AAAA,IACvB,SAAS;AAAA,IACT,WAAW;AAAA,IACX,UAAU;AAAA,IACV,UAAU;AAAA,IACV,SAAS;AAAA,IACT,UAAU;AAAA,IACV,SAAS;AAAA,EACX,EAAE,KAAK;AAEP,SACE;AAAA,I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D,MAAI,eAAe;AACjB,QAAI,oBAAoB;AACxB,QAAI,QAAQ;AACV,0BAAoB,sBAAsB,SAAS,QAAQ;AAAA,IAC7D;AACA,WAAO,sBAAsB,QAAS,gBAAAA,KAAC,aAAU,WAAU,iBAAe,IACxE,gBAAAA,KAAC,eAAY,WAAU,iBAAe;AAAA,EAC1C;AAEA,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL;AAAA,MACA,WAAWD,MAAK,SAAS;AAAA,MACxB,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;","names":["SolidButton","clsx","jsx"]}
@@ -87,14 +87,14 @@ declare const SolidButton: react.ForwardRefExoticComponent<{
87
87
  /**
88
88
  * A button with an outline border and different sizes
89
89
  */
90
- declare const OutlineButton: ({ children, disabled, color, size, startIcon, endIcon, onClick, className, ...restProps }: OutlineButtonProps) => react_jsx_runtime.JSX.Element;
90
+ declare const OutlineButton: ({ children, color, size, startIcon, endIcon, onClick, className, ...restProps }: OutlineButtonProps) => react_jsx_runtime.JSX.Element;
91
91
  /**
92
92
  * A text that is a button that can have different sizes
93
93
  */
94
- declare const TextButton: ({ children, disabled, color, size, startIcon, endIcon, onClick, coloredHoverBackground, className, ...restProps }: TextButtonProps) => react_jsx_runtime.JSX.Element;
94
+ declare const TextButton: ({ children, color, size, startIcon, endIcon, onClick, coloredHoverBackground, className, ...restProps }: TextButtonProps) => react_jsx_runtime.JSX.Element;
95
95
  /**
96
96
  * A button for icons with a solid background and different sizes
97
97
  */
98
- declare const IconButton: ({ children, disabled, color, size, className, ...restProps }: IconButtonProps) => react_jsx_runtime.JSX.Element;
98
+ declare const IconButton: ({ children, color, size, className, ...restProps }: IconButtonProps) => react_jsx_runtime.JSX.Element;
99
99
 
100
100
  export { ButtonColorUtil, type ButtonProps, ButtonUtil, IconButton, type IconButtonColor, type IconButtonProps, IconButtonUtil, OutlineButton, type OutlineButtonColor, type OutlineButtonProps, SolidButton, type SolidButtonColor, type SolidButtonProps, TextButton, type TextButtonColor, type TextButtonProps };
@@ -87,14 +87,14 @@ declare const SolidButton: react.ForwardRefExoticComponent<{
87
87
  /**
88
88
  * A button with an outline border and different sizes
89
89
  */
90
- declare const OutlineButton: ({ children, disabled, color, size, startIcon, endIcon, onClick, className, ...restProps }: OutlineButtonProps) => react_jsx_runtime.JSX.Element;
90
+ declare const OutlineButton: ({ children, color, size, startIcon, endIcon, onClick, className, ...restProps }: OutlineButtonProps) => react_jsx_runtime.JSX.Element;
91
91
  /**
92
92
  * A text that is a button that can have different sizes
93
93
  */
94
- declare const TextButton: ({ children, disabled, color, size, startIcon, endIcon, onClick, coloredHoverBackground, className, ...restProps }: TextButtonProps) => react_jsx_runtime.JSX.Element;
94
+ declare const TextButton: ({ children, color, size, startIcon, endIcon, onClick, coloredHoverBackground, className, ...restProps }: TextButtonProps) => react_jsx_runtime.JSX.Element;
95
95
  /**
96
96
  * A button for icons with a solid background and different sizes
97
97
  */
98
- declare const IconButton: ({ children, disabled, color, size, className, ...restProps }: IconButtonProps) => react_jsx_runtime.JSX.Element;
98
+ declare const IconButton: ({ children, color, size, className, ...restProps }: IconButtonProps) => react_jsx_runtime.JSX.Element;
99
99
 
100
100
  export { ButtonColorUtil, type ButtonProps, ButtonUtil, IconButton, type IconButtonColor, type IconButtonProps, IconButtonUtil, OutlineButton, type OutlineButtonColor, type OutlineButtonProps, SolidButton, type SolidButtonColor, type SolidButtonProps, TextButton, type TextButtonColor, type TextButtonProps };