Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .bundlewatch.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"files": [
{
"path": "./packages/orange/dist/css/ouds-web-bootstrap.css",
"maxSize": "75.75 kB"
"maxSize": "77 kB"
},
{
"path": "./packages/orange/dist/css/ouds-web-bootstrap.min.css",
"maxSize": "72.25 kB"
"maxSize": "73.25 kB"
},
{
"path": "./packages/orange/dist/css/ouds-web-grid.css",
Expand Down Expand Up @@ -34,11 +34,11 @@
},
{
"path": "./packages/orange/dist/css/ouds-web.css",
"maxSize": "65.5 kB"
"maxSize": "66 kB"
},
{
"path": "./packages/orange/dist/css/ouds-web.min.css",
"maxSize": "61.75 kB"
"maxSize": "62 kB"
},
{
"path": "./dist/js/ouds-web.bundle.js",
Expand Down
5 changes: 5 additions & 0 deletions packages/orange-compact/scss/tokens/_component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ $ouds-button-space-padding-inline-end-icon-start: $ouds-space-padding-inline-3xl
$ouds-button-space-padding-inline-icon-none: $ouds-space-padding-inline-4xlarge !default;
$ouds-button-space-padding-inline-icon-start: $ouds-space-padding-inline-xlarge !default;
$ouds-button-space-padding-inline-start-icon-end: $ouds-space-padding-inline-3xlarge !default;
// Manually added tokens for AI button
$ouds-button-color-border-primary: var(--#{$prefix}color-border-brand-primary) !default;
$ouds-button-color-border-secondary: $core-orange-color-decorative-shocking-pink-200 !default;
$ouds-button-color-border-tertiary: $core-orange-color-decorative-amethyst-400 !default;
$ouds-button-color-border-quaternary: $core-orange-color-decorative-sky-400 !default;
// scss-docs-end ouds-component-button

// Checkbox
Expand Down
2 changes: 2 additions & 0 deletions packages/orange-compact/scss/tokens/_composite.scss
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ $select-input-expanded-chevron: url("data:image/svg+xml,<svg xmlns='http://www.w
$btn-previous-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='currentColor' viewBox='0 0 24 24'><path d='M14.023 4.875 6.75 12l7.273 7.125 2.079-2.035L10.905 12l5.197-5.088-2.079-2.037Z'/></svg>") !default;
// icon button next v1.4
$btn-next-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='currentColor' viewBox='0 0 24 24'><path d='M9.977 19.125 17.25 12 9.977 4.875 7.898 6.91 13.095 12l-5.197 5.088 2.079 2.037Z'/></svg>") !default;
// icon button ai v1.5
$btn-ai-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='currentColor' viewBox='0 0 24 24'><path d='M11.473 4.558c.157-.477.88-.477 1.038 0l.785 2.381c.7 2.122 2.479 3.788 4.754 4.442l2.55.734c.51.148.51.822 0 .97l-2.55.733c-2.27.654-4.054 2.316-4.754 4.442l-.785 2.383c-.158.476-.88.476-1.038 0l-.786-2.383c-.7-2.122-2.478-3.788-4.754-4.442l-2.55-.733a.499.499 0 0 1 0-.97l2.55-.734c2.271-.654 4.055-2.316 4.754-4.442l.786-2.381Zm-6.495.33c.041-.117.207-.117.244 0l.185.595c.163.533.577.947 1.11 1.11l.595.185c.117.04.117.207 0 .243l-.596.186a1.668 1.668 0 0 0-1.109 1.11l-.185.595c-.041.117-.208.117-.244 0l-.185-.596a1.667 1.667 0 0 0-1.11-1.109l-.595-.186c-.117-.04-.117-.207 0-.243l.595-.185a1.667 1.667 0 0 0 1.11-1.11l.185-.595Zm12.876-1.766c.054-.163.291-.163.345 0l.26.807c.233.72.82 1.283 1.571 1.506l.842.248a.17.17 0 0 1 0 .33l-.842.249a2.331 2.331 0 0 0-1.571 1.506l-.26.806c-.054.163-.29.163-.345 0l-.26-.806a2.333 2.333 0 0 0-1.57-1.506l-.843-.248a.171.171 0 0 1 0-.331l.842-.248a2.332 2.332 0 0 0 1.572-1.506l.26-.807Z'/></svg>") !default;

//// SVG used several times
$svg-as-custom-props: (
Expand Down
5 changes: 5 additions & 0 deletions packages/orange/scss/tokens/_component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ $ouds-button-space-padding-inline-end-icon-start: $ouds-space-padding-inline-3xl
$ouds-button-space-padding-inline-icon-none: $ouds-space-padding-inline-4xlarge !default;
$ouds-button-space-padding-inline-icon-start: $ouds-space-padding-inline-xlarge !default;
$ouds-button-space-padding-inline-start-icon-end: $ouds-space-padding-inline-3xlarge !default;
// Manually added tokens for AI button
$ouds-button-color-border-primary: var(--#{$prefix}color-border-brand-primary) !default;
$ouds-button-color-border-secondary: $core-orange-color-decorative-shocking-pink-200 !default;
$ouds-button-color-border-tertiary: $core-orange-color-decorative-amethyst-400 !default;
$ouds-button-color-border-quaternary: $core-orange-color-decorative-sky-400 !default;
// scss-docs-end ouds-component-button

// Checkbox
Expand Down
2 changes: 2 additions & 0 deletions packages/orange/scss/tokens/_composite.scss
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ $select-input-expanded-chevron: url("data:image/svg+xml,<svg xmlns='http://www.w
$btn-previous-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='currentColor' viewBox='0 0 24 24'><path d='M14.023 4.875 6.75 12l7.273 7.125 2.079-2.035L10.905 12l5.197-5.088-2.079-2.037Z'/></svg>") !default;
// icon button next v1.4
$btn-next-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='currentColor' viewBox='0 0 24 24'><path d='M9.977 19.125 17.25 12 9.977 4.875 7.898 6.91 13.095 12l-5.197 5.088 2.079 2.037Z'/></svg>") !default;
// icon button ai v1.5
$btn-ai-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='currentColor' viewBox='0 0 24 24'><path d='M11.473 4.558c.157-.477.88-.477 1.038 0l.785 2.381c.7 2.122 2.479 3.788 4.754 4.442l2.55.734c.51.148.51.822 0 .97l-2.55.733c-2.27.654-4.054 2.316-4.754 4.442l-.785 2.383c-.158.476-.88.476-1.038 0l-.786-2.383c-.7-2.122-2.478-3.788-4.754-4.442l-2.55-.733a.499.499 0 0 1 0-.97l2.55-.734c2.271-.654 4.055-2.316 4.754-4.442l.786-2.381Zm-6.495.33c.041-.117.207-.117.244 0l.185.595c.163.533.577.947 1.11 1.11l.595.185c.117.04.117.207 0 .243l-.596.186a1.668 1.668 0 0 0-1.109 1.11l-.185.595c-.041.117-.208.117-.244 0l-.185-.596a1.667 1.667 0 0 0-1.11-1.109l-.595-.186c-.117-.04-.117-.207 0-.243l.595-.185a1.667 1.667 0 0 0 1.11-1.11l.185-.595Zm12.876-1.766c.054-.163.291-.163.345 0l.26.807c.233.72.82 1.283 1.571 1.506l.842.248a.17.17 0 0 1 0 .33l-.842.249a2.331 2.331 0 0 0-1.571 1.506l-.26.806c-.054.163-.29.163-.345 0l-.26-.806a2.333 2.333 0 0 0-1.57-1.506l-.843-.248a.171.171 0 0 1 0-.331l.842-.248a2.332 2.332 0 0 0 1.572-1.506l.26-.807Z'/></svg>") !default;

//// SVG used several times
$svg-as-custom-props: (
Expand Down
2 changes: 2 additions & 0 deletions packages/sosh/scss/tokens/_component-colors-custom-props.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
@include color-mode(light, true) {
--#{$prefix}button-color-bg-brand-pressed: #{$core-sosh-color-magenta-500};
--#{$prefix}button-color-bg-brand-loading: #{$core-sosh-color-magenta-500};
--#{$prefix}button-color-border-quaternary: #{$core-ouds-color-opacity-black-680};
--#{$prefix}button-color-content-brand-pressed: #{$core-ouds-color-functional-white};
--#{$prefix}button-color-content-brand-loading: #{$core-ouds-color-functional-white};
--#{$prefix}button-mono-color-bg-default-hover: #{$core-ouds-color-opacity-black-680};
Expand Down Expand Up @@ -64,6 +65,7 @@
@include color-mode(dark, true) {
--#{$prefix}button-color-bg-brand-pressed: #{$core-sosh-color-blue-duck-light-800};
--#{$prefix}button-color-bg-brand-loading: #{$core-sosh-color-blue-duck-light-800};
--#{$prefix}button-color-border-quaternary: #{$core-ouds-color-opacity-white-200};
--#{$prefix}button-color-content-brand-pressed: #{$core-ouds-color-functional-black};
--#{$prefix}button-color-content-brand-loading: #{$core-ouds-color-functional-black};
--#{$prefix}button-mono-color-bg-default-hover: #{$core-ouds-color-opacity-white-800};
Expand Down
5 changes: 5 additions & 0 deletions packages/sosh/scss/tokens/_component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ $ouds-button-space-padding-inline-end-icon-start: $ouds-space-padding-inline-3xl
$ouds-button-space-padding-inline-icon-none: $ouds-space-padding-inline-4xlarge !default;
$ouds-button-space-padding-inline-icon-start: $ouds-space-padding-inline-xlarge !default;
$ouds-button-space-padding-inline-start-icon-end: $ouds-space-padding-inline-3xlarge !default;
// Manually added tokens for AI button
$ouds-button-color-border-primary: var(--#{$prefix}color-border-brand-secondary) !default;
$ouds-button-color-border-secondary: var(--#{$prefix}color-border-brand-primary) !default;
$ouds-button-color-border-tertiary: var(--#{$prefix}color-border-brand-tertiary) !default;
$ouds-button-color-border-quaternary: var(--#{$prefix}button-color-border-quaternary) !default;
// scss-docs-end ouds-component-button

// Checkbox
Expand Down
2 changes: 2 additions & 0 deletions packages/sosh/scss/tokens/_composite.scss
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ $select-input-expanded-chevron: url("data:image/svg+xml,<svg xmlns='http://www.w
$btn-previous-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='currentColor' viewBox='0 0 24 24'><path fill-rule='evenodd' d='M16.142 17.019c-.015-.015.018.015 0 0l-5.55-4.905 5.55-4.811c.618-.615.506-1.388 0-1.913-.015-.019.018.015 0 0-.566-.536-1.448-.506-2.037.008L7.397 11.21c-.552.48-.507 1.286 0 1.808l6.708 5.883c.717.717 1.545.574 2.037.094.491-.48.652-1.339 0-1.976Z' clip-rule='evenodd'/></svg>") !default;
// icon button next v1.4
$btn-next-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='currentColor' viewBox='0 0 24 24'><path fill-rule='evenodd' d='M7.431 7.378c-.019-.015.015.015 0 0l5.55 4.905-5.55 4.811c-.619.615-.506 1.388 0 1.913-.019-.015.015.019 0 0 .566.536 1.448.506 2.036-.008l6.709-5.812c.551-.48.506-1.286 0-1.808L9.467 5.496c-.716-.717-1.545-.574-2.036-.094-.491.48-.652 1.339 0 1.976Z' clip-rule='evenodd'/></svg>") !default;
// icon button ai v1.5
$btn-ai-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='currentColor' viewBox='0 0 24 24'><path d='M10.597 4.515c.566-1.13 2.19-1.097 2.71.056l1.178 2.618.028.071a.75.75 0 0 1-1.36.613l-.036-.068-1.178-2.618-2.22 4.437a1.5 1.5 0 0 1-.72.695l-5.072 2.305 4.57 2.436a1.5 1.5 0 0 1 .567.532l2.892 4.658 2.712-4.625c.143-.245.354-.444.606-.574l4.685-2.418-4.22-1.808a.75.75 0 0 1 .59-1.38l4.221 1.81c1.166.499 1.224 2.13.097 2.71l-4.685 2.419-2.712 4.625a1.5 1.5 0 0 1-2.568.032L7.79 16.384l-4.57-2.437c-1.096-.585-1.046-2.174.086-2.689l5.072-2.305 2.219-4.438Z'/><path d='M3.823 4.794a.75.75 0 0 1 1.34-.076l.388.678.678.387a.75.75 0 0 1-.076 1.34l-.602.259-.416.83a.75.75 0 0 1-1.341 0l-.415-.83-.552-.236a.75.75 0 0 1-.04-1.36l.778-.39.258-.602Zm.432.898a.75.75 0 0 1-.355.376l-.777.388.551.236a.75.75 0 0 1 .376.354l.415.83.415-.83a.75.75 0 0 1 .375-.354l.602-.258-.678-.387a.75.75 0 0 1-.279-.279l-.387-.678-.258.602Zm13.573-3.028a.75.75 0 0 1 1.314-.05l.81 1.35 1.261.63a.75.75 0 0 1 0 1.342l-1.26.63-.811 1.35a.75.75 0 0 1-1.314-.05l-.65-1.3-1.36-.618a.75.75 0 0 1 0-1.366l1.36-.618.65-1.3ZM17.85 4.3a.751.751 0 0 1-.36.347l-1.361.619 1.36.618a.75.75 0 0 1 .361.348l.65 1.3.81-1.35a.75.75 0 0 1 .308-.286l1.26-.63-1.26-.63a.75.75 0 0 1-.308-.285L18.5 3l-.65 1.3Z'/></svg>") !default;

//// SVG used several times
$svg-as-custom-props: (
Expand Down
60 changes: 51 additions & 9 deletions scss/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@

display: inline-flex; // OUDS mod: instead of `inline-block`
flex-shrink: 0;
gap: var(--#{$prefix}btn-icon-gap);
align-items: center; // OUDS mod
justify-content: center; // OUDS mod
min-width: var(--#{$prefix}btn-min-width); // OUDS mod
Expand Down Expand Up @@ -189,7 +190,6 @@
flex-shrink: 0;
width: 1em;
height: 1em;
margin-right: var(--#{$prefix}btn-icon-gap);
overflow: hidden;
font-size: var(--#{$prefix}btn-icon-size);
line-height: 1;
Expand Down Expand Up @@ -497,29 +497,23 @@
.btn-previous {
--#{$prefix}btn-padding-start: #{$ouds-button-space-padding-inline-chevron-start};
--#{$prefix}btn-padding-end: #{$ouds-button-space-padding-inline-end-icon-start};
--#{$prefix}btn-icon-gap: #{$ouds-button-space-column-gap-chevron};

&::before {
content: "";
mask-image: $btn-previous-icon;
}

&:not(.btn-icon)::before {
margin-right: $ouds-button-space-column-gap-chevron;
}
}

.btn-next {
--#{$prefix}btn-padding-start: #{$ouds-button-space-padding-inline-start-icon-end};
--#{$prefix}btn-padding-end: #{$ouds-button-space-padding-inline-chevron-end};
--#{$prefix}btn-icon-gap: #{$ouds-button-space-column-gap-chevron};

&::after {
content: "";
mask-image: $btn-next-icon;
}

&:not(.btn-icon)::after {
margin-left: $ouds-button-space-column-gap-chevron;
}
}

.btn-previous::before,
Expand All @@ -529,3 +523,51 @@
background-color: currentcolor;
}

// No transparency on the button
.btn-default.btn-ai:where(:not(:active, [class*="loading-"], :disabled, [aria-disabled="true"], .btn-on-colored-bg)) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the :where necessary here?

--#{$prefix}btn-bg: initial;

background: linear-gradient(var(--#{$prefix}btn-bg, var(--#{$prefix}color-bg-primary))) padding-box, conic-gradient($ouds-button-color-border-secondary 0deg 78deg, $ouds-button-color-border-tertiary 78deg 118deg, $ouds-button-color-border-quaternary 118deg 242deg, $ouds-button-color-border-primary 242deg 360deg) border-box;
background-origin: border-box;
border-color: transparent;

&.btn-icon {
background: linear-gradient(var(--#{$prefix}btn-bg, var(--#{$prefix}color-bg-primary))) padding-box, conic-gradient($ouds-button-color-border-secondary 0deg 72deg, $ouds-button-color-border-tertiary 72deg 144deg, $ouds-button-color-border-quaternary 144deg 216deg, $ouds-button-color-border-primary 216deg 360deg) border-box;
}
}

.btn-ai {
--#{$prefix}btn-padding-start: #{$ouds-button-space-padding-inline-icon-start};
--#{$prefix}btn-padding-end: #{$ouds-button-space-padding-inline-start-icon-end};

&:hover,
&:focus,
&:focus-visible,
&:active,
&:disabled,
&[aria-disabled="true"] {
.btn-ai-colored-icon {
display: none;
}
}

&.btn-default,
&.btn-strong:where(:not(:has(.btn-ai-colored-icon))),
&.btn-brand,
&.btn-minimal:where(:not(:has(.btn-ai-colored-icon))),
&.btn-negative,
&:hover,
&:focus,
&:focus-visible,
&:active,
&:disabled,
&[aria-disabled="true"] {
&::before {
width: var(--#{$prefix}btn-icon-size);
height: var(--#{$prefix}btn-icon-size);
content: "";
background-color: currentcolor;
mask-image: $btn-ai-icon;
}
}
Comment thread
louismaximepiton marked this conversation as resolved.
}
7 changes: 7 additions & 0 deletions site/data/components-details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ import { getConfig } from '@libs/config'
import { getVersionedDocsPath } from '@libs/path'

export const componentsDetails: ComponentCardData[] = [
{
name: 'AI button',
slug: 'ai-button',
link: 'buttons#ai-button',
category: 'Actions',
snippet: `<button type="button" class="btn btn-default btn-ai">Label</button>`
},
{
name: 'Alert message',
slug: 'alert-message',
Expand Down
Loading
Loading