reshaped 2.3.2 → 2.4.1
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/CHANGELOG.md +7 -0
- package/bundle.css +1 -1
- package/bundle.d.ts +2 -0
- package/bundle.js +10 -10
- package/components/Autocomplete/Autocomplete.types.d.ts +0 -1
- package/components/Button/Button.module.css +1 -1
- package/components/Card/Card.module.css +1 -1
- package/components/Checkbox/Checkbox.js +2 -3
- package/components/Checkbox/Checkbox.module.css +1 -1
- package/components/Radio/Radio.js +1 -2
- package/components/Table/Table.d.ts +11 -0
- package/components/Table/Table.js +45 -0
- package/components/Table/Table.module.css +1 -0
- package/components/Table/Table.types.d.ts +38 -0
- package/components/Table/Table.types.js +1 -0
- package/components/Table/index.d.ts +2 -0
- package/components/Table/index.js +1 -0
- package/components/Table/tests/Table.stories.d.ts +10 -0
- package/components/Table/tests/Table.stories.js +194 -0
- package/components/Tabs/Tabs.types.d.ts +1 -0
- package/components/Tabs/TabsContext.d.ts +1 -0
- package/components/Tabs/TabsControlled.js +2 -0
- package/components/Tabs/TabsItem.js +17 -1
- package/components/Tabs/TabsList.js +2 -3
- package/components/Toast/ToastContainer.js +0 -1
- package/components/View/View.js +1 -1
- package/components/View/View.module.css +1 -1
- package/components/View/View.types.d.ts +2 -2
- package/components/View/tests/View.stories.js +12 -0
- package/index.d.ts +2 -0
- package/index.js +1 -0
- package/package.json +1 -1
- package/styles/minWidth/index.d.ts +3 -0
- package/styles/minWidth/index.js +10 -0
- package/styles/minWidth/minWidth.module.css +1 -0
- package/utilities/helpers.d.ts +0 -1
@@ -1 +1 @@
|
|
1
|
-
.root{-webkit-tap-highlight-color:transparent;align-items:center;border:var(--rs-button-border-width) solid transparent;border-radius:var(--rs-button-radius);box-sizing:border-box;cursor:pointer;display:inline-flex;font-family:var(--rs-font-family-body);font-size:var(--rs-button-font-size);font-weight:var(--rs-font-weight-medium);justify-content:center;line-height:var(--rs-button-line-height);min-height:calc(var(--rs-button-line-height) + var(--rs-button-padding-v) * 2);min-width:calc(var(--rs-button-line-height) - (var(--rs-unit-x1) * 2) + (var(--rs-button-padding-h) * 2));overflow:hidden;padding:calc(var(--rs-button-padding-v) - var(--rs-button-border-width)) calc(var(--rs-button-padding-h) - var(--rs-button-border-width));position:relative;text-align:initial;text-decoration:none;transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:background-color,box-shadow,border-color,color,transform;z-index:0}.root:active{transform:scale(.98)}.loader{align-items:center;display:none;inset:0;justify-content:center;position:absolute}.icon{margin-inline-end:var(--rs-button-icon-gap)}.icon.--icon-position-end{margin-inline-end:0;margin-inline-start:var(--rs-button-icon-gap)}.icon:last-child{margin-inline-end:0}.icon,.text{position:relative;z-index:5}.root.--loading{cursor:default}.root.--loading:active{transform:none}.root.--loading .icon,.root.--loading .text{visibility:hidden}.root.--loading .loader{display:flex}.--elevated{box-shadow:var(--rs-shadow-raised)}.root.--icon-only .icon{margin:0 calc(var(--rs-unit-x1) * -1)}.root.--rounded{border-radius:999px}.--size-small{--rs-button-padding-v:var(--rs-unit-x1);--rs-button-padding-h:var(--rs-unit-x2);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x1);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3);--rs-button-radius:var(--rs-unit-radius-small)}.--size-medium{--rs-button-padding-v:var(--rs-unit-x2);--rs-button-padding-h:var(--rs-unit-x3);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3);--rs-button-radius:var(--rs-unit-radius-small)}.--size-large{--rs-button-padding-v:var(--rs-unit-x3);--rs-button-padding-h:var(--rs-unit-x4);--rs-button-padding-h-ghost:var(--rs-unit-x3);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2);--rs-button-radius:var(--rs-unit-radius-medium)}.--size-xlarge{--rs-button-padding-v:var(--rs-unit-x4);--rs-button-padding-h:var(--rs-unit-x5);--rs-button-padding-h-ghost:var(--rs-unit-x4);--rs-button-icon-gap:var(--rs-unit-x3);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2);--rs-button-radius:var(--rs-unit-radius-medium)}.--full-width{text-align:center;width:100%}.root.--variant-faded.--color-critical:before,.root.--variant-faded.--color-inherit:before,.root.--variant-faded.--color-neutral:before,.root.--variant-faded.--color-positive:before,.root.--variant-faded.--color-primary:before,.root.--variant-ghost.--color-inherit:before,.root.--variant-outline.--color-inherit:before,.root.--variant-solid.--color-black:before,.root.--variant-solid.--color-white:before{content:"";inset:0;opacity:0;position:absolute;transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:opacity}.root.--variant-solid{--rs-button-border-width:0px}.root.--variant-solid.--color-neutral{background-color:var(--rs-color-background-neutral);color:var(--rs-color-foreground-neutral)}.root.--variant-solid.--color-neutral.--highlighted,.root.--variant-solid.--color-neutral:hover:not(.--loading){background-color:var(--rs-color-background-neutral-highlighted)}.root.--variant-solid.--color-primary{background-color:var(--rs-color-background-primary);color:var(--rs-color-on-background-primary)}.root.--variant-solid.--color-primary.--highlighted,.root.--variant-solid.--color-primary:hover:not(.--loading){background-color:var(--rs-color-background-primary-highlighted)}.root.--variant-solid.--color-critical{background-color:var(--rs-color-background-critical);color:var(--rs-color-on-background-critical)}.root.--variant-solid.--color-critical.--highlighted,.root.--variant-solid.--color-critical:hover:not(.--loading){background-color:var(--rs-color-background-critical-highlighted)}.root.--variant-solid.--color-positive{background-color:var(--rs-color-background-positive);color:var(--rs-color-on-background-positive)}.root.--variant-solid.--color-positive.--highlighted,.root.--variant-solid.--color-positive:hover:not(.--loading){background-color:var(--rs-color-background-positive-highlighted)}.root.--variant-solid.--color-white{background-color:var(--rs-color-white);color:var(--rs-color-black)}.root.--variant-solid.--color-white:before{background-color:var(--rs-color-black)}.root.--variant-solid.--color-white.--highlighted:before,.root.--variant-solid.--color-white:hover:not(.--loading):before{opacity:.04}.root.--variant-solid.--color-black{background-color:var(--rs-color-black);color:var(--rs-color-white)}.root.--variant-solid.--color-black:before{background-color:var(--rs-color-white)}.root.--variant-solid.--color-black.--highlighted:before,.root.--variant-solid.--color-black:hover:not(.--loading):before{opacity:.2}.root.--variant-faded{--rs-button-border-width:0px}.root.--variant-faded.--color-neutral{--rs-button-border-width:1px;background-color:var(--rs-color-background-elevation-base);border-color:var(--rs-color-border-neutral-faded);color:var(--rs-color-foreground-neutral)}.root.--variant-faded.--color-neutral:before{background-color:var(--rs-color-foreground-neutral)}.root.--variant-faded.--color-neutral.--highlighted:before,.root.--variant-faded.--color-neutral:hover:not(.--loading):before{opacity:.04}.root.--variant-faded.--color-primary{background-color:var(--rs-color-background-primary-faded);color:var(--rs-color-foreground-primary)}.root.--variant-faded.--color-primary:before{background-color:var(--rs-color-foreground-primary)}.root.--variant-faded.--color-primary.--highlighted:before,.root.--variant-faded.--color-primary:hover:not(.--loading):before{opacity:.06}.root.--variant-faded.--color-critical{background-color:var(--rs-color-background-critical-faded);color:var(--rs-color-foreground-critical)}.root.--variant-faded.--color-critical:before{background-color:var(--rs-color-foreground-critical)}.root.--variant-faded.--color-critical.--highlighted:before,.root.--variant-faded.--color-critical:hover:not(.--loading):before{opacity:.06}.root.--variant-faded.--color-positive{background-color:var(--rs-color-background-positive-faded);color:var(--rs-color-foreground-positive)}.root.--variant-faded.--color-positive:before{background-color:var(--rs-color-foreground-positive)}.root.--variant-faded.--color-positive.--highlighted:before,.root.--variant-faded.--color-positive:hover:not(.--loading):before{opacity:.06}.root.--variant-faded.--color-inherit{color:inherit}.root.--variant-faded.--color-inherit:before{background-color:currentcolor;opacity:.16}.root.--variant-faded.--color-inherit.--highlighted:before,.root.--variant-faded.--color-inherit:hover:not(.--loading):before{opacity:.24}.root.--variant-faded.--color-black{background-color:rgba(var(--rs-color-rgb-black),28%);color:var(--rs-color-white)}.root.--variant-faded.--color-black.--highlighted,.root.--variant-faded.--color-black:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-black),36%)}.root.--variant-faded.--color-white{background-color:rgba(var(--rs-color-rgb-white),28%);color:var(--rs-color-black)}.root.--variant-faded.--color-white.--highlighted,.root.--variant-faded.--color-white:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-white),36%)}.root.--variant-outline{--rs-button-border-width:1px}.root.--variant-outline.--color-neutral{background-color:transparent;border-color:var(--rs-color-border-neutral);color:var(--rs-color-foreground-neutral)}.root.--variant-outline.--color-neutral.--highlighted,.root.--variant-outline.--color-neutral:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-neutral),28%)}.root.--variant-outline.--color-primary{background-color:transparent;border-color:var(--rs-color-border-primary);color:var(--rs-color-foreground-primary)}.root.--variant-outline.--color-primary.--highlighted,.root.--variant-outline.--color-primary:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-primary),10%)}.root.--variant-outline.--color-critical{background-color:transparent;border-color:var(--rs-color-border-critical);color:var(--rs-color-foreground-critical)}.root.--variant-outline.--color-critical.--highlighted,.root.--variant-outline.--color-critical:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-critical),10%)}.root.--variant-outline.--color-positive{background-color:transparent;border-color:var(--rs-color-border-positive);color:var(--rs-color-foreground-positive)}.root.--variant-outline.--color-positive.--highlighted,.root.--variant-outline.--color-positive:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-positive),10%)}.root.--variant-outline.--color-white{background-color:transparent;border-color:var(--rs-color-white);color:var(--rs-color-white)}.root.--variant-outline.--color-white.--highlighted,.root.--variant-outline.--color-white:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-white),12%)}.root.--variant-outline.--color-black{background-color:transparent;border-color:var(--rs-color-black);color:var(--rs-color-black)}.root.--variant-outline.--color-black.--highlighted,.root.--variant-outline.--color-black:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-black),4%)}.root.--variant-outline.--color-inherit{background-color:transparent;border-color:currentcolor;color:inherit}.root.--variant-outline.--color-inherit:before{background-color:currentcolor;content:"";inset:0;opacity:0;position:absolute;transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:opacity}.root.--variant-outline.--color-inherit.--highlighted,.root.--variant-outline.--color-inherit:hover:not(.--loading){background-color:transparent}.root.--variant-outline.--color-inherit.--highlighted:before,.root.--variant-outline.--color-inherit:hover:not(.--loading):before{opacity:.1}.root.--variant-ghost{--rs-button-border-width:0px;padding-left:var(--rs-button-padding-h-ghost);padding-right:var(--rs-button-padding-h-ghost)}.root.--variant-ghost.--color-neutral{background:transparent;color:var(--rs-color-foreground-neutral)}.root.--variant-ghost.--color-neutral.--highlighted,.root.--variant-ghost.--color-neutral:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-neutral),40%)}.root.--variant-ghost.--color-primary{background:transparent;color:var(--rs-color-foreground-primary)}.root.--variant-ghost.--color-primary.--highlighted,.root.--variant-ghost.--color-primary:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-primary),12%)}.root.--variant-ghost.--color-critical{background:transparent;color:var(--rs-color-foreground-critical)}.root.--variant-ghost.--color-critical.--highlighted,.root.--variant-ghost.--color-critical:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-critical),12%)}.root.--variant-ghost.--color-positive{background:transparent;color:var(--rs-color-foreground-positive)}.root.--variant-ghost.--color-positive.--highlighted,.root.--variant-ghost.--color-positive:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-positive),12%)}.root.--variant-ghost.--color-white{background:transparent;color:var(--rs-color-white)}.root.--variant-ghost.--color-white.--highlighted,.root.--variant-ghost.--color-white:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-white),8%)}.root.--variant-ghost.--color-black{background:transparent;color:var(--rs-color-black)}.root.--variant-ghost.--color-black.--highlighted,.root.--variant-ghost.--color-black:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-black),8%)}.root.--variant-ghost.--color-inherit{background-color:transparent;color:inherit}.root.--variant-ghost.--color-inherit:before{background-color:currentcolor}.root.--variant-ghost.--color-inherit.--highlighted,.root.--variant-ghost.--color-inherit:hover:not(.--loading){background-color:transparent}.root.--variant-ghost.--color-inherit.--highlighted:before,.root.--variant-ghost.--color-inherit:hover:not(.--loading):before{opacity:.08}.root.--disabled,.root.--disabled:hover:not(.--loading){background-color:var(--rs-color-background-disabled)!important;border-color:var(--rs-color-border-disabled)!important;color:var(--rs-color-foreground-disabled)!important}.root.--disabled:before,.root.--disabled:hover:not(.--loading):before{opacity:0!important}.root.--disabled.--variant-faded,.root.--disabled:hover:not(.--loading).--variant-faded{background-color:var(--rs-color-background-disabled-faded)!important}.root.--disabled.--variant-outline,.root.--disabled:hover:not(.--loading).--variant-outline{background-color:transparent!important}.root.--disabled.--variant-ghost,.root.--disabled:hover:not(.--loading).--variant-ghost{background-color:transparent!important;border-color:transparent!important}.root.--disabled:active,.root.--disabled:hover:not(.--loading):active{transform:none!important}.group .root{border-radius:0}.group .root:first-child{border-end-start-radius:var(--rs-button-radius);border-start-start-radius:var(--rs-button-radius)}.group .root:not(:first-child){border-inline-start:1px solid var(--rs-button-group-separator-color)}.group .root:last-child{border-end-end-radius:var(--rs-button-radius);border-start-end-radius:var(--rs-button-radius)}.group .root.--variant-solid.--color-neutral{--rs-button-group-separator-color:var(--rs-color-border-neutral)}.group .root.--variant-ghost.--color-neutral{--rs-button-group-separator-color:var(--rs-color-border-neutral-faded)}.group .root.--variant-solid.--color-positive{--rs-button-group-separator-color:var(--rs-color-border-positive)}.group .root.--variant-ghost.--color-positive{--rs-button-group-separator-color:var(--rs-color-border-positive-faded)}.group .root.--variant-solid.--color-critical{--rs-button-group-separator-color:var(--rs-color-border-critical)}.group .root.--variant-ghost.--color-critical{--rs-button-group-separator-color:var(--rs-color-border-critical-faded)}.group .root.--variant-solid.--color-primary{--rs-button-group-separator-color:var(--rs-color-border-primary)}.group .root.--variant-ghost.--color-primary{--rs-button-group-separator-color:var(--rs-color-border-primary-faded)}.group .root.--variant-faded.--color-positive{--rs-button-group-separator-color:var(--rs-color-border-positive-faded)}.group .root.--variant-faded.--color-critical{--rs-button-group-separator-color:var(--rs-color-border-critical-faded)}.group .root.--variant-faded.--color-primary{--rs-button-group-separator-color:var(--rs-color-border-primary-faded)}.group .root.--variant-solid.--color-black{--rs-button-group-separator-color:rgba(var(--rs-color-rgb-white),0.28)}.group .root.--variant-faded.--color-black{--rs-button-group-separator-color:rgba(var(--rs-color-rgb-white),0.14)}.group .root.--variant-faded.--color-white,.group .root.--variant-ghost.--color-black,.group .root.--variant-solid.--color-white{--rs-button-group-separator-color:rgba(var(--rs-color-rgb-black),0.2)}.group .root.--variant-ghost.--color-white{--rs-button-group-separator-color:rgba(var(--rs-color-rgb-white),0.28)}.aligner{line-height:0}.aligner.--aligner-position-all .root{margin:calc(var(--rs-button-padding-v) * -1) calc(var(--rs-button-padding-h) * -1)}.aligner.--aligner-position-start .root{margin-inline-start:calc(var(--rs-button-padding-h) * -1)}.aligner.--aligner-position-end .root{margin-inline-end:calc(var(--rs-button-padding-h) * -1)}.aligner.--aligner-position-top .root{margin-top:calc(var(--rs-button-padding-v) * -1)}.aligner.--aligner-position-bottom .root{margin-bottom:calc(var(--rs-button-padding-v) * -1)}@media (min-width:660px){.--size-small--m{--rs-button-padding-v:var(--rs-unit-x1);--rs-button-padding-h:var(--rs-unit-x2);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x1);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3);--rs-button-radius:var(--rs-unit-radius-small)}.--size-medium--m{--rs-button-padding-v:var(--rs-unit-x2);--rs-button-padding-h:var(--rs-unit-x3);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3);--rs-button-radius:var(--rs-unit-radius-small)}.--size-large--m{--rs-button-padding-v:var(--rs-unit-x3);--rs-button-padding-h:var(--rs-unit-x4);--rs-button-padding-h-ghost:var(--rs-unit-x3);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2);--rs-button-radius:var(--rs-unit-radius-medium)}.--size-xlarge--m{--rs-button-padding-v:var(--rs-unit-x4);--rs-button-padding-h:var(--rs-unit-x5);--rs-button-padding-h-ghost:var(--rs-unit-x4);--rs-button-icon-gap:var(--rs-unit-x3);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2);--rs-button-radius:var(--rs-unit-radius-medium)}.--full-width-true--m{text-align:center;width:100%}.--full-width-false--m{text-align:initial;width:auto}}@media (min-width:900px){.--size-small--l{--rs-button-padding-v:var(--rs-unit-x1);--rs-button-padding-h:var(--rs-unit-x2);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x1);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3);--rs-button-radius:var(--rs-unit-radius-small)}.--size-medium--l{--rs-button-padding-v:var(--rs-unit-x2);--rs-button-padding-h:var(--rs-unit-x3);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3);--rs-button-radius:var(--rs-unit-radius-small)}.--size-large--l{--rs-button-padding-v:var(--rs-unit-x3);--rs-button-padding-h:var(--rs-unit-x4);--rs-button-padding-h-ghost:var(--rs-unit-x3);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2);--rs-button-radius:var(--rs-unit-radius-medium)}.--size-xlarge--l{--rs-button-padding-v:var(--rs-unit-x4);--rs-button-padding-h:var(--rs-unit-x5);--rs-button-padding-h-ghost:var(--rs-unit-x4);--rs-button-icon-gap:var(--rs-unit-x3);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2);--rs-button-radius:var(--rs-unit-radius-medium)}.--full-width-true--l{text-align:center;width:100%}.--full-width-false--l{text-align:initial;width:auto}}@media (min-width:1280px){.--size-small--xl{--rs-button-padding-v:var(--rs-unit-x1);--rs-button-padding-h:var(--rs-unit-x2);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x1);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3);--rs-button-radius:var(--rs-unit-radius-small)}.--size-medium--xl{--rs-button-padding-v:var(--rs-unit-x2);--rs-button-padding-h:var(--rs-unit-x3);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3);--rs-button-radius:var(--rs-unit-radius-small)}.--size-large--xl{--rs-button-padding-v:var(--rs-unit-x3);--rs-button-padding-h:var(--rs-unit-x4);--rs-button-padding-h-ghost:var(--rs-unit-x3);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2);--rs-button-radius:var(--rs-unit-radius-medium)}.--size-xlarge--xl{--rs-button-padding-v:var(--rs-unit-x4);--rs-button-padding-h:var(--rs-unit-x5);--rs-button-padding-h-ghost:var(--rs-unit-x4);--rs-button-icon-gap:var(--rs-unit-x3);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2);--rs-button-radius:var(--rs-unit-radius-medium)}.--full-width-true--xl{text-align:center;width:100%}.--full-width-false--xl{text-align:initial;width:auto}}
|
1
|
+
.root{-webkit-tap-highlight-color:transparent;align-items:center;border:var(--rs-button-border-width) solid transparent;border-radius:var(--rs-button-radius);box-sizing:border-box;cursor:pointer;display:inline-flex;font-family:var(--rs-font-family-body);font-size:var(--rs-button-font-size);font-weight:var(--rs-font-weight-medium);justify-content:center;line-height:var(--rs-button-line-height);min-height:calc(var(--rs-button-line-height) + var(--rs-button-padding-v) * 2);min-width:calc(var(--rs-button-line-height) - (var(--rs-unit-x1) * 2) + (var(--rs-button-padding-h) * 2));overflow:hidden;padding:calc(var(--rs-button-padding-v) - var(--rs-button-border-width)) calc(var(--rs-button-padding-h) - var(--rs-button-border-width));position:relative;text-align:initial;text-decoration:none;transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:background-color,box-shadow,border-color,color,transform;z-index:0}.root:active{transform:scale(.98)}.loader{align-items:center;display:none;inset:0;justify-content:center;position:absolute}.icon{margin-inline-end:var(--rs-button-icon-gap)}.icon.--icon-position-end{margin-inline-end:0;margin-inline-start:var(--rs-button-icon-gap)}.icon:last-child{margin-inline-end:0}.icon,.text{position:relative;z-index:5}.root.--loading{cursor:default}.root.--loading:active{transform:none}.root.--loading .icon,.root.--loading .text{visibility:hidden}.root.--loading .loader{display:flex}.--elevated{box-shadow:var(--rs-shadow-raised)}.root.--icon-only .icon{margin:0 calc(var(--rs-unit-x1) * -1)}.root.--rounded{border-radius:999px}.--size-small{--rs-button-padding-v:var(--rs-unit-x1);--rs-button-padding-h:var(--rs-unit-x2);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x1);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3);--rs-button-radius:var(--rs-unit-radius-small)}.--size-medium{--rs-button-padding-v:var(--rs-unit-x2);--rs-button-padding-h:var(--rs-unit-x3);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3);--rs-button-radius:var(--rs-unit-radius-small)}.--size-large{--rs-button-padding-v:var(--rs-unit-x3);--rs-button-padding-h:var(--rs-unit-x4);--rs-button-padding-h-ghost:var(--rs-unit-x3);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2);--rs-button-radius:var(--rs-unit-radius-medium)}.--size-xlarge{--rs-button-padding-v:var(--rs-unit-x4);--rs-button-padding-h:var(--rs-unit-x5);--rs-button-padding-h-ghost:var(--rs-unit-x4);--rs-button-icon-gap:var(--rs-unit-x3);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2);--rs-button-radius:var(--rs-unit-radius-medium)}.--full-width{text-align:center;width:100%}.root.--variant-faded.--color-critical:before,.root.--variant-faded.--color-inherit:before,.root.--variant-faded.--color-neutral:before,.root.--variant-faded.--color-positive:before,.root.--variant-faded.--color-primary:before,.root.--variant-ghost.--color-inherit:before,.root.--variant-outline.--color-inherit:before,.root.--variant-solid.--color-black:before,.root.--variant-solid.--color-white:before{content:"";inset:0;opacity:0;position:absolute;transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:opacity}.root.--variant-solid{--rs-button-border-width:0px}.root.--variant-solid.--color-neutral{background-color:var(--rs-color-background-neutral);color:var(--rs-color-foreground-neutral)}.root.--variant-solid.--color-neutral.--highlighted,.root.--variant-solid.--color-neutral:hover:not(.--loading){background-color:var(--rs-color-background-neutral-highlighted)}.root.--variant-solid.--color-primary{background-color:var(--rs-color-background-primary);color:var(--rs-color-on-background-primary)}.root.--variant-solid.--color-primary.--highlighted,.root.--variant-solid.--color-primary:hover:not(.--loading){background-color:var(--rs-color-background-primary-highlighted)}.root.--variant-solid.--color-critical{background-color:var(--rs-color-background-critical);color:var(--rs-color-on-background-critical)}.root.--variant-solid.--color-critical.--highlighted,.root.--variant-solid.--color-critical:hover:not(.--loading){background-color:var(--rs-color-background-critical-highlighted)}.root.--variant-solid.--color-positive{background-color:var(--rs-color-background-positive);color:var(--rs-color-on-background-positive)}.root.--variant-solid.--color-positive.--highlighted,.root.--variant-solid.--color-positive:hover:not(.--loading){background-color:var(--rs-color-background-positive-highlighted)}.root.--variant-solid.--color-white{background-color:var(--rs-color-white);color:var(--rs-color-black)}.root.--variant-solid.--color-white:before{background-color:var(--rs-color-black)}.root.--variant-solid.--color-white.--highlighted:before,.root.--variant-solid.--color-white:hover:not(.--loading):before{opacity:.04}.root.--variant-solid.--color-black{background-color:var(--rs-color-black);color:var(--rs-color-white)}.root.--variant-solid.--color-black:before{background-color:var(--rs-color-white)}.root.--variant-solid.--color-black.--highlighted:before,.root.--variant-solid.--color-black:hover:not(.--loading):before{opacity:.2}.root.--variant-faded{--rs-button-border-width:0px}.root.--variant-faded.--color-neutral{--rs-button-border-width:1px;background-color:var(--rs-color-background-elevation-base);border-color:var(--rs-color-border-neutral-faded);color:var(--rs-color-foreground-neutral)}.root.--variant-faded.--color-neutral:before{background-color:var(--rs-color-foreground-neutral)}.root.--variant-faded.--color-neutral.--highlighted:before,.root.--variant-faded.--color-neutral:hover:not(.--loading):before{opacity:.04}.root.--variant-faded.--color-primary{background-color:var(--rs-color-background-primary-faded);color:var(--rs-color-foreground-primary)}.root.--variant-faded.--color-primary:before{background-color:var(--rs-color-foreground-primary)}.root.--variant-faded.--color-primary.--highlighted:before,.root.--variant-faded.--color-primary:hover:not(.--loading):before{opacity:.06}.root.--variant-faded.--color-critical{background-color:var(--rs-color-background-critical-faded);color:var(--rs-color-foreground-critical)}.root.--variant-faded.--color-critical:before{background-color:var(--rs-color-foreground-critical)}.root.--variant-faded.--color-critical.--highlighted:before,.root.--variant-faded.--color-critical:hover:not(.--loading):before{opacity:.06}.root.--variant-faded.--color-positive{background-color:var(--rs-color-background-positive-faded);color:var(--rs-color-foreground-positive)}.root.--variant-faded.--color-positive:before{background-color:var(--rs-color-foreground-positive)}.root.--variant-faded.--color-positive.--highlighted:before,.root.--variant-faded.--color-positive:hover:not(.--loading):before{opacity:.06}.root.--variant-faded.--color-inherit{color:inherit}.root.--variant-faded.--color-inherit:before{background-color:currentcolor;opacity:.16}.root.--variant-faded.--color-inherit.--highlighted:before,.root.--variant-faded.--color-inherit:hover:not(.--loading):before{opacity:.24}.root.--variant-faded.--color-black{background-color:rgba(var(--rs-color-rgb-black),28%);color:var(--rs-color-white)}.root.--variant-faded.--color-black.--highlighted,.root.--variant-faded.--color-black:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-black),36%)}.root.--variant-faded.--color-white{background-color:rgba(var(--rs-color-rgb-white),28%);color:var(--rs-color-black)}.root.--variant-faded.--color-white.--highlighted,.root.--variant-faded.--color-white:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-white),36%)}.root.--variant-outline{--rs-button-border-width:1px}.root.--variant-outline.--color-neutral{background-color:transparent;border-color:var(--rs-color-border-neutral);color:var(--rs-color-foreground-neutral)}.root.--variant-outline.--color-neutral.--highlighted,.root.--variant-outline.--color-neutral:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-neutral),28%)}.root.--variant-outline.--color-primary{background-color:transparent;border-color:var(--rs-color-border-primary);color:var(--rs-color-foreground-primary)}.root.--variant-outline.--color-primary.--highlighted,.root.--variant-outline.--color-primary:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-primary),10%)}.root.--variant-outline.--color-critical{background-color:transparent;border-color:var(--rs-color-border-critical);color:var(--rs-color-foreground-critical)}.root.--variant-outline.--color-critical.--highlighted,.root.--variant-outline.--color-critical:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-critical),10%)}.root.--variant-outline.--color-positive{background-color:transparent;border-color:var(--rs-color-border-positive);color:var(--rs-color-foreground-positive)}.root.--variant-outline.--color-positive.--highlighted,.root.--variant-outline.--color-positive:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-positive),10%)}.root.--variant-outline.--color-white{background-color:transparent;border-color:var(--rs-color-white);color:var(--rs-color-white)}.root.--variant-outline.--color-white.--highlighted,.root.--variant-outline.--color-white:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-white),12%)}.root.--variant-outline.--color-black{background-color:transparent;border-color:var(--rs-color-black);color:var(--rs-color-black)}.root.--variant-outline.--color-black.--highlighted,.root.--variant-outline.--color-black:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-black),4%)}.root.--variant-outline.--color-inherit{background-color:transparent;border-color:currentcolor;color:inherit}.root.--variant-outline.--color-inherit:before{background-color:currentcolor;content:"";inset:0;opacity:0;position:absolute;transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:opacity}.root.--variant-outline.--color-inherit.--highlighted,.root.--variant-outline.--color-inherit:hover:not(.--loading){background-color:transparent}.root.--variant-outline.--color-inherit.--highlighted:before,.root.--variant-outline.--color-inherit:hover:not(.--loading):before{opacity:.1}.root.--variant-ghost{--rs-button-border-width:0px;padding-left:var(--rs-button-padding-h-ghost);padding-right:var(--rs-button-padding-h-ghost)}.root.--variant-ghost.--color-neutral{background:transparent;color:var(--rs-color-foreground-neutral)}.root.--variant-ghost.--color-neutral.--highlighted,.root.--variant-ghost.--color-neutral:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-neutral),40%)}.root.--variant-ghost.--color-primary{background:transparent;color:var(--rs-color-foreground-primary)}.root.--variant-ghost.--color-primary.--highlighted,.root.--variant-ghost.--color-primary:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-primary),12%)}.root.--variant-ghost.--color-critical{background:transparent;color:var(--rs-color-foreground-critical)}.root.--variant-ghost.--color-critical.--highlighted,.root.--variant-ghost.--color-critical:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-critical),12%)}.root.--variant-ghost.--color-positive{background:transparent;color:var(--rs-color-foreground-positive)}.root.--variant-ghost.--color-positive.--highlighted,.root.--variant-ghost.--color-positive:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-positive),12%)}.root.--variant-ghost.--color-white{background:transparent;color:var(--rs-color-white)}.root.--variant-ghost.--color-white.--highlighted,.root.--variant-ghost.--color-white:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-white),8%)}.root.--variant-ghost.--color-black{background:transparent;color:var(--rs-color-black)}.root.--variant-ghost.--color-black.--highlighted,.root.--variant-ghost.--color-black:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-black),8%)}.root.--variant-ghost.--color-inherit{background-color:transparent;color:inherit}.root.--variant-ghost.--color-inherit:before{background-color:currentcolor}.root.--variant-ghost.--color-inherit.--highlighted,.root.--variant-ghost.--color-inherit:hover:not(.--loading){background-color:transparent}.root.--variant-ghost.--color-inherit.--highlighted:before,.root.--variant-ghost.--color-inherit:hover:not(.--loading):before{opacity:.08}.root.--disabled,.root.--disabled:hover:not(.--loading){background-color:var(--rs-color-background-disabled)!important;border-color:var(--rs-color-border-disabled)!important;color:var(--rs-color-foreground-disabled)!important}.root.--disabled:before,.root.--disabled:hover:not(.--loading):before{opacity:0!important}.root.--disabled.--variant-faded,.root.--disabled:hover:not(.--loading).--variant-faded{background-color:var(--rs-color-background-disabled-faded)!important}.root.--disabled.--variant-outline,.root.--disabled:hover:not(.--loading).--variant-outline{background-color:transparent!important}.root.--disabled.--variant-ghost,.root.--disabled:hover:not(.--loading).--variant-ghost{background-color:transparent!important;border-color:transparent!important}.root.--disabled:active,.root.--disabled:hover:not(.--loading):active{transform:none!important}.group .root{border-radius:0}.group .root:first-child{border-end-start-radius:var(--rs-button-radius);border-start-start-radius:var(--rs-button-radius)}.group .root:not(:first-child){border-inline-start:1px solid var(--rs-button-group-separator-color)}.group .root:last-child{border-end-end-radius:var(--rs-button-radius);border-start-end-radius:var(--rs-button-radius)}.group .root.--variant-solid.--color-neutral{--rs-button-group-separator-color:var(--rs-color-border-neutral)}.group .root.--variant-ghost.--color-neutral{--rs-button-group-separator-color:var(--rs-color-border-neutral-faded)}.group .root.--variant-solid.--color-positive{--rs-button-group-separator-color:var(--rs-color-border-positive)}.group .root.--variant-ghost.--color-positive{--rs-button-group-separator-color:var(--rs-color-border-positive-faded)}.group .root.--variant-solid.--color-critical{--rs-button-group-separator-color:var(--rs-color-border-critical)}.group .root.--variant-ghost.--color-critical{--rs-button-group-separator-color:var(--rs-color-border-critical-faded)}.group .root.--variant-solid.--color-primary{--rs-button-group-separator-color:var(--rs-color-border-primary)}.group .root.--variant-ghost.--color-primary{--rs-button-group-separator-color:var(--rs-color-border-primary-faded)}.group .root.--variant-faded.--color-positive{--rs-button-group-separator-color:var(--rs-color-border-positive-faded)}.group .root.--variant-faded.--color-critical{--rs-button-group-separator-color:var(--rs-color-border-critical-faded)}.group .root.--variant-faded.--color-primary{--rs-button-group-separator-color:var(--rs-color-border-primary-faded)}.group .root.--variant-solid.--color-black{--rs-button-group-separator-color:rgba(var(--rs-color-rgb-white),0.28)}.group .root.--variant-faded.--color-black{--rs-button-group-separator-color:rgba(var(--rs-color-rgb-white),0.14)}.group .root.--variant-faded.--color-white,.group .root.--variant-ghost.--color-black,.group .root.--variant-solid.--color-white{--rs-button-group-separator-color:rgba(var(--rs-color-rgb-black),0.2)}.group .root.--variant-ghost.--color-white{--rs-button-group-separator-color:rgba(var(--rs-color-rgb-white),0.28)}.aligner{line-height:0}.aligner.--aligner-position-all .root{margin:calc(var(--rs-button-padding-v) * -1) calc(var(--rs-button-padding-h) * -1)}.aligner.--aligner-position-all .root.--variant-ghost{margin-inline:calc(var(--rs-button-padding-h-ghost) * -1)}.aligner.--aligner-position-start .root{margin-inline-start:calc(var(--rs-button-padding-h) * -1)}.aligner.--aligner-position-start .root.--variant-ghost{margin-inline-start:calc(var(--rs-button-padding-h-ghost) * -1)}.aligner.--aligner-position-end .root{margin-inline-end:calc(var(--rs-button-padding-h) * -1)}.aligner.--aligner-position-end .root.--variant-ghost{margin-inline-end:calc(var(--rs-button-padding-h-ghost) * -1)}.aligner.--aligner-position-top .root{margin-top:calc(var(--rs-button-padding-v) * -1)}.aligner.--aligner-position-bottom .root{margin-bottom:calc(var(--rs-button-padding-v) * -1)}@media (min-width:660px){.--size-small--m{--rs-button-padding-v:var(--rs-unit-x1);--rs-button-padding-h:var(--rs-unit-x2);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x1);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3);--rs-button-radius:var(--rs-unit-radius-small)}.--size-medium--m{--rs-button-padding-v:var(--rs-unit-x2);--rs-button-padding-h:var(--rs-unit-x3);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3);--rs-button-radius:var(--rs-unit-radius-small)}.--size-large--m{--rs-button-padding-v:var(--rs-unit-x3);--rs-button-padding-h:var(--rs-unit-x4);--rs-button-padding-h-ghost:var(--rs-unit-x3);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2);--rs-button-radius:var(--rs-unit-radius-medium)}.--size-xlarge--m{--rs-button-padding-v:var(--rs-unit-x4);--rs-button-padding-h:var(--rs-unit-x5);--rs-button-padding-h-ghost:var(--rs-unit-x4);--rs-button-icon-gap:var(--rs-unit-x3);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2);--rs-button-radius:var(--rs-unit-radius-medium)}.--full-width-true--m{text-align:center;width:100%}.--full-width-false--m{text-align:initial;width:auto}}@media (min-width:900px){.--size-small--l{--rs-button-padding-v:var(--rs-unit-x1);--rs-button-padding-h:var(--rs-unit-x2);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x1);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3);--rs-button-radius:var(--rs-unit-radius-small)}.--size-medium--l{--rs-button-padding-v:var(--rs-unit-x2);--rs-button-padding-h:var(--rs-unit-x3);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3);--rs-button-radius:var(--rs-unit-radius-small)}.--size-large--l{--rs-button-padding-v:var(--rs-unit-x3);--rs-button-padding-h:var(--rs-unit-x4);--rs-button-padding-h-ghost:var(--rs-unit-x3);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2);--rs-button-radius:var(--rs-unit-radius-medium)}.--size-xlarge--l{--rs-button-padding-v:var(--rs-unit-x4);--rs-button-padding-h:var(--rs-unit-x5);--rs-button-padding-h-ghost:var(--rs-unit-x4);--rs-button-icon-gap:var(--rs-unit-x3);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2);--rs-button-radius:var(--rs-unit-radius-medium)}.--full-width-true--l{text-align:center;width:100%}.--full-width-false--l{text-align:initial;width:auto}}@media (min-width:1280px){.--size-small--xl{--rs-button-padding-v:var(--rs-unit-x1);--rs-button-padding-h:var(--rs-unit-x2);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x1);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3);--rs-button-radius:var(--rs-unit-radius-small)}.--size-medium--xl{--rs-button-padding-v:var(--rs-unit-x2);--rs-button-padding-h:var(--rs-unit-x3);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3);--rs-button-radius:var(--rs-unit-radius-small)}.--size-large--xl{--rs-button-padding-v:var(--rs-unit-x3);--rs-button-padding-h:var(--rs-unit-x4);--rs-button-padding-h-ghost:var(--rs-unit-x3);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2);--rs-button-radius:var(--rs-unit-radius-medium)}.--size-xlarge--xl{--rs-button-padding-v:var(--rs-unit-x4);--rs-button-padding-h:var(--rs-unit-x5);--rs-button-padding-h-ghost:var(--rs-unit-x4);--rs-button-icon-gap:var(--rs-unit-x3);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2);--rs-button-radius:var(--rs-unit-radius-medium)}.--full-width-true--xl{text-align:center;width:100%}.--full-width-false--xl{text-align:initial;width:auto}}
|
@@ -1 +1 @@
|
|
1
|
-
.root{background:var(--rs-color-background-elevation-base);border:1px solid var(--rs-color-border-neutral-faded);color:var(--rs-color-foreground-neutral);display:block;overflow:hidden;text-align:initial}.content,.root{position:relative}.content{z-index:var(--rs-z-index-raised)}.--selected{border-color:transparent;box-shadow:0 0 0 2px var(--rs-color-border-primary)}.--elevated{background:var(--rs-color-background-elevation-raised);box-shadow:var(--rs-shadow-raised)}.--actionable:not(.--selected){color:inherit;cursor:pointer;outline:none;text-decoration:none}[data-rs-keyboard] .--actionable:not(.--selected):focus{box-shadow:var(--rs-focus-shadow)}.--actionable:not(.--selected):before{background:rgba(var(--rs-color-rgb-background-neutral-faded),40%);content:"";inset:0;opacity:0;pointer-events:none;position:absolute;transition:opacity var(--rs-duration-fast) var(--rs-easing-standard)}.--actionable:not(.--selected):hover:before{opacity:1}
|
1
|
+
.root{background:var(--rs-color-background-elevation-base);border:1px solid var(--rs-color-border-neutral-faded);color:var(--rs-color-foreground-neutral);display:block;overflow:hidden;text-align:initial;transition:var(--rs-duration-fast) var(--rs-easing-accelerate);transition-property:box-shadow,border-color}.content,.root{position:relative}.content{z-index:var(--rs-z-index-raised)}.--selected{border-color:transparent;box-shadow:0 0 0 2px var(--rs-color-border-primary);transition-timing-function:var(--rs-easing-decelerate)}.--elevated{background:var(--rs-color-background-elevation-raised);box-shadow:var(--rs-shadow-raised)}.--actionable:not(.--selected){color:inherit;cursor:pointer;outline:none;text-decoration:none}[data-rs-keyboard] .--actionable:not(.--selected):focus{box-shadow:var(--rs-focus-shadow)}.--actionable:not(.--selected):before{background:rgba(var(--rs-color-rgb-background-neutral-faded),40%);content:"";inset:0;opacity:0;pointer-events:none;position:absolute;transition:opacity var(--rs-duration-fast) var(--rs-easing-standard)}.--actionable:not(.--selected):hover:before{opacity:1}
|
@@ -19,7 +19,6 @@ const Checkbox = (props) => {
|
|
19
19
|
const defaultChecked = checkboxGroup ? undefined : props.defaultChecked;
|
20
20
|
const name = checkboxGroup ? checkboxGroup.name : props.name;
|
21
21
|
const inputRef = React.useRef(null);
|
22
|
-
const TagName = children ? "label" : "span";
|
23
22
|
const rootClassName = classNames(s.root, className, hasError && s["--error"], disabled && s["--disabled"]);
|
24
23
|
const handleChange = (event) => {
|
25
24
|
if (!name)
|
@@ -33,8 +32,8 @@ const Checkbox = (props) => {
|
|
33
32
|
};
|
34
33
|
useIsomorphicLayoutEffect(() => {
|
35
34
|
inputRef.current.indeterminate = indeterminate || false;
|
36
|
-
}, [indeterminate]);
|
37
|
-
return (React.createElement(
|
35
|
+
}, [indeterminate, checked]);
|
36
|
+
return (React.createElement("label", Object.assign({}, attributes, { className: rootClassName }),
|
38
37
|
React.createElement("span", { className: s.field },
|
39
38
|
React.createElement(HiddenInput, { className: s.input, type: "checkbox", checked: checked, defaultChecked: defaultChecked, name: name, disabled: disabled, value: value, onChange: handleChange, onFocus: onFocus, onBlur: onBlur, attributes: Object.assign(Object.assign({}, inputAttributes), { ref: inputRef }) }),
|
40
39
|
React.createElement("div", { className: s.decorator },
|
@@ -1 +1 @@
|
|
1
|
-
.root{-webkit-tap-highlight-color:transparent;align-items:center;cursor:pointer;display:inline-flex;gap:var(--rs-unit-x2);-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:top}.root:hover .decorator{background:var(--rs-color-background-neutral-faded)}.field{position:relative}.decorator{background:var(--rs-color-background-elevation-base);border:1px solid var(--rs-color-border-neutral);border-radius:var(--rs-unit-radius-small);height:var(--rs-line-height-body-3);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:background-color,border-color;width:var(--rs-line-height-body-3)}.icon{left:50%;opacity:0;position:absolute;top:50%;transform:translate(-50%,-50%) scale(0);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:opacity,transform}[data-rs-keyboard] .input:focus+.decorator{box-shadow:var(--rs-focus-shadow)}.input:indeterminate+.decorator,.root.--error .input:indeterminate+.decorator,.root.--error:hover .input:indeterminate+.decorator,.root:hover .input:indeterminate+.decorator{background:var(--rs-color-background-primary);border-color:var(--rs-color-background-primary)}.input:indeterminate+.decorator:before,.root.--error .input:indeterminate+.decorator:before,.root.--error:hover .input:indeterminate+.decorator:before,.root:hover .input:indeterminate+.decorator:before{
|
1
|
+
.root{-webkit-tap-highlight-color:transparent;align-items:center;cursor:pointer;display:inline-flex;gap:var(--rs-unit-x2);-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:top}.root:hover .decorator{background:var(--rs-color-background-neutral-faded)}.field{position:relative}.decorator{background:var(--rs-color-background-elevation-base);border:1px solid var(--rs-color-border-neutral);border-radius:var(--rs-unit-radius-small);height:var(--rs-line-height-body-3);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:background-color,border-color;width:var(--rs-line-height-body-3)}.decorator:before{background:var(--rs-color-on-background-primary);border-radius:999px;content:"";height:1.5px;width:var(--rs-unit-x2)}.decorator:before,.icon{left:50%;opacity:0;position:absolute;top:50%;transform:translate(-50%,-50%) scale(0);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:opacity,transform}[data-rs-keyboard] .input:focus+.decorator{box-shadow:var(--rs-focus-shadow)}.input:indeterminate+.decorator,.root.--error .input:indeterminate+.decorator,.root.--error:hover .input:indeterminate+.decorator,.root:hover .input:indeterminate+.decorator{background:var(--rs-color-background-primary);border-color:var(--rs-color-background-primary)}.input:indeterminate+.decorator:before,.root.--error .input:indeterminate+.decorator:before,.root.--error:hover .input:indeterminate+.decorator:before,.root:hover .input:indeterminate+.decorator:before{opacity:1;transform:translate(-50%,-50%) scale(1)}.input:checked+.decorator,.root.--error .input:checked+.decorator,.root.--error:hover .input:checked+.decorator,.root:hover .input:checked+.decorator{background:var(--rs-color-background-primary);border-color:var(--rs-color-background-primary);color:var(--rs-color-on-background-primary)}.input:checked+.decorator .icon,.root.--error .input:checked+.decorator .icon,.root.--error:hover .input:checked+.decorator .icon,.root:hover .input:checked+.decorator .icon{opacity:1;transform:translate(-50%,-50%) scale(1)}.root.--error .decorator{border-color:var(--rs-color-border-critical)}.root.--disabled{color:var(--rs-color-foreground-disabled);cursor:not-allowed}.root.--disabled .decorator,.root.--disabled .input:checked+.decorator,.root.--disabled:hover .decorator,.root.--disabled:hover .input:checked+.decorator{background:var(--rs-color-background-disabled-faded);border-color:var(--rs-color-border-disabled);color:var(--rs-color-foreground-disabled)}.root.--disabled .input:checked+.decorator,.root.--disabled .input:indeterminate+.decorator,.root.--disabled:hover .input:checked+.decorator,.root.--disabled:hover .input:indeterminate+.decorator{background:var(--rs-color-background-disabled);border-color:transparent}.root.--disabled .input:indeterminate+.decorator:before{background:var(--rs-color-foreground-disabled)}.root.--disabled .input:checked+.decorator:after{background:var(--rs-color-border-disabled)}
|
@@ -14,7 +14,6 @@ const Radio = (props) => {
|
|
14
14
|
const checked = radioGroup ? radioGroup.value === value : props.checked;
|
15
15
|
const defaultChecked = radioGroup ? undefined : props.defaultChecked;
|
16
16
|
const name = radioGroup ? radioGroup.name : props.name;
|
17
|
-
const TagName = children ? "label" : "span";
|
18
17
|
const rootClassName = classNames(s.root, className, hasError && s["--error"], disabled && s["--disabled"]);
|
19
18
|
const handleChange = (event) => {
|
20
19
|
if (!name)
|
@@ -26,7 +25,7 @@ const Radio = (props) => {
|
|
26
25
|
if (radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.onChange)
|
27
26
|
radioGroup.onChange(changeArgs);
|
28
27
|
};
|
29
|
-
return (React.createElement(
|
28
|
+
return (React.createElement("label", Object.assign({}, attributes, { className: rootClassName }),
|
30
29
|
React.createElement("span", { className: s.field },
|
31
30
|
React.createElement(HiddenInput, { className: s.input, type: "radio", checked: checked, defaultChecked: defaultChecked, name: name, disabled: disabled, value: value, onChange: handleChange, onFocus: onFocus, onBlur: onBlur, attributes: inputAttributes }),
|
32
31
|
React.createElement("div", { className: s.decorator })),
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import type * as T from "./Table.types";
|
3
|
+
declare const Table: {
|
4
|
+
(props: T.Props): React.JSX.Element;
|
5
|
+
Cell: (props: T.CellProps) => React.JSX.Element;
|
6
|
+
Heading: (props: T.HeadingProps) => React.JSX.Element;
|
7
|
+
Row: (props: T.RowProps) => React.JSX.Element;
|
8
|
+
Body: (props: T.BodyProps) => React.JSX.Element;
|
9
|
+
Head: (props: T.HeadProps) => React.JSX.Element;
|
10
|
+
};
|
11
|
+
export default Table;
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { classNames, responsiveVariables } from "../../utilities/helpers.js";
|
3
|
+
import getWidthStyles from "../../styles/width/index.js";
|
4
|
+
import getMinWidthStyles from "../../styles/minWidth/index.js";
|
5
|
+
import s from "./Table.module.css";
|
6
|
+
const TableCellPrivate = (props) => {
|
7
|
+
const { minWidth, rowSpan, colSpan, align, tagName: TagName, padding, paddingInline, paddingBlock, children, attributes, } = props;
|
8
|
+
const width = props.width === "auto" ? "0px" : props.width;
|
9
|
+
const widthStyles = getWidthStyles(width);
|
10
|
+
const minWidthStyles = getMinWidthStyles(minWidth || width);
|
11
|
+
const headingClassNames = classNames(s.cell, widthStyles === null || widthStyles === void 0 ? void 0 : widthStyles.classNames, minWidthStyles === null || minWidthStyles === void 0 ? void 0 : minWidthStyles.classNames, align && s[`cell--align-${align}`]);
|
12
|
+
const headingStyle = Object.assign(Object.assign(Object.assign(Object.assign({}, widthStyles === null || widthStyles === void 0 ? void 0 : widthStyles.variables), minWidthStyles === null || minWidthStyles === void 0 ? void 0 : minWidthStyles.variables), responsiveVariables("--rs-table-p-vertical", paddingBlock !== null && paddingBlock !== void 0 ? paddingBlock : padding)), responsiveVariables("--rs-table-p-horizontal", paddingInline !== null && paddingInline !== void 0 ? paddingInline : padding));
|
13
|
+
return (React.createElement(TagName, Object.assign({}, attributes, { className: headingClassNames, rowSpan: rowSpan, colSpan: colSpan, style: headingStyle }), children));
|
14
|
+
};
|
15
|
+
const TableCell = (props) => {
|
16
|
+
return React.createElement(TableCellPrivate, Object.assign({}, props, { tagName: "td" }));
|
17
|
+
};
|
18
|
+
const TableHeading = (props) => {
|
19
|
+
return React.createElement(TableCellPrivate, Object.assign({}, props, { tagName: "th" }));
|
20
|
+
};
|
21
|
+
const TableRow = (props) => {
|
22
|
+
const { highlighted, children, attributes } = props;
|
23
|
+
const rowClassNames = classNames(s.row, highlighted && s["--row-highlighted"]);
|
24
|
+
return (React.createElement("tr", Object.assign({}, attributes, { className: rowClassNames }), children));
|
25
|
+
};
|
26
|
+
const TableBody = (props) => {
|
27
|
+
return React.createElement("tbody", null, props.children);
|
28
|
+
};
|
29
|
+
const TableHead = (props) => {
|
30
|
+
return React.createElement("thead", null, props.children);
|
31
|
+
};
|
32
|
+
const Table = (props) => {
|
33
|
+
const { children, border, columnBorder, className, attributes } = props;
|
34
|
+
const rootClassNames = classNames(s.root, className, border && s["--border-outer"], columnBorder && s["--border-column"]);
|
35
|
+
const [firstChild] = React.Children.toArray(children);
|
36
|
+
return (React.createElement("div", Object.assign({}, attributes, { className: rootClassNames }),
|
37
|
+
React.createElement("table", { className: s.table }, React.isValidElement(firstChild) &&
|
38
|
+
(firstChild.type === TableBody || firstChild.type === TableHead) ? (children) : (React.createElement(TableBody, null, children)))));
|
39
|
+
};
|
40
|
+
Table.Cell = TableCell;
|
41
|
+
Table.Heading = TableHeading;
|
42
|
+
Table.Row = TableRow;
|
43
|
+
Table.Body = TableBody;
|
44
|
+
Table.Head = TableHead;
|
45
|
+
export default Table;
|
@@ -0,0 +1 @@
|
|
1
|
+
.root{margin:0 calc(var(--rs-unit-x4) * -1);-webkit-mask-image:linear-gradient(to right,transparent 0,#000 var(--rs-unit-x4),#000 calc(100% - var(--rs-unit-x4)),transparent 100%);mask-image:linear-gradient(to right,transparent 0,#000 var(--rs-unit-x4),#000 calc(100% - var(--rs-unit-x4)),transparent 100%);overflow:auto;padding:0 var(--rs-unit-x4)}.table{border-collapse:separate;border-radius:var(--rs-unit-radius-medium);min-width:100%;overflow:hidden}.row{transition:background-color var(--rs-duration-fast) var(--rs-easing-standard)}.cell{--rs-table-p-vertical-s:3;--rs-table-p-horizontal-s:4;padding:calc(var(--rs-unit-x1) * var(--rs-table-p-vertical-s)) calc(var(--rs-unit-x1) * var(--rs-table-p-horizontal-s));text-align:start;vertical-align:top}.cell:first-child{padding-inline-end:0}.row:not(:first-child) .cell{border-top:1px solid var(--rs-color-border-neutral-faded)}.cell--align-start{text-align:start}.cell--align-center{text-align:center}.cell--align-end{text-align:end}.--row-highlighted{background-color:rgba(var(--rs-color-rgb-background-neutral),40%)}.--border-outer .table{border:1px solid var(--rs-color-border-neutral-faded)}.--border-column .cell:not(:first-child){border-inline-start:1px solid var(--rs-color-border-neutral-faded)}.--border-column .cell:first-child{padding-inline-end:calc(var(--rs-unit-x1) * var(--rs-table-p-horizontal-s))}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import type * as G from "../../types/global";
|
3
|
+
export type Props = {
|
4
|
+
border?: boolean;
|
5
|
+
columnBorder?: boolean;
|
6
|
+
children: React.ReactNode;
|
7
|
+
className?: G.ClassName;
|
8
|
+
attributes?: G.Attributes<"div">;
|
9
|
+
};
|
10
|
+
export type RowProps = {
|
11
|
+
highlighted?: boolean;
|
12
|
+
children: React.ReactNode;
|
13
|
+
attributes?: G.Attributes<"tr">;
|
14
|
+
};
|
15
|
+
export type CellProps = {
|
16
|
+
align?: "start" | "center" | "end";
|
17
|
+
rowSpan?: number;
|
18
|
+
colSpan?: number;
|
19
|
+
padding?: number;
|
20
|
+
paddingInline?: number;
|
21
|
+
paddingBlock?: number;
|
22
|
+
width?: "auto" | string | number;
|
23
|
+
minWidth?: string | number;
|
24
|
+
children?: React.ReactNode;
|
25
|
+
attributes?: G.Attributes<"td">;
|
26
|
+
};
|
27
|
+
export type HeadingProps = CellProps & {
|
28
|
+
attributes?: G.Attributes<"th">;
|
29
|
+
};
|
30
|
+
export type BodyProps = {
|
31
|
+
children: React.ReactNode;
|
32
|
+
};
|
33
|
+
export type HeadProps = {
|
34
|
+
children: React.ReactNode;
|
35
|
+
};
|
36
|
+
export type PrivateCellProps = HeadingProps & {
|
37
|
+
tagName: "td" | "th";
|
38
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from "./Table.js";
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import React from "react";
|
2
|
+
declare const _default: {
|
3
|
+
title: string;
|
4
|
+
};
|
5
|
+
export default _default;
|
6
|
+
export declare const layout: () => React.JSX.Element;
|
7
|
+
export declare const border: () => React.JSX.Element;
|
8
|
+
export declare const highlighted: () => React.JSX.Element;
|
9
|
+
export declare const edgeCases: () => React.JSX.Element;
|
10
|
+
export declare const examples: () => React.JSX.Element;
|
@@ -0,0 +1,194 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { Example } from "../../../utilities/storybook/index.js";
|
3
|
+
import Table from "../index.js";
|
4
|
+
import Checkbox from "../../Checkbox/index.js";
|
5
|
+
import Card from "../../Card/index.js";
|
6
|
+
export default { title: "Components/Table" };
|
7
|
+
export const layout = () => (<Example>
|
8
|
+
<Example.Item title="base">
|
9
|
+
<Table>
|
10
|
+
<Table.Row>
|
11
|
+
<Table.Heading>Column 1</Table.Heading>
|
12
|
+
<Table.Heading>Column 2</Table.Heading>
|
13
|
+
</Table.Row>
|
14
|
+
<Table.Row>
|
15
|
+
<Table.Cell>Cell 1</Table.Cell>
|
16
|
+
<Table.Cell>Cell 2</Table.Cell>
|
17
|
+
</Table.Row>
|
18
|
+
</Table>
|
19
|
+
</Example.Item>
|
20
|
+
<Example.Item title="colspan: 2 for col 2, rowspan: 2 for cell 3">
|
21
|
+
<Table>
|
22
|
+
<Table.Row>
|
23
|
+
<Table.Heading>Column 1</Table.Heading>
|
24
|
+
<Table.Heading colSpan={2}>Column 2</Table.Heading>
|
25
|
+
</Table.Row>
|
26
|
+
<Table.Row>
|
27
|
+
<Table.Cell>Cell 1</Table.Cell>
|
28
|
+
<Table.Cell>Cell 2</Table.Cell>
|
29
|
+
<Table.Cell rowSpan={2}>Cell 3</Table.Cell>
|
30
|
+
</Table.Row>
|
31
|
+
<Table.Row>
|
32
|
+
<Table.Cell>Cell 1</Table.Cell>
|
33
|
+
<Table.Cell>Cell 2</Table.Cell>
|
34
|
+
</Table.Row>
|
35
|
+
</Table>
|
36
|
+
</Example.Item>
|
37
|
+
<Example.Item title="align: center for heading 1, align: end for heading 2">
|
38
|
+
<Table>
|
39
|
+
<Table.Row>
|
40
|
+
<Table.Heading align="center">Column 1</Table.Heading>
|
41
|
+
<Table.Heading align="end">Column 2</Table.Heading>
|
42
|
+
</Table.Row>
|
43
|
+
<Table.Row>
|
44
|
+
<Table.Cell>Cell 1</Table.Cell>
|
45
|
+
<Table.Cell>Cell 2</Table.Cell>
|
46
|
+
</Table.Row>
|
47
|
+
</Table>
|
48
|
+
</Example.Item>
|
49
|
+
<Example.Item title="width: 40%, minWidth: 200px for col 1">
|
50
|
+
<Table>
|
51
|
+
<Table.Row>
|
52
|
+
<Table.Heading width="40%" minWidth="200px">
|
53
|
+
Column 1
|
54
|
+
</Table.Heading>
|
55
|
+
<Table.Heading>Column 2</Table.Heading>
|
56
|
+
</Table.Row>
|
57
|
+
<Table.Row>
|
58
|
+
<Table.Cell>Cell 1</Table.Cell>
|
59
|
+
<Table.Cell>Cell 2</Table.Cell>
|
60
|
+
</Table.Row>
|
61
|
+
</Table>
|
62
|
+
</Example.Item>
|
63
|
+
</Example>);
|
64
|
+
export const border = () => (<Example>
|
65
|
+
<Example.Item title="border: true">
|
66
|
+
<Table border>
|
67
|
+
<Table.Row>
|
68
|
+
<Table.Heading>Column 1</Table.Heading>
|
69
|
+
<Table.Heading>Column 2</Table.Heading>
|
70
|
+
</Table.Row>
|
71
|
+
<Table.Row>
|
72
|
+
<Table.Cell>Cell 1</Table.Cell>
|
73
|
+
<Table.Cell>Cell 2</Table.Cell>
|
74
|
+
</Table.Row>
|
75
|
+
</Table>
|
76
|
+
</Example.Item>
|
77
|
+
<Example.Item title="columnBorder: true">
|
78
|
+
<Table columnBorder>
|
79
|
+
<Table.Row>
|
80
|
+
<Table.Heading>Column 1</Table.Heading>
|
81
|
+
<Table.Heading>Column 2</Table.Heading>
|
82
|
+
</Table.Row>
|
83
|
+
<Table.Row>
|
84
|
+
<Table.Cell>Cell 1</Table.Cell>
|
85
|
+
<Table.Cell>Cell 2</Table.Cell>
|
86
|
+
</Table.Row>
|
87
|
+
</Table>
|
88
|
+
</Example.Item>
|
89
|
+
<Example.Item title="columnBorder: true, border: true">
|
90
|
+
<Table columnBorder border>
|
91
|
+
<Table.Row>
|
92
|
+
<Table.Heading>Column 1</Table.Heading>
|
93
|
+
<Table.Heading>Column 2</Table.Heading>
|
94
|
+
</Table.Row>
|
95
|
+
<Table.Row>
|
96
|
+
<Table.Cell>Cell 1</Table.Cell>
|
97
|
+
<Table.Cell>Cell 2</Table.Cell>
|
98
|
+
</Table.Row>
|
99
|
+
</Table>
|
100
|
+
</Example.Item>
|
101
|
+
</Example>);
|
102
|
+
export const highlighted = () => (<Example>
|
103
|
+
<Example.Item title="highlighted for row 2">
|
104
|
+
<Table>
|
105
|
+
<Table.Row>
|
106
|
+
<Table.Heading>Column 1</Table.Heading>
|
107
|
+
<Table.Heading>Column 2</Table.Heading>
|
108
|
+
</Table.Row>
|
109
|
+
<Table.Row highlighted>
|
110
|
+
<Table.Cell>Cell 1</Table.Cell>
|
111
|
+
<Table.Cell>Cell 2</Table.Cell>
|
112
|
+
</Table.Row>
|
113
|
+
</Table>
|
114
|
+
</Example.Item>
|
115
|
+
</Example>);
|
116
|
+
export const edgeCases = () => (<Example>
|
117
|
+
<Example.Item title="scroll fade">
|
118
|
+
<Table>
|
119
|
+
<Table.Row>
|
120
|
+
<Table.Heading width="500px">Column 1</Table.Heading>
|
121
|
+
<Table.Heading width="500px">Column 2</Table.Heading>
|
122
|
+
</Table.Row>
|
123
|
+
<Table.Row>
|
124
|
+
<Table.Cell>Cell 1</Table.Cell>
|
125
|
+
<Table.Cell>Cell 2</Table.Cell>
|
126
|
+
</Table.Row>
|
127
|
+
</Table>
|
128
|
+
</Example.Item>
|
129
|
+
<Example.Item title="card with highlighted heading">
|
130
|
+
<Card elevated padding={0}>
|
131
|
+
<Table>
|
132
|
+
<Table.Row highlighted>
|
133
|
+
<Table.Heading width="50%" minWidth="200px">
|
134
|
+
Column 1
|
135
|
+
</Table.Heading>
|
136
|
+
<Table.Heading colSpan={2} align="end">
|
137
|
+
Column 2
|
138
|
+
</Table.Heading>
|
139
|
+
</Table.Row>
|
140
|
+
<Table.Row>
|
141
|
+
<Table.Cell>Cell 1</Table.Cell>
|
142
|
+
<Table.Cell align="center">Cell 2</Table.Cell>
|
143
|
+
<Table.Cell align="end">Cell 3</Table.Cell>
|
144
|
+
</Table.Row>
|
145
|
+
<Table.Row>
|
146
|
+
<Table.Cell>Cell 1</Table.Cell>
|
147
|
+
<Table.Cell align="center">Cell 2</Table.Cell>
|
148
|
+
<Table.Cell align="end">Cell 3</Table.Cell>
|
149
|
+
</Table.Row>
|
150
|
+
</Table>
|
151
|
+
</Card>
|
152
|
+
</Example.Item>
|
153
|
+
</Example>);
|
154
|
+
const SelectionDemo = () => {
|
155
|
+
const [value, setValue] = React.useState([]);
|
156
|
+
const rows = [
|
157
|
+
{
|
158
|
+
value: "1",
|
159
|
+
},
|
160
|
+
{ value: "2" },
|
161
|
+
];
|
162
|
+
const allSelected = value.length === rows.length;
|
163
|
+
return (<Table>
|
164
|
+
<Table.Row>
|
165
|
+
<Table.Heading width="auto">
|
166
|
+
<Checkbox inputAttributes={{ "aria-label": "Select all" }} name="hey" checked={allSelected} indeterminate={!!value.length && value.length < rows.length} onChange={() => {
|
167
|
+
setValue(allSelected ? [] : rows.map((row) => row.value));
|
168
|
+
}}/>
|
169
|
+
</Table.Heading>
|
170
|
+
<Table.Heading>Column 1</Table.Heading>
|
171
|
+
<Table.Heading>Column 2</Table.Heading>
|
172
|
+
</Table.Row>
|
173
|
+
{rows.map((row) => (<Table.Row key={row.value} highlighted={value.includes(row.value)}>
|
174
|
+
<Table.Cell>
|
175
|
+
<Checkbox name="hey" value={row.value} inputAttributes={{ "aria-label": "Select the row" }} checked={value.includes(row.value)} onChange={(args) => {
|
176
|
+
setValue((prev) => {
|
177
|
+
if (!args.value)
|
178
|
+
return prev;
|
179
|
+
if (args.checked)
|
180
|
+
return [...prev, args.value];
|
181
|
+
return prev.filter((item) => item !== args.value);
|
182
|
+
});
|
183
|
+
}}/>
|
184
|
+
</Table.Cell>
|
185
|
+
<Table.Cell>Cell 1</Table.Cell>
|
186
|
+
<Table.Cell>Cell 2</Table.Cell>
|
187
|
+
</Table.Row>))}
|
188
|
+
</Table>);
|
189
|
+
};
|
190
|
+
export const examples = () => (<Example>
|
191
|
+
<Example.Item title="selectable">
|
192
|
+
<SelectionDemo />
|
193
|
+
</Example.Item>
|
194
|
+
</Example>);
|
@@ -55,6 +55,7 @@ export type Context = Pick<BaseProps, "itemWidth" | "onChange" | "variant" | "na
|
|
55
55
|
id: string;
|
56
56
|
elActiveRef: React.MutableRefObject<HTMLDivElement | null>;
|
57
57
|
elPrevActiveRef: React.MutableRefObject<HTMLDivElement | null>;
|
58
|
+
elScrollableRef: React.MutableRefObject<HTMLDivElement | null>;
|
58
59
|
selection: SelectionState;
|
59
60
|
setSelection: React.Dispatch<React.SetStateAction<SelectionState>>;
|
60
61
|
};
|
@@ -17,6 +17,7 @@ export declare const useTabs: (value?: string) => {
|
|
17
17
|
setDefaultValue: (value: string) => void;
|
18
18
|
elActiveRef: React.MutableRefObject<HTMLDivElement | null>;
|
19
19
|
elPrevActiveRef: React.MutableRefObject<HTMLDivElement | null>;
|
20
|
+
elScrollableRef: React.MutableRefObject<HTMLDivElement | null>;
|
20
21
|
selection: T.SelectionState;
|
21
22
|
setSelection: React.Dispatch<React.SetStateAction<T.SelectionState>>;
|
22
23
|
};
|
@@ -7,6 +7,7 @@ const TabsControlled = (props) => {
|
|
7
7
|
const id = useElementId();
|
8
8
|
const elActiveRef = React.useRef(null);
|
9
9
|
const elPrevActiveRef = React.useRef(elActiveRef.current);
|
10
|
+
const elScrollableRef = React.useRef(null);
|
10
11
|
const [selection, setSelection] = React.useState({
|
11
12
|
scaleX: 0,
|
12
13
|
scaleY: 0,
|
@@ -32,6 +33,7 @@ const TabsControlled = (props) => {
|
|
32
33
|
setDefaultValue,
|
33
34
|
elActiveRef,
|
34
35
|
elPrevActiveRef,
|
36
|
+
elScrollableRef,
|
35
37
|
selection,
|
36
38
|
setSelection,
|
37
39
|
} }, children));
|
@@ -9,7 +9,7 @@ import { useTabs } from "./TabsContext.js";
|
|
9
9
|
import s from "./Tabs.module.css";
|
10
10
|
const TabsItem = (props, ref) => {
|
11
11
|
const { value, children, icon, href, attributes } = props;
|
12
|
-
const { onChange, panelId, name, size, value: tabsValue, selection, elActiveRef, elPrevActiveRef, } = useTabs(value);
|
12
|
+
const { onChange, panelId, name, size, value: tabsValue, selection, elActiveRef, elPrevActiveRef, elScrollableRef, } = useTabs(value);
|
13
13
|
const itemRef = React.useRef(null);
|
14
14
|
const active = tabsValue === value;
|
15
15
|
const visuallySelected = active && selection.status === "idle";
|
@@ -28,11 +28,27 @@ const TabsItem = (props, ref) => {
|
|
28
28
|
elActiveRef.current = itemRef.current;
|
29
29
|
}, [elActiveRef, elPrevActiveRef]);
|
30
30
|
const handleChange = () => {
|
31
|
+
var _a, _b, _c;
|
31
32
|
if (href && !onChange)
|
32
33
|
return;
|
34
|
+
const listEl = elScrollableRef.current;
|
35
|
+
const currentListItem = (_a = itemRef.current) === null || _a === void 0 ? void 0 : _a.parentElement;
|
36
|
+
const prevListItem = (_b = elActiveRef.current) === null || _b === void 0 ? void 0 : _b.parentElement;
|
37
|
+
// Updating refs after saving the elements
|
33
38
|
updateRefs();
|
34
39
|
if (onChange)
|
35
40
|
onChange({ value, name });
|
41
|
+
if (!listEl || !currentListItem || !prevListItem || listEl.scrollWidth === listEl.clientWidth) {
|
42
|
+
return;
|
43
|
+
}
|
44
|
+
const navigatingBack = currentListItem.offsetLeft < prevListItem.offsetLeft;
|
45
|
+
const threshold = (currentListItem.offsetLeft - listEl.scrollLeft) / listEl.clientWidth;
|
46
|
+
// Only scroll if the item is close to getting clipped
|
47
|
+
// Back navigation threshold is 0.3 since its calculated based on offsetLeft
|
48
|
+
const shouldScroll = navigatingBack ? threshold < 0.3 : threshold > 0.5;
|
49
|
+
if (!shouldScroll)
|
50
|
+
return;
|
51
|
+
(_c = itemRef.current) === null || _c === void 0 ? void 0 : _c.scrollIntoView({ behavior: "smooth", block: "center", inline: "center" });
|
36
52
|
};
|
37
53
|
React.useEffect(() => {
|
38
54
|
if (!active)
|
@@ -20,9 +20,8 @@ const findParentItem = (el, rootEl) => {
|
|
20
20
|
};
|
21
21
|
const TabsList = (props) => {
|
22
22
|
const { children, className, attributes } = props;
|
23
|
-
const { value, setDefaultValue, itemWidth, variant, name, direction, size, selection, setSelection, elActiveRef, elPrevActiveRef, } = useTabs();
|
23
|
+
const { value, setDefaultValue, itemWidth, variant, name, direction, size, selection, setSelection, elActiveRef, elPrevActiveRef, elScrollableRef, } = useTabs();
|
24
24
|
const [rtl] = useRTL();
|
25
|
-
const elScrollableRef = React.useRef(null);
|
26
25
|
const [cutOffSide, setCutOffSide] = React.useState(null);
|
27
26
|
const rootClassNames = classNames(s.root, size && s[`--size-${size}`], direction && s[`--direction-${direction}`], itemWidth && s[`--item-width-${itemWidth}`], variant && s[`--variant-${variant}`], cutOffSide && s[`--cut-off-${cutOffSide}`], className);
|
28
27
|
const selectorClassNames = classNames(s.selector, selection.status === "idle" && s["--selector-hidden"], selection.status === "animated" && s["--selector-animated"]);
|
@@ -55,7 +54,7 @@ const TabsList = (props) => {
|
|
55
54
|
top: itemEl.offsetTop,
|
56
55
|
left: itemEl.offsetLeft,
|
57
56
|
};
|
58
|
-
}, []);
|
57
|
+
}, [elScrollableRef]);
|
59
58
|
const { ref: hotkeysRef } = useHotkeys({
|
60
59
|
"ArrowLeft, ArrowUp": (e) => {
|
61
60
|
if (name)
|
package/components/View/View.js
CHANGED
@@ -25,7 +25,7 @@ import getInsetStyles from "../../styles/inset/index.js";
|
|
25
25
|
import getAspectRatioStyles from "../../styles/aspectRatio/index.js";
|
26
26
|
const ViewItem = (props) => {
|
27
27
|
const { columns, grow, gapBefore, as: TagName = "div", order, children, className, attributes, } = props;
|
28
|
-
const itemClassNames = classNames(s.item, className, gapBefore === "auto" && s["item--gap-auto"], gapBefore !== undefined && s["item--gap-before"], ...responsiveClassNames(s, "item--grow", grow), ...responsiveClassNames(s, "item--columns", columns));
|
28
|
+
const itemClassNames = classNames(s.item, className, gapBefore === "auto" && s["item--gap-auto"], gapBefore !== undefined && s["item--gap-before"], columns && s["item--columns"], ...responsiveClassNames(s, "item--grow", grow), ...responsiveClassNames(s, "item--columns", columns));
|
29
29
|
const itemVariables = Object.assign(Object.assign({}, responsiveVariables("--rs-view-item-order", order)), responsiveVariables("--rs-view-item-gap-before", gapBefore));
|
30
30
|
return (React.createElement(TagName, Object.assign({}, attributes, { style: Object.assign(Object.assign({}, attributes === null || attributes === void 0 ? void 0 : attributes.style), itemVariables), className: itemClassNames }), children));
|
31
31
|
};
|