design-zystem 1.0.269 → 1.0.270

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/index.d.mts CHANGED
@@ -918,7 +918,7 @@ interface BannerToggle {
918
918
  disabled?: boolean;
919
919
  }
920
920
  interface BannerProps {
921
- variant?: 'blue' | 'red';
921
+ variant?: string;
922
922
  badge?: string;
923
923
  title?: string;
924
924
  subtitle?: string;
package/dist/index.d.ts CHANGED
@@ -918,7 +918,7 @@ interface BannerToggle {
918
918
  disabled?: boolean;
919
919
  }
920
920
  interface BannerProps {
921
- variant?: 'blue' | 'red';
921
+ variant?: string;
922
922
  badge?: string;
923
923
  title?: string;
924
924
  subtitle?: string;
package/dist/index.js CHANGED
@@ -5186,24 +5186,36 @@ var Card2 = ({
5186
5186
  // src/Components/Banner/Banner.tsx
5187
5187
  var import_styled_components45 = __toESM(require("styled-components"));
5188
5188
  var import_jsx_runtime54 = require("react/jsx-runtime");
5189
- var variantStyles = {
5189
+ var PRESET_STYLES = {
5190
5190
  blue: {
5191
5191
  background: "rgba(219, 233, 254, 0.4)",
5192
5192
  borderColor: "#BEDBFF",
5193
5193
  badgeBackground: colors.badge_blue_bg,
5194
5194
  badgeColor: colors.badge_blue_text,
5195
- action: "blue_950",
5196
- switchColor: colors.blue_950
5195
+ accent: colors.blue_950
5197
5196
  },
5198
5197
  red: {
5199
5198
  background: "rgba(252, 221, 222, 0.4)",
5200
5199
  borderColor: "#FFD2D2",
5201
5200
  badgeBackground: "#FCDDDE",
5202
5201
  badgeColor: colors.red_950,
5203
- action: "red_950",
5204
- switchColor: colors.red_950
5202
+ accent: colors.red_950
5205
5203
  }
5206
5204
  };
5205
+ var resolveStyle = (variant) => {
5206
+ const preset = PRESET_STYLES[variant];
5207
+ if (preset) return preset;
5208
+ return {
5209
+ background: `${variant}14`,
5210
+ // ~8 %
5211
+ borderColor: `${variant}40`,
5212
+ // ~25 %
5213
+ badgeBackground: `${variant}24`,
5214
+ // ~14 %
5215
+ badgeColor: variant,
5216
+ accent: variant
5217
+ };
5218
+ };
5207
5219
  var StyledBanner = import_styled_components45.default.div`
5208
5220
  box-sizing: border-box;
5209
5221
  width: 100%;
@@ -5237,7 +5249,7 @@ var Banner = ({
5237
5249
  toggle,
5238
5250
  children
5239
5251
  }) => {
5240
- const style2 = variantStyles[variant];
5252
+ const style2 = resolveStyle(variant);
5241
5253
  if (children) {
5242
5254
  return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
5243
5255
  StyledBanner,
@@ -5272,12 +5284,12 @@ var Banner = ({
5272
5284
  {
5273
5285
  size: "s",
5274
5286
  weight: "700",
5275
- variant: toggle ? style2.action : void 0,
5287
+ color: toggle ? style2.accent : void 0,
5276
5288
  children: title
5277
5289
  }
5278
5290
  )
5279
5291
  ] }),
5280
- subtitle && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Text, { size: "xs", variant: toggle ? style2.action : void 0, children: subtitle })
5292
+ subtitle && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Text, { size: "xs", color: toggle ? style2.accent : void 0, children: subtitle })
5281
5293
  ] }) }),
5282
5294
  toggle ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
5283
5295
  Switch,
@@ -5285,14 +5297,14 @@ var Banner = ({
5285
5297
  checked: toggle.checked,
5286
5298
  onChange: toggle.onChange,
5287
5299
  disabled: toggle.disabled,
5288
- color: style2.switchColor
5300
+ color: style2.accent
5289
5301
  }
5290
5302
  ) : action && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
5291
5303
  Button,
5292
5304
  {
5293
5305
  outline: true,
5294
5306
  size: "xs",
5295
- variant: style2.action,
5307
+ variant: style2.accent,
5296
5308
  iconLeft: action.icon,
5297
5309
  label: action.label,
5298
5310
  onClick: action.onClick
package/dist/index.mjs CHANGED
@@ -5070,24 +5070,36 @@ var Card2 = ({
5070
5070
  // src/Components/Banner/Banner.tsx
5071
5071
  import styled45 from "styled-components";
5072
5072
  import { Fragment as Fragment7, jsx as jsx54, jsxs as jsxs28 } from "react/jsx-runtime";
5073
- var variantStyles = {
5073
+ var PRESET_STYLES = {
5074
5074
  blue: {
5075
5075
  background: "rgba(219, 233, 254, 0.4)",
5076
5076
  borderColor: "#BEDBFF",
5077
5077
  badgeBackground: colors.badge_blue_bg,
5078
5078
  badgeColor: colors.badge_blue_text,
5079
- action: "blue_950",
5080
- switchColor: colors.blue_950
5079
+ accent: colors.blue_950
5081
5080
  },
5082
5081
  red: {
5083
5082
  background: "rgba(252, 221, 222, 0.4)",
5084
5083
  borderColor: "#FFD2D2",
5085
5084
  badgeBackground: "#FCDDDE",
5086
5085
  badgeColor: colors.red_950,
5087
- action: "red_950",
5088
- switchColor: colors.red_950
5086
+ accent: colors.red_950
5089
5087
  }
5090
5088
  };
5089
+ var resolveStyle = (variant) => {
5090
+ const preset = PRESET_STYLES[variant];
5091
+ if (preset) return preset;
5092
+ return {
5093
+ background: `${variant}14`,
5094
+ // ~8 %
5095
+ borderColor: `${variant}40`,
5096
+ // ~25 %
5097
+ badgeBackground: `${variant}24`,
5098
+ // ~14 %
5099
+ badgeColor: variant,
5100
+ accent: variant
5101
+ };
5102
+ };
5091
5103
  var StyledBanner = styled45.div`
5092
5104
  box-sizing: border-box;
5093
5105
  width: 100%;
@@ -5121,7 +5133,7 @@ var Banner = ({
5121
5133
  toggle,
5122
5134
  children
5123
5135
  }) => {
5124
- const style2 = variantStyles[variant];
5136
+ const style2 = resolveStyle(variant);
5125
5137
  if (children) {
5126
5138
  return /* @__PURE__ */ jsx54(
5127
5139
  StyledBanner,
@@ -5156,12 +5168,12 @@ var Banner = ({
5156
5168
  {
5157
5169
  size: "s",
5158
5170
  weight: "700",
5159
- variant: toggle ? style2.action : void 0,
5171
+ color: toggle ? style2.accent : void 0,
5160
5172
  children: title
5161
5173
  }
5162
5174
  )
5163
5175
  ] }),
5164
- subtitle && /* @__PURE__ */ jsx54(Text, { size: "xs", variant: toggle ? style2.action : void 0, children: subtitle })
5176
+ subtitle && /* @__PURE__ */ jsx54(Text, { size: "xs", color: toggle ? style2.accent : void 0, children: subtitle })
5165
5177
  ] }) }),
5166
5178
  toggle ? /* @__PURE__ */ jsx54(
5167
5179
  Switch,
@@ -5169,14 +5181,14 @@ var Banner = ({
5169
5181
  checked: toggle.checked,
5170
5182
  onChange: toggle.onChange,
5171
5183
  disabled: toggle.disabled,
5172
- color: style2.switchColor
5184
+ color: style2.accent
5173
5185
  }
5174
5186
  ) : action && /* @__PURE__ */ jsx54(
5175
5187
  Button,
5176
5188
  {
5177
5189
  outline: true,
5178
5190
  size: "xs",
5179
- variant: style2.action,
5191
+ variant: style2.accent,
5180
5192
  iconLeft: action.icon,
5181
5193
  label: action.label,
5182
5194
  onClick: action.onClick
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "design-zystem",
3
- "version": "1.0.269",
3
+ "version": "1.0.270",
4
4
  "description": "A React design system of importable components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",