@agregio-solutions/design-system 1.13.0 → 1.14.0

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.
@@ -107,14 +107,13 @@ See https://s-c.sh/2BAXzed for more info.`),window[Tr]+=1);function K1(e){return
107
107
  cursor: pointer;
108
108
  white-space: nowrap;
109
109
 
110
- // Remove default browser focus outline, we handle it differently via [data-focus-visible]
111
- &:focus {
112
- outline: none;
110
+ &[data-full-width] {
111
+ width: 100%;
113
112
  }
114
113
 
115
114
  // Manage hover state
116
115
  &[data-hovered],
117
- &[data-force-hover] {
116
+ &[data-force-hovered] {
118
117
  color: var(--hover-color);
119
118
  background: var(--hover-background-color);
120
119
  outline-color: var(--hover-border-color);
@@ -122,9 +121,9 @@ See https://s-c.sh/2BAXzed for more info.`),window[Tr]+=1);function K1(e){return
122
121
 
123
122
  // Manage keyboard focus state (and temporary active state as well)
124
123
  &:not([data-disabled])[data-pressed],
124
+ &:not([data-disabled])[data-force-pressed],
125
125
  &:not([data-disabled])[data-focus-visible],
126
- &:not([data-disabled])[data-force-active],
127
- &:not([data-disabled])[data-force-focus] {
126
+ &:not([data-disabled])[data-force-focus-visible] {
128
127
  color: var(--hover-color);
129
128
  background: var(--hover-background-color);
130
129
  outline-color: var(--hover-border-color);
@@ -134,6 +133,12 @@ See https://s-c.sh/2BAXzed for more info.`),window[Tr]+=1);function K1(e){return
134
133
  rgba(0, 0, 0, 0.05) 0px 1px 2px 0px;
135
134
  }
136
135
 
136
+ // Manage the main focus state
137
+ &not([data-disabled])[data-focused],
138
+ &not([data-disabled])[data-force-focused] {
139
+ outline: var(--border-color) solid 1px;
140
+ }
141
+
137
142
  // Manage the size variations
138
143
  &[data-size="small"] {
139
144
  padding: var(--spacing-xs) var(--spacing-sm);
@@ -326,11 +331,11 @@ See https://s-c.sh/2BAXzed for more info.`),window[Tr]+=1);function K1(e){return
326
331
  // Remove box-shadow and add text-decoration on hover/focus/active, but not for "action" buttons
327
332
  /* prettier-ignore */
328
333
  &[data-mode="tertiary"]:not([data-disabled]):not([data-nature="action"])[data-hovered],
329
- &[data-mode="tertiary"]:not([data-disabled]):not([data-nature="action"])[data-force-hover],
334
+ &[data-mode="tertiary"]:not([data-disabled]):not([data-nature="action"])[data-force-hovered],
330
335
  &[data-mode="tertiary"]:not([data-disabled]):not([data-nature="action"])[data-focus-visible],
331
- &[data-mode="tertiary"]:not([data-disabled]):not([data-nature="action"])[data-force-focus],
336
+ &[data-mode="tertiary"]:not([data-disabled]):not([data-nature="action"])[data-force-focus-visible],
332
337
  &[data-mode="tertiary"]:not([data-disabled]):not([data-nature="action"])[data-pressed],
333
- &[data-mode="tertiary"]:not([data-disabled]):not([data-nature="action"])[data-force-active] {
338
+ &[data-mode="tertiary"]:not([data-disabled]):not([data-nature="action"])[data-force-pressed] {
334
339
  box-shadow: none;
335
340
 
336
341
  ${Eu} {
@@ -360,7 +365,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Tr]+=1);function K1(e){return
360
365
  --hover-background-color: transparent;
361
366
  }
362
367
  }
363
- `;function et({text:e,mode:t="primary",size:r="medium",nature:n="action",iconLeft:o,iconRight:i,type:a,onClick:l,disabled:s,...c}){const d=e==null||e==="";if(d&&!o&&!i)throw new Error("You must provide a text or an icon");if(o&&i)throw new Error("You can't provide both an iconLeft and an iconRight");return v.jsxs(Yh,{...c,type:a||"button","data-size":r,"data-nature":n,"data-mode":t,"data-has-icon-left":!!o,"data-has-icon-right":!!i,"data-has-no-text":d,onPress:l,isDisabled:s,children:[!!o&&v.jsx(fa,{name:o,"data-size":r}),!d&&v.jsx(Eu,{"data-size":r,children:e}),!!i&&v.jsx(fa,{name:i,"data-size":r})]})}const Xh=K.span`
368
+ `;function et({text:e,mode:t="primary",size:r="medium",nature:n="action",iconLeft:o,iconRight:i,type:a,onClick:l,disabled:s,fullWidth:c,...d}){const p=e==null||e==="";if(p&&!o&&!i)throw new Error("You must provide a text or an icon");if(o&&i)throw new Error("You can't provide both an iconLeft and an iconRight");return v.jsxs(Yh,{...d,type:a||"button","data-size":r,"data-nature":n,"data-mode":t,"data-has-icon-left":!!o,"data-has-icon-right":!!i,"data-has-no-text":p,"data-full-width":c,onPress:l,isDisabled:s,children:[!!o&&v.jsx(fa,{name:o,"data-size":r}),!p&&v.jsx(Eu,{"data-size":r,children:e}),!!i&&v.jsx(fa,{name:i,"data-size":r})]})}const Xh=K.span`
364
369
  display: inline-flex;
365
370
  align-items: center;
366
371
  justify-content: center;
@@ -9364,14 +9364,13 @@ const nv = {
9364
9364
  cursor: pointer;
9365
9365
  white-space: nowrap;
9366
9366
 
9367
- // Remove default browser focus outline, we handle it differently via [data-focus-visible]
9368
- &:focus {
9369
- outline: none;
9367
+ &[data-full-width] {
9368
+ width: 100%;
9370
9369
  }
9371
9370
 
9372
9371
  // Manage hover state
9373
9372
  &[data-hovered],
9374
- &[data-force-hover] {
9373
+ &[data-force-hovered] {
9375
9374
  color: var(--hover-color);
9376
9375
  background: var(--hover-background-color);
9377
9376
  outline-color: var(--hover-border-color);
@@ -9379,9 +9378,9 @@ const nv = {
9379
9378
 
9380
9379
  // Manage keyboard focus state (and temporary active state as well)
9381
9380
  &:not([data-disabled])[data-pressed],
9381
+ &:not([data-disabled])[data-force-pressed],
9382
9382
  &:not([data-disabled])[data-focus-visible],
9383
- &:not([data-disabled])[data-force-active],
9384
- &:not([data-disabled])[data-force-focus] {
9383
+ &:not([data-disabled])[data-force-focus-visible] {
9385
9384
  color: var(--hover-color);
9386
9385
  background: var(--hover-background-color);
9387
9386
  outline-color: var(--hover-border-color);
@@ -9391,6 +9390,12 @@ const nv = {
9391
9390
  rgba(0, 0, 0, 0.05) 0px 1px 2px 0px;
9392
9391
  }
9393
9392
 
9393
+ // Manage the main focus state
9394
+ &not([data-disabled])[data-focused],
9395
+ &not([data-disabled])[data-force-focused] {
9396
+ outline: var(--border-color) solid 1px;
9397
+ }
9398
+
9394
9399
  // Manage the size variations
9395
9400
  &[data-size="small"] {
9396
9401
  padding: var(--spacing-xs) var(--spacing-sm);
@@ -9583,11 +9588,11 @@ const nv = {
9583
9588
  // Remove box-shadow and add text-decoration on hover/focus/active, but not for "action" buttons
9584
9589
  /* prettier-ignore */
9585
9590
  &[data-mode="tertiary"]:not([data-disabled]):not([data-nature="action"])[data-hovered],
9586
- &[data-mode="tertiary"]:not([data-disabled]):not([data-nature="action"])[data-force-hover],
9591
+ &[data-mode="tertiary"]:not([data-disabled]):not([data-nature="action"])[data-force-hovered],
9587
9592
  &[data-mode="tertiary"]:not([data-disabled]):not([data-nature="action"])[data-focus-visible],
9588
- &[data-mode="tertiary"]:not([data-disabled]):not([data-nature="action"])[data-force-focus],
9593
+ &[data-mode="tertiary"]:not([data-disabled]):not([data-nature="action"])[data-force-focus-visible],
9589
9594
  &[data-mode="tertiary"]:not([data-disabled]):not([data-nature="action"])[data-pressed],
9590
- &[data-mode="tertiary"]:not([data-disabled]):not([data-nature="action"])[data-force-active] {
9595
+ &[data-mode="tertiary"]:not([data-disabled]):not([data-nature="action"])[data-force-pressed] {
9591
9596
  box-shadow: none;
9592
9597
 
9593
9598
  ${Ru} {
@@ -9628,29 +9633,31 @@ function vt({
9628
9633
  type: a,
9629
9634
  onClick: l,
9630
9635
  disabled: s,
9631
- ...c
9636
+ fullWidth: c,
9637
+ ...u
9632
9638
  }) {
9633
- const u = e == null || e === "";
9634
- if (u && !o && !i)
9639
+ const f = e == null || e === "";
9640
+ if (f && !o && !i)
9635
9641
  throw new Error("You must provide a text or an icon");
9636
9642
  if (o && i)
9637
9643
  throw new Error("You can't provide both an iconLeft and an iconRight");
9638
9644
  return /* @__PURE__ */ re(
9639
9645
  lv,
9640
9646
  {
9641
- ...c,
9647
+ ...u,
9642
9648
  type: a || "button",
9643
9649
  "data-size": r,
9644
9650
  "data-nature": n,
9645
9651
  "data-mode": t,
9646
9652
  "data-has-icon-left": !!o,
9647
9653
  "data-has-icon-right": !!i,
9648
- "data-has-no-text": u,
9654
+ "data-has-no-text": f,
9655
+ "data-full-width": c,
9649
9656
  onPress: l,
9650
9657
  isDisabled: s,
9651
9658
  children: [
9652
9659
  !!o && /* @__PURE__ */ g($a, { name: o, "data-size": r }),
9653
- !u && /* @__PURE__ */ g(Ru, { "data-size": r, children: e }),
9660
+ !f && /* @__PURE__ */ g(Ru, { "data-size": r, children: e }),
9654
9661
  !!i && /* @__PURE__ */ g($a, { name: i, "data-size": r })
9655
9662
  ]
9656
9663
  }
@@ -37,5 +37,9 @@ export type Props = Omit<ButtonProps, "onPress" | "isDisabled" | "children"> & {
37
37
  * Same as native "disabled" attribute.
38
38
  */
39
39
  disabled?: boolean;
40
+ /**
41
+ * Set full width to the button
42
+ */
43
+ fullWidth?: boolean;
40
44
  };
41
- export default function Button({ text, mode, size, nature, iconLeft, iconRight, type, onClick, disabled, ...reactAriaButtonProps }: Props): import("react/jsx-runtime").JSX.Element;
45
+ export default function Button({ text, mode, size, nature, iconLeft, iconRight, type, onClick, disabled, fullWidth, ...reactAriaButtonProps }: Props): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agregio-solutions/design-system",
3
- "version": "1.13.0",
3
+ "version": "1.14.0",
4
4
  "description": "React Component library and Storybook that is part of the Design System for Agregio Solutions",
5
5
  "type": "module",
6
6
  "module": "dist/design-system.js",