design-zystem 1.0.268 → 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,15 +918,16 @@ 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;
925
925
  message?: string;
926
926
  action?: BannerAction;
927
927
  toggle?: BannerToggle;
928
+ children?: ReactNode;
928
929
  }
929
- declare const Banner: ({ variant, badge, title, subtitle, message, action, toggle, }: BannerProps) => react_jsx_runtime.JSX.Element;
930
+ declare const Banner: ({ variant, badge, title, subtitle, message, action, toggle, children, }: BannerProps) => react_jsx_runtime.JSX.Element;
930
931
 
931
932
  interface TooltipProps {
932
933
  children?: ReactNode;
package/dist/index.d.ts CHANGED
@@ -918,15 +918,16 @@ 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;
925
925
  message?: string;
926
926
  action?: BannerAction;
927
927
  toggle?: BannerToggle;
928
+ children?: ReactNode;
928
929
  }
929
- declare const Banner: ({ variant, badge, title, subtitle, message, action, toggle, }: BannerProps) => react_jsx_runtime.JSX.Element;
930
+ declare const Banner: ({ variant, badge, title, subtitle, message, action, toggle, children, }: BannerProps) => react_jsx_runtime.JSX.Element;
930
931
 
931
932
  interface TooltipProps {
932
933
  children?: ReactNode;
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%;
@@ -5234,9 +5246,20 @@ var Banner = ({
5234
5246
  subtitle,
5235
5247
  message,
5236
5248
  action,
5237
- toggle
5249
+ toggle,
5250
+ children
5238
5251
  }) => {
5239
- const style2 = variantStyles[variant];
5252
+ const style2 = resolveStyle(variant);
5253
+ if (children) {
5254
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
5255
+ StyledBanner,
5256
+ {
5257
+ $background: style2.background,
5258
+ $borderColor: style2.borderColor,
5259
+ children
5260
+ }
5261
+ );
5262
+ }
5240
5263
  return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
5241
5264
  StyledBanner,
5242
5265
  {
@@ -5261,12 +5284,12 @@ var Banner = ({
5261
5284
  {
5262
5285
  size: "s",
5263
5286
  weight: "700",
5264
- variant: toggle ? style2.action : void 0,
5287
+ color: toggle ? style2.accent : void 0,
5265
5288
  children: title
5266
5289
  }
5267
5290
  )
5268
5291
  ] }),
5269
- 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 })
5270
5293
  ] }) }),
5271
5294
  toggle ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
5272
5295
  Switch,
@@ -5274,14 +5297,14 @@ var Banner = ({
5274
5297
  checked: toggle.checked,
5275
5298
  onChange: toggle.onChange,
5276
5299
  disabled: toggle.disabled,
5277
- color: style2.switchColor
5300
+ color: style2.accent
5278
5301
  }
5279
5302
  ) : action && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
5280
5303
  Button,
5281
5304
  {
5282
5305
  outline: true,
5283
5306
  size: "xs",
5284
- variant: style2.action,
5307
+ variant: style2.accent,
5285
5308
  iconLeft: action.icon,
5286
5309
  label: action.label,
5287
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%;
@@ -5118,9 +5130,20 @@ var Banner = ({
5118
5130
  subtitle,
5119
5131
  message,
5120
5132
  action,
5121
- toggle
5133
+ toggle,
5134
+ children
5122
5135
  }) => {
5123
- const style2 = variantStyles[variant];
5136
+ const style2 = resolveStyle(variant);
5137
+ if (children) {
5138
+ return /* @__PURE__ */ jsx54(
5139
+ StyledBanner,
5140
+ {
5141
+ $background: style2.background,
5142
+ $borderColor: style2.borderColor,
5143
+ children
5144
+ }
5145
+ );
5146
+ }
5124
5147
  return /* @__PURE__ */ jsxs28(
5125
5148
  StyledBanner,
5126
5149
  {
@@ -5145,12 +5168,12 @@ var Banner = ({
5145
5168
  {
5146
5169
  size: "s",
5147
5170
  weight: "700",
5148
- variant: toggle ? style2.action : void 0,
5171
+ color: toggle ? style2.accent : void 0,
5149
5172
  children: title
5150
5173
  }
5151
5174
  )
5152
5175
  ] }),
5153
- 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 })
5154
5177
  ] }) }),
5155
5178
  toggle ? /* @__PURE__ */ jsx54(
5156
5179
  Switch,
@@ -5158,14 +5181,14 @@ var Banner = ({
5158
5181
  checked: toggle.checked,
5159
5182
  onChange: toggle.onChange,
5160
5183
  disabled: toggle.disabled,
5161
- color: style2.switchColor
5184
+ color: style2.accent
5162
5185
  }
5163
5186
  ) : action && /* @__PURE__ */ jsx54(
5164
5187
  Button,
5165
5188
  {
5166
5189
  outline: true,
5167
5190
  size: "xs",
5168
- variant: style2.action,
5191
+ variant: style2.accent,
5169
5192
  iconLeft: action.icon,
5170
5193
  label: action.label,
5171
5194
  onClick: action.onClick
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "design-zystem",
3
- "version": "1.0.268",
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",