@databricks/design-system 2.0.1 → 2.0.3

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.
Files changed (91) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/{WizardStepContentWrapper-CFCTOSm8.js → WizardStepContentWrapper-DsAS2ZAT.js} +1356 -686
  3. package/dist/WizardStepContentWrapper-DsAS2ZAT.js.map +1 -0
  4. package/dist/dubois-colors.less +2 -0
  5. package/dist/fonts/dm-mono/DMMono-Regular.woff2 +0 -0
  6. package/dist/fonts/dm-mono/dm-mono.css +11 -0
  7. package/dist/index-dark.css +305 -516
  8. package/dist/index-dark.mitigated.css +305 -516
  9. package/dist/index.css +438 -544
  10. package/dist/index.js +1971 -244
  11. package/dist/index.js.map +1 -1
  12. package/dist/index.mitigated.css +447 -553
  13. package/dist/patterns.js +12 -2
  14. package/dist/patterns.js.map +1 -1
  15. package/dist-types/design-system/Button/Button.d.ts +2 -2
  16. package/dist-types/design-system/ContextMenu/ContextMenu.d.ts +2 -2
  17. package/dist-types/design-system/DesignSystemProvider/DesignSystemProvider.d.ts +44 -0
  18. package/dist-types/design-system/Drawer/DrawerContext.d.ts +9 -0
  19. package/dist-types/design-system/FormV2/RHFAdapters.d.ts +8 -8
  20. package/dist-types/design-system/Grid/Col.d.ts +1 -3
  21. package/dist-types/design-system/Grid/NativeCol.d.ts +10 -0
  22. package/dist-types/design-system/Grid/NativeGridContext.d.ts +11 -0
  23. package/dist-types/design-system/Grid/NativeRow.d.ts +13 -0
  24. package/dist-types/design-system/Grid/Row.d.ts +3 -4
  25. package/dist-types/design-system/Grid/grid-styling.d.ts +22 -0
  26. package/dist-types/design-system/Grid/gridConstants.d.ts +2 -0
  27. package/dist-types/design-system/Grid/index.d.ts +1 -0
  28. package/dist-types/design-system/Grid/rowConstants.d.ts +7 -0
  29. package/dist-types/design-system/Grid/types.d.ts +49 -0
  30. package/dist-types/design-system/Hooks/index.d.ts +1 -1
  31. package/dist-types/design-system/Hooks/useDesignSystemTheme.d.ts +7 -7
  32. package/dist-types/design-system/Icon/LegacyAntDIcon.d.ts +21 -0
  33. package/dist-types/design-system/Icon/__generated/icons/FlowsIcon.d.ts +4 -0
  34. package/dist-types/design-system/Icon/__generated/icons/LakewatchAlertIcon.d.ts +4 -0
  35. package/dist-types/design-system/Icon/__generated/icons/LakewatchDatasourceIcon.d.ts +4 -0
  36. package/dist-types/design-system/Icon/__generated/icons/LakewatchDetectionRuleIcon.d.ts +4 -0
  37. package/dist-types/design-system/Icon/__generated/icons/LakewatchParserIcon.d.ts +4 -0
  38. package/dist-types/design-system/Icon/__generated/icons/index.d.ts +5 -0
  39. package/dist-types/design-system/Icon/index.d.ts +0 -1
  40. package/dist-types/design-system/LegacyTooltip/index.d.ts +0 -1
  41. package/dist-types/design-system/Skeleton/TitleSkeleton.d.ts +9 -3
  42. package/dist-types/design-system/TypeaheadCombobox/TypeaheadComboboxAddButton.d.ts +4 -0
  43. package/dist-types/design-system/TypeaheadCombobox/TypeaheadComboboxCheckboxItem.d.ts +8 -0
  44. package/dist-types/design-system/TypeaheadCombobox/TypeaheadComboboxControls.d.ts +2 -0
  45. package/dist-types/design-system/TypeaheadCombobox/TypeaheadComboboxFooter.d.ts +12 -0
  46. package/dist-types/design-system/TypeaheadCombobox/TypeaheadComboboxInput.d.ts +8 -0
  47. package/dist-types/design-system/TypeaheadCombobox/TypeaheadComboboxMenu.d.ts +8 -0
  48. package/dist-types/design-system/TypeaheadCombobox/TypeaheadComboboxMenuItem.d.ts +8 -0
  49. package/dist-types/design-system/TypeaheadCombobox/TypeaheadComboboxMultiSelectInput.d.ts +17 -0
  50. package/dist-types/design-system/TypeaheadCombobox/TypeaheadComboboxRoot.d.ts +8 -0
  51. package/dist-types/design-system/TypeaheadCombobox/TypeaheadComboboxSectionHeader.d.ts +4 -0
  52. package/dist-types/design-system/TypeaheadCombobox/TypeaheadComboboxSelectedItem.d.ts +8 -0
  53. package/dist-types/design-system/TypeaheadCombobox/TypeaheadComboboxSeparator.d.ts +4 -0
  54. package/dist-types/design-system/TypeaheadCombobox/TypeaheadComboboxToggleButton.d.ts +8 -0
  55. package/dist-types/design-system/TypeaheadCombobox/hooks/downshiftHookWrappers.d.ts +8 -0
  56. package/dist-types/design-system/TypeaheadComboboxV2/CountBadge.d.ts +6 -0
  57. package/dist-types/design-system/TypeaheadComboboxV2/TypeaheadComboboxAddButton.d.ts +3 -0
  58. package/dist-types/design-system/TypeaheadComboboxV2/TypeaheadComboboxCheckboxItem.d.ts +10 -0
  59. package/dist-types/design-system/TypeaheadComboboxV2/TypeaheadComboboxControls.d.ts +11 -0
  60. package/dist-types/design-system/TypeaheadComboboxV2/TypeaheadComboboxFooter.d.ts +2 -0
  61. package/dist-types/design-system/TypeaheadComboboxV2/TypeaheadComboboxInput.d.ts +9 -0
  62. package/dist-types/design-system/TypeaheadComboboxV2/TypeaheadComboboxMenu.d.ts +17 -0
  63. package/dist-types/design-system/TypeaheadComboboxV2/TypeaheadComboboxMenuItem.d.ts +16 -0
  64. package/dist-types/design-system/TypeaheadComboboxV2/TypeaheadComboboxMultiSelectInput.d.ts +18 -0
  65. package/dist-types/design-system/TypeaheadComboboxV2/TypeaheadComboboxRoot.d.ts +17 -0
  66. package/dist-types/design-system/TypeaheadComboboxV2/TypeaheadComboboxSectionHeader.d.ts +1 -0
  67. package/dist-types/design-system/TypeaheadComboboxV2/TypeaheadComboboxSelectedItem.d.ts +11 -0
  68. package/dist-types/design-system/TypeaheadComboboxV2/TypeaheadComboboxSeparator.d.ts +1 -0
  69. package/dist-types/design-system/TypeaheadComboboxV2/TypeaheadComboboxToggleButton.d.ts +4 -0
  70. package/dist-types/design-system/TypeaheadComboboxV2/hooks/footerFocus.d.ts +13 -0
  71. package/dist-types/design-system/TypeaheadComboboxV2/hooks/index.d.ts +4 -0
  72. package/dist-types/design-system/TypeaheadComboboxV2/hooks/useComboboxItems.d.ts +32 -0
  73. package/dist-types/design-system/TypeaheadComboboxV2/hooks/useComboboxState.d.ts +81 -0
  74. package/dist-types/design-system/TypeaheadComboboxV2/hooks/useComboboxStateProps.d.ts +36 -0
  75. package/dist-types/design-system/TypeaheadComboboxV2/hooks/useMultipleSelectionState.d.ts +25 -0
  76. package/dist-types/design-system/TypeaheadComboboxV2/hooks/useRestoreHighlightedOption.d.ts +18 -0
  77. package/dist-types/design-system/TypeaheadComboboxV2/hooks/useScrollOptionIntoView.d.ts +11 -0
  78. package/dist-types/design-system/TypeaheadComboboxV2/hooks/useTypeaheadComboboxContext.d.ts +2 -0
  79. package/dist-types/design-system/TypeaheadComboboxV2/hooks/useVirtualizedComboboxScroll.d.ts +36 -0
  80. package/dist-types/design-system/TypeaheadComboboxV2/index.d.ts +13 -0
  81. package/dist-types/design-system/TypeaheadComboboxV2/providers/TypeaheadComboboxContext.d.ts +47 -0
  82. package/dist-types/design-system/Typography/titleLevel.d.ts +11 -0
  83. package/dist-types/design-system/_shared_/Menu/index.d.ts +1 -1
  84. package/dist-types/design-system/fonts.d.ts +1 -0
  85. package/dist-types/design-system/index.d.ts +1 -0
  86. package/dist-types/design-system/utils/useMediaQuery.d.ts +4 -1
  87. package/dist-types/theme/_generated/ValidSemanticColors.d.ts +2 -1
  88. package/package.json +14 -3
  89. package/dist/WizardStepContentWrapper-CFCTOSm8.js.map +0 -1
  90. package/dist-types/design-system/Icon/AntdIcon.d.ts +0 -114
  91. package/dist-types/design-system/LegacyTooltip/LegacyInfoTooltip.d.ts +0 -16
@@ -10911,316 +10911,6 @@ textarea.du-bois-dark-input {
10911
10911
  /* stylelint-disable */
10912
10912
  /* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
10913
10913
 
10914
- /* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
10915
- /* stylelint-disable no-duplicate-selectors */
10916
- /* stylelint-disable */
10917
- /* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
10918
- .du-bois-dark-modal {
10919
- box-sizing: border-box;
10920
- margin: 0;
10921
- padding: 0;
10922
- color: #E8ECF0;
10923
- font-size: 13px;
10924
- font-variant: tabular-nums;
10925
- line-height: 20px;
10926
- list-style: none;
10927
- font-feature-settings: tnum;
10928
- pointer-events: none;
10929
- position: relative;
10930
- top: 100px;
10931
- width: auto;
10932
- max-width: calc(100vw - 32px);
10933
- margin: 0 auto;
10934
- padding-bottom: 24px;
10935
- }
10936
- .du-bois-dark-modal.du-bois-dark-zoom-enter,
10937
- .du-bois-dark-modal.du-bois-darkzoom-appear {
10938
- transform: none;
10939
- opacity: 0;
10940
- animation-duration: 0.3s;
10941
- user-select: none;
10942
- }
10943
- .du-bois-dark-modal-mask {
10944
- position: fixed;
10945
- top: 0;
10946
- right: 0;
10947
- bottom: 0;
10948
- left: 0;
10949
- z-index: 1000;
10950
- height: 100%;
10951
- background-color: rgba(0, 0, 0, 0.45);
10952
- }
10953
- .du-bois-dark-modal-mask-hidden {
10954
- display: none;
10955
- }
10956
- .du-bois-dark-modal-wrap {
10957
- position: fixed;
10958
- top: 0;
10959
- right: 0;
10960
- bottom: 0;
10961
- left: 0;
10962
- overflow: auto;
10963
- outline: 0;
10964
- -webkit-overflow-scrolling: touch;
10965
- }
10966
- .du-bois-dark-modal-wrap {
10967
- z-index: 1000;
10968
- }
10969
- .du-bois-dark-modal-title {
10970
- margin: 0;
10971
- color: rgba(255, 255, 255, 0.85);
10972
- font-weight: 500;
10973
- font-size: 18px;
10974
- line-height: 22px;
10975
- word-wrap: break-word;
10976
- }
10977
- .du-bois-dark-modal-content {
10978
- position: relative;
10979
- background-color: #1f1f1f;
10980
- background-clip: padding-box;
10981
- border: 0;
10982
- border-radius: 4px;
10983
- box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.48), 0 6px 16px 0 rgba(0, 0, 0, 0.32), 0 9px 28px 8px rgba(0, 0, 0, 0.2);
10984
- pointer-events: auto;
10985
- }
10986
- .du-bois-dark-modal-close {
10987
- position: absolute;
10988
- top: 0;
10989
- right: 0;
10990
- z-index: 10;
10991
- padding: 0;
10992
- color: #92A4B3;
10993
- font-weight: 700;
10994
- line-height: 1;
10995
- text-decoration: none;
10996
- background: transparent;
10997
- border: 0;
10998
- outline: 0;
10999
- cursor: pointer;
11000
- transition: color 0.3s;
11001
- }
11002
- .du-bois-dark-modal-close-x {
11003
- display: block;
11004
- width: 102px;
11005
- height: 102px;
11006
- font-size: 18px;
11007
- font-style: normal;
11008
- line-height: 102px;
11009
- text-align: center;
11010
- text-transform: none;
11011
- text-rendering: auto;
11012
- }
11013
- .du-bois-dark-modal-close:focus,
11014
- .du-bois-dark-modal-close:hover {
11015
- color: rgba(255, 255, 255, 0.75);
11016
- text-decoration: none;
11017
- }
11018
- .du-bois-dark-modal-header {
11019
- padding: 40px 40px 20px;
11020
- color: #E8ECF0;
11021
- background: #1f1f1f;
11022
- border-bottom: 0px solid #303030;
11023
- border-radius: 4px 4px 0 0;
11024
- }
11025
- .du-bois-dark-modal-body {
11026
- padding: 0 40px;
11027
- font-size: 13px;
11028
- line-height: 20px;
11029
- word-wrap: break-word;
11030
- }
11031
- .du-bois-dark-modal-footer {
11032
- padding: 0px 0px;
11033
- text-align: right;
11034
- background: transparent;
11035
- border-top: 0px solid #303030;
11036
- border-radius: 0 0 4px 4px;
11037
- }
11038
- .du-bois-dark-modal-footer .du-bois-dark-btn + .du-bois-dark-btn:not(.du-bois-dark-dropdown-trigger) {
11039
- margin-bottom: 0;
11040
- margin-left: 8px;
11041
- }
11042
- .du-bois-dark-modal-open {
11043
- overflow: hidden;
11044
- }
11045
- .du-bois-dark-modal-centered {
11046
- text-align: center;
11047
- }
11048
- .du-bois-dark-modal-centered::before {
11049
- display: inline-block;
11050
- width: 0;
11051
- height: 100%;
11052
- vertical-align: middle;
11053
- content: '';
11054
- }
11055
- .du-bois-dark-modal-centered .du-bois-dark-modal {
11056
- top: 0;
11057
- display: inline-block;
11058
- text-align: left;
11059
- vertical-align: middle;
11060
- }
11061
- @media (max-width: 767px) {
11062
- .du-bois-dark-modal {
11063
- max-width: calc(100vw - 16px);
11064
- margin: 8px auto;
11065
- }
11066
- .du-bois-dark-modal-centered .du-bois-dark-modal {
11067
- flex: 1;
11068
- }
11069
- }
11070
- .du-bois-dark-modal-confirm .du-bois-dark-modal-header {
11071
- display: none;
11072
- }
11073
- .du-bois-dark-modal-confirm .du-bois-dark-modal-body {
11074
- padding: 32px 32px 24px;
11075
- }
11076
- .du-bois-dark-modal-confirm-body-wrapper::before {
11077
- display: table;
11078
- content: '';
11079
- }
11080
- .du-bois-dark-modal-confirm-body-wrapper::after {
11081
- display: table;
11082
- clear: both;
11083
- content: '';
11084
- }
11085
- .du-bois-dark-modal-confirm-body .du-bois-dark-modal-confirm-title {
11086
- display: block;
11087
- overflow: hidden;
11088
- color: rgba(255, 255, 255, 0.85);
11089
- font-weight: 500;
11090
- font-size: 18px;
11091
- line-height: 1.4;
11092
- }
11093
- .du-bois-dark-modal-confirm-body .du-bois-dark-modal-confirm-content {
11094
- margin-top: 8px;
11095
- color: #E8ECF0;
11096
- font-size: 13px;
11097
- }
11098
- .du-bois-dark-modal-confirm-body > .anticon {
11099
- float: left;
11100
- margin-right: 16px;
11101
- font-size: 22px;
11102
- }
11103
- .du-bois-dark-modal-confirm-body > .anticon + .du-bois-dark-modal-confirm-title + .du-bois-dark-modal-confirm-content {
11104
- margin-left: 38px;
11105
- }
11106
- .du-bois-dark-modal-confirm .du-bois-dark-modal-confirm-btns {
11107
- float: right;
11108
- margin-top: 24px;
11109
- }
11110
- .du-bois-dark-modal-confirm .du-bois-dark-modal-confirm-btns .du-bois-dark-btn + .du-bois-dark-btn {
11111
- margin-bottom: 0;
11112
- margin-left: 8px;
11113
- }
11114
- .du-bois-dark-modal-confirm-error .du-bois-dark-modal-confirm-body > .anticon {
11115
- color: #E65B77;
11116
- }
11117
- .du-bois-dark-modal-confirm-warning .du-bois-dark-modal-confirm-body > .anticon,
11118
- .du-bois-dark-modal-confirm-confirm .du-bois-dark-modal-confirm-body > .anticon {
11119
- color: #AF5B23;
11120
- }
11121
- .du-bois-dark-modal-confirm-info .du-bois-dark-modal-confirm-body > .anticon {
11122
- color: #64727D;
11123
- }
11124
- .du-bois-dark-modal-confirm-success .du-bois-dark-modal-confirm-body > .anticon {
11125
- color: #34824F;
11126
- }
11127
- .du-bois-dark-modal .du-bois-dark-picker-clear,
11128
- .du-bois-dark-modal .du-bois-dark-slider-handle,
11129
- .du-bois-dark-modal .du-bois-dark-anchor-wrapper,
11130
- .du-bois-dark-modal .du-bois-dark-collapse-content,
11131
- .du-bois-dark-modal .du-bois-dark-timeline-item-head,
11132
- .du-bois-dark-modal .du-bois-dark-card {
11133
- background-color: #1f1f1f;
11134
- }
11135
- .du-bois-dark-modal .du-bois-dark-transfer-list-header {
11136
- background: #1f1f1f;
11137
- border-bottom: 1px solid #3a3a3a;
11138
- }
11139
- .du-bois-dark-modal .du-bois-dark-transfer-list-content-item:not(.du-bois-dark-transfer-list-content-item-disabled):hover {
11140
- background-color: rgba(255, 255, 255, 0.08);
11141
- }
11142
- .du-bois-dark-modal tr.du-bois-dark-table-expanded-row > td,
11143
- .du-bois-dark-modal tr.du-bois-dark-table-expanded-row:hover > td {
11144
- background: #272727;
11145
- }
11146
- .du-bois-dark-modal .du-bois-dark-table.du-bois-dark-table-small thead > tr > th {
11147
- background-color: #1f1f1f;
11148
- border-bottom: 1px solid #3a3a3a;
11149
- }
11150
- .du-bois-dark-modal .du-bois-dark-table {
11151
- background-color: #1f1f1f;
11152
- }
11153
- .du-bois-dark-modal .du-bois-dark-table .du-bois-dark-table-row-expand-icon {
11154
- border: 1px solid #3a3a3a;
11155
- }
11156
- .du-bois-dark-modal .du-bois-dark-table tfoot > tr > th,
11157
- .du-bois-dark-modal .du-bois-dark-table tfoot > tr > td {
11158
- border-bottom: 1px solid #3a3a3a;
11159
- }
11160
- .du-bois-dark-modal .du-bois-dark-table thead > tr > th {
11161
- background-color: #272727;
11162
- border-bottom: 1px solid #3a3a3a;
11163
- }
11164
- .du-bois-dark-modal .du-bois-dark-table tbody > tr > td {
11165
- border-bottom: 1px solid #3a3a3a;
11166
- }
11167
- .du-bois-dark-modal .du-bois-dark-table tbody > tr > td.du-bois-dark-table-cell-fix-left,
11168
- .du-bois-dark-modal .du-bois-dark-table tbody > tr > td.du-bois-dark-table-cell-fix-right {
11169
- background-color: #1f1f1f;
11170
- }
11171
- .du-bois-dark-modal .du-bois-dark-table tbody > tr.du-bois-dark-table-row:hover > td {
11172
- background: #303030;
11173
- }
11174
- .du-bois-dark-modal .du-bois-dark-table.du-bois-dark-table-bordered .du-bois-dark-table-title {
11175
- border: 1px solid #3a3a3a;
11176
- }
11177
- .du-bois-dark-modal .du-bois-dark-table.du-bois-dark-table-bordered thead > tr > th,
11178
- .du-bois-dark-modal .du-bois-dark-table.du-bois-dark-table-bordered tbody > tr > td,
11179
- .du-bois-dark-modal .du-bois-dark-table.du-bois-dark-table-bordered tfoot > tr > th,
11180
- .du-bois-dark-modal .du-bois-dark-table.du-bois-dark-table-bordered tfoot > tr > td {
11181
- border-right: 1px solid #3a3a3a;
11182
- }
11183
- .du-bois-dark-modal .du-bois-dark-table.du-bois-dark-table-bordered .du-bois-dark-table-cell-fix-right-first::after {
11184
- border-right: 1px solid #3a3a3a;
11185
- }
11186
- .du-bois-dark-modal .du-bois-dark-table.du-bois-dark-table-bordered table thead > tr:not(:last-child) > th {
11187
- border-bottom: 1px solid #303030;
11188
- }
11189
- .du-bois-dark-modal .du-bois-dark-table.du-bois-dark-table-bordered .du-bois-dark-table-container {
11190
- border: 1px solid #3a3a3a;
11191
- }
11192
- .du-bois-dark-modal .du-bois-dark-table.du-bois-dark-table-bordered .du-bois-dark-table-expanded-row-fixed::after {
11193
- border-right: 1px solid #3a3a3a;
11194
- }
11195
- .du-bois-dark-modal .du-bois-dark-table.du-bois-dark-table-bordered .du-bois-dark-table-footer {
11196
- border: 1px solid #3a3a3a;
11197
- }
11198
- .du-bois-dark-modal .du-bois-dark-table .du-bois-dark-table-filter-trigger-container-open {
11199
- background-color: #525252;
11200
- }
11201
- .du-bois-dark-modal .du-bois-dark-picker-calendar-full {
11202
- background-color: #1f1f1f;
11203
- }
11204
- .du-bois-dark-modal .du-bois-dark-picker-calendar-full .du-bois-dark-picker-panel {
11205
- background-color: #1f1f1f;
11206
- }
11207
- .du-bois-dark-modal .du-bois-dark-picker-calendar-full .du-bois-dark-picker-panel .du-bois-dark-picker-calendar-date {
11208
- border-top: 2px solid #3a3a3a;
11209
- }
11210
- .du-bois-dark-modal .du-bois-dark-tabs.du-bois-dark-tabs-card .du-bois-dark-tabs-card-bar .du-bois-dark-tabs-tab-active {
11211
- background-color: #1f1f1f;
11212
- border-bottom: 1px solid #1f1f1f;
11213
- }
11214
- .du-bois-dark-modal .du-bois-dark-badge-count {
11215
- box-shadow: 0 0 0 1px #1f1f1f;
11216
- }
11217
- .du-bois-dark-modal .du-bois-dark-tree-show-line .du-bois-dark-tree-switcher {
11218
- background: #1f1f1f;
11219
- }
11220
- /* stylelint-disable no-duplicate-selectors */
11221
- /* stylelint-disable */
11222
- /* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
11223
-
11224
10914
  /* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
11225
10915
  /* stylelint-disable no-duplicate-selectors */
11226
10916
  /* stylelint-disable */
@@ -16556,125 +16246,254 @@ span.du-bois-dark-typography-ellipsis-single-line {
16556
16246
  --db-color-text-validation-success: #3ba65e;
16557
16247
  --db-color-text-validation-warning: #de7921;
16558
16248
  --db-color-tooltip-background-tooltip: #e8ecf0;
16249
+ --db-color-tooltip-text-tooltip: #11171c;
16559
16250
  }
16560
16251
 
16561
- /* Layout primitive classes — internal Du Bois use for now (not a published
16562
- * consumer API yet; see the Stefan/Sheng weekly decision to "give it a try
16563
- * just within the Du Bois components"). Two primitives, both plain CSS so they
16564
- * ride the mortar cascade like the other component styles:
16565
- *
16566
- * .ds-stack — vertical flow, even gap between direct children.
16567
- * .ds-cluster — horizontal group that wraps, even gap between children.
16568
- *
16569
- * Each primitive exposes a small set of `--ds-*` knobs, defaulted on the class
16570
- * itself (not via a `var()` fallback, which would freeze the default at every
16571
- * call site). Override any of them on the element — inline
16572
- * `style={{ '--ds-stack-gap': ... }}` or a more specific selector — without a
16573
- * new modifier class:
16574
- *
16575
- * stack: --ds-stack-gap (spacing), --ds-stack-align (align-items)
16576
- * cluster: --ds-cluster-gap (spacing), --ds-cluster-align (align-items),
16577
- * --ds-cluster-justify (justify-content)
16578
- *
16579
- * Gap defaults point at the system spacing scale (`--db-space-*`). Padding is
16580
- * intentionally NOT a knob — a layout primitive owns the space between children,
16581
- * not its own box padding. */
16252
+ /*
16253
+ Vertical "stack" of elements.
16254
+ Use this for any layout where items are laid out vertically.
16582
16255
 
16583
- /* Cluster wraps by design: a long row reflows onto multiple lines rather than
16584
- * overflowing. A row that must NOT wrap (e.g. a single-line control strip) is
16585
- * not a cluster — keep it bespoke. */
16256
+ \3c !-- Basic: default gap between each child -->
16257
+ <div class="ds-stack">
16258
+ <h2>Title</h2>
16259
+ <p>Body</p>
16260
+ <button>Action</button>
16261
+ </div>
16586
16262
 
16587
- /* Category-tier tokens shared by selection-control components:
16588
- * <Checkbox>, <Switch>, <Radio>. Each value here references a SYSTEM token
16589
- * from system-tokens.css — never a raw hex/px literal — so the only place a
16590
- * brand-level theme change has to land is the system tier.
16591
- *
16592
- * Component-tier files (e.g. design-system/Checkbox/tokens.css) inherit from
16593
- * these via `var()` so consumers can override a single selection control by
16594
- * targeting only its component tokens. */
16263
+ \3c !-- Wider gap for this instance -->
16264
+ <div class="ds-stack" style="--ds-stack-gap: var(--db-spacing-lg)">…</div>
16595
16265
 
16596
- /* Re-declared under both theme classes as well as :root: these values are
16597
- * `var()` indirections onto SYSTEM tokens, and a custom property resolves its
16598
- * var() at its DECLARATION site. Declared only at :root, they would freeze at
16599
- * the root (light) system values and never re-read the dark system tokens
16600
- * inside a `.du-bois-dark` subtree. Re-declaring at every theme boundary makes
16601
- * the indirection re-resolve per theme. See DUBOIS-448 dark-mode scoping. */
16602
- :where(:root, .du-bois-light, .du-bois-dark) {
16603
- --db-selection-toggle-bg-default: var(--db-color-background-primary);
16604
- --db-selection-toggle-bg-hover: var(--db-color-action-default-background-hover);
16605
- --db-selection-toggle-bg-press: var(--db-color-action-default-background-press);
16606
- --db-selection-toggle-bg-checked: var(--db-color-action-primary-background-default);
16607
- --db-selection-toggle-bg-checked-hover: var(--db-color-action-primary-background-hover);
16608
- --db-selection-toggle-bg-checked-press: var(--db-color-action-primary-background-press);
16609
- --db-selection-toggle-bg-disabled: var(--db-color-action-disabled-background);
16266
+ \3c !-- Don't stretch children to full width (e.g. left-aligned buttons) -->
16267
+ <div class="ds-stack" style="--ds-stack-align: flex-start">…</div>
16268
+ */
16610
16269
 
16611
- --db-selection-toggle-border-default: var(--db-color-action-default-border-default);
16612
- --db-selection-toggle-border-hover: var(--db-color-action-primary-background-hover);
16613
- --db-selection-toggle-border-press: var(--db-color-action-primary-background-press);
16614
- --db-selection-toggle-border-focus: var(--db-color-action-default-border-focus);
16615
- --db-selection-toggle-border-disabled: var(--db-color-action-disabled-border);
16270
+ /**
16271
+ Responsive, horizontal "cluster" of elements.
16272
+ Use this for any layout where items are laid out horizontally and should wrap on smaller viewport sizes.
16616
16273
 
16617
- /* Raw literal, not a system token (exception to the file rule above): the mark
16618
- * sits on the theme-invariant blue checked fill, so it must stay white in BOTH
16619
- * themes. No non-flipping white system token exists — action-primary-icon flips
16620
- * to near-black under .du-bois-dark, which made the mark nearly invisible. */
16621
- --db-selection-toggle-icon-color: #ffffff;
16622
- --db-selection-toggle-icon-color-disabled: var(--db-color-action-disabled-text);
16623
- --db-selection-toggle-text: var(--db-color-text-primary);
16624
- --db-selection-toggle-text-disabled: var(--db-color-action-disabled-text);
16274
+ \3c !-- Basic: items wrap as needed -->
16275
+ <div class="ds-cluster">
16276
+ <span>one</span>
16277
+ <span>two</span>
16278
+ <span>three</span>
16279
+ </div>
16625
16280
 
16626
- --db-selection-toggle-size: 16px;
16627
- --db-selection-toggle-border-radius: var(--db-radius-sm);
16628
- --db-selection-toggle-spacing: var(--db-space-sm);
16281
+ \3c !-- Push children apart (e.g. title left, actions right) -->
16282
+ <div class="ds-cluster" style="--ds-cluster-justify: space-between">…</div>
16283
+
16284
+ \3c !-- Looser gap for this instance -->
16285
+ <div class="ds-cluster" style="--ds-cluster-gap: var(--db-spacing-sm)">…</div>
16286
+ */
16287
+
16288
+
16289
+
16290
+ :where(.du-bois-dark) {
16291
+ /* Neutral */
16292
+ --db-neutral-surface: var(--db-color-background-primary);
16293
+ --db-subtle-neutral-surface: var(--db-color-background-secondary);
16294
+ --db-strong-neutral-surface: initial; /* TODO */
16295
+
16296
+ --db-text-on-neutral-surface: var(--db-color-text-primary);
16297
+ --db-subtle-text-on-neutral-surface: var(--db-color-text-secondary);
16298
+ --db-strong-text-on-neutral-surface: initial; /* TODO */
16299
+
16300
+ --db-neutral-border: var(--db-color-border);
16301
+ --db-subtle-neutral-border: initial; /* TODO */
16302
+ --db-strong-neutral-border: var(--db-color-border-accessible);
16303
+
16304
+ --db-neutral-surface-active: var(--db-color-table-background-selected-default);
16305
+ --db-neutral-surface-hover: var(--db-color-table-background-unselected-hover);
16306
+ --db-neutral-surface-pressed: var(--db-color-table-background-selected-hover);
16307
+ --db-neutral-surface-disabled: var(--db-color-action-disabled-background);
16308
+ --db-text-on-neutral-surface-disabled: var(--db-color-action-disabled-text);
16309
+
16310
+ /* Primary */
16311
+ --db-primary-surface: var(--db-color-action-primary-background-default);
16312
+ --db-subtle-primary-surface: var(--db-color-action-default-background-hover);
16313
+ --db-strong-primary-surface: var(--db-color-action-primary-background-hover);
16314
+
16315
+ --db-text-on-primary-surface: var(--db-color-action-primary-text-default);
16316
+ --db-primary-text-on-neutral-surface: var(--db-color-action-link-default);
16317
+ --db-subtle-text-on-primary-surface: initial; /* TODO */
16318
+ --db-strong-text-on-primary-surface: var(--db-color-action-primary-text-default);
16319
+
16320
+ --db-primary-border: var(--db-color-action-primary-background-default);
16321
+ --db-subtle-primary-border: initial; /* TODO */
16322
+ --db-strong-primary-border: var(--db-color-action-primary-background-press);
16323
+
16324
+ --db-primary-surface-active: initial; /* TODO */
16325
+ --db-primary-surface-hover: var(--db-color-action-primary-background-hover);
16326
+ --db-primary-surface-pressed: var(--db-color-action-primary-background-press);
16327
+ --db-primary-surface-disabled: var(--db-color-action-disabled-background);
16328
+ --db-text-on-primary-surface-disabled: var(--db-color-action-disabled-text);
16329
+
16330
+ /* Error */
16331
+ --db-error-surface: var(--db-color-action-danger-primary-background-default);
16332
+ --db-subtle-error-surface: var(--db-color-background-danger);
16333
+ --db-strong-error-surface: var(--db-color-action-danger-primary-background-hover);
16334
+
16335
+ --db-text-on-error-surface: var(--db-color-action-danger-primary-text);
16336
+ --db-error-text-on-neutral-surface: var(--db-color-text-validation-danger);
16337
+ --db-subtle-text-on-error-surface: initial; /* TODO */
16338
+ --db-strong-text-on-error-surface: var(--db-color-action-danger-primary-text);
16339
+
16340
+ --db-error-border: var(--db-color-action-danger-default-border-default);
16341
+ --db-subtle-error-border: var(--db-color-border-danger);
16342
+ --db-strong-error-border: var(--db-color-action-danger-primary-background-press);
16343
+
16344
+ --db-error-surface-active: initial; /* TODO */
16345
+ --db-error-surface-hover: var(--db-color-action-danger-primary-background-hover);
16346
+ --db-error-surface-pressed: var(--db-color-action-danger-primary-background-press);
16347
+ --db-error-surface-disabled: var(--db-color-action-disabled-background);
16348
+ --db-text-on-error-surface-disabled: var(--db-color-action-disabled-text);
16349
+
16350
+ /* Warning */
16351
+ --db-warning-surface: initial; /* TODO */
16352
+ --db-subtle-warning-surface: var(--db-color-background-warning);
16353
+
16354
+ --db-text-on-warning-surface: initial; /* TODO */
16355
+ --db-warning-text-on-neutral-surface: var(--db-color-text-validation-warning);
16356
+
16357
+ --db-warning-border: var(--db-color-border-warning);
16358
+
16359
+ /* Success */
16360
+ --db-success-surface: initial; /* TODO */
16361
+ --db-subtle-success-surface: var(--db-color-background-success);
16362
+
16363
+ --db-text-on-success-surface: initial; /* TODO */
16364
+ --db-success-text-on-neutral-surface: var(--db-color-text-validation-success);
16365
+
16366
+ --db-success-border: initial; /* TODO */
16367
+ }
16368
+
16369
+ :where(.du-bois-dark) {
16370
+ --db-layout-unit: 0.25rem; /* 4px */
16371
+ --db-density-scalar: 1;
16372
+ --db-size-scalar: 1;
16373
+ --db-spacing-scalar: 1;
16374
+
16375
+ /* Size and spacing are the same steps, but with their own scalars included in the calc. */
16376
+
16377
+ --db-size-3xs: calc(var(--db-layout-unit) * 1 * var(--db-density-scalar) * var(--db-size-scalar)); /* 4px */
16378
+ --db-size-2xs: calc(var(--db-layout-unit) * 2 * var(--db-density-scalar) * var(--db-size-scalar)); /* 8px */
16379
+ --db-size-xs: calc(var(--db-layout-unit) * 4 * var(--db-density-scalar) * var(--db-size-scalar)); /* 16px */
16380
+ --db-size-sm: calc(var(--db-layout-unit) * 6 * var(--db-density-scalar) * var(--db-size-scalar)); /* 24px */
16381
+ --db-size-md: calc(var(--db-layout-unit) * 8 * var(--db-density-scalar) * var(--db-size-scalar)); /* 32px */
16382
+ --db-size-lg: calc(var(--db-layout-unit) * 10 * var(--db-density-scalar) * var(--db-size-scalar)); /* 40px */
16383
+
16384
+ --db-spacing-3xs: calc(var(--db-layout-unit) * 1 * var(--db-density-scalar) * var(--db-spacing-scalar)); /* 4px */
16385
+ --db-spacing-2xs: calc(var(--db-layout-unit) * 2 * var(--db-density-scalar) * var(--db-spacing-scalar)); /* 8px */
16386
+ --db-spacing-xs: calc(var(--db-layout-unit) * 4 * var(--db-density-scalar) * var(--db-spacing-scalar)); /* 16px */
16387
+ --db-spacing-sm: calc(var(--db-layout-unit) * 6 * var(--db-density-scalar) * var(--db-spacing-scalar)); /* 24px */
16388
+ --db-spacing-md: calc(var(--db-layout-unit) * 8 * var(--db-density-scalar) * var(--db-spacing-scalar)); /* 32px */
16389
+ --db-spacing-lg: calc(var(--db-layout-unit) * 10 * var(--db-density-scalar) * var(--db-spacing-scalar)); /* 40px */
16390
+ }
16391
+
16392
+ :where(.du-bois-dark) {
16393
+ --db-font-family:
16394
+ "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
16395
+ --db-mono-font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
16396
+
16397
+ --db-font-size-2xs: 0.6875rem; /* 11px */
16398
+ --db-font-size-xs: 0.75rem; /* 12px */
16399
+ --db-font-size-base: 0.8125rem; /* 13px */
16400
+ --db-font-size-md: 0.875rem; /* 14px */
16401
+ --db-font-size-lg: 0.9375rem; /* 15px */
16402
+ --db-font-size-xl: 1rem; /* 16px */
16403
+ --db-font-size-2xl: 1.25rem; /* 20px */
16404
+ --db-font-size-3xl: 1.5rem; /* 24px */
16405
+ --db-font-size-4xl: 2rem; /* 32px */
16406
+
16407
+ /* Du Bois v1 ships 400 and 600 only */
16408
+ --db-font-weight-normal: 400;
16409
+ --db-font-weight-medium: initial; /* TODO */
16410
+ --db-font-weight-semibold: 600;
16411
+ --db-font-weight-bold: initial; /* TODO */
16412
+ }
16413
+
16414
+ :where(.du-bois-dark) {
16415
+ --db-elevation-inset: initial; /* TODO */
16416
+ --db-elevation-low: 0px 2px 3px -1px rgba(0, 0, 0, 0.05), 0px 1px 0px 0px rgba(0, 0, 0, 0.02);
16417
+ --db-elevation-med: 0px 2px 16px 0px rgba(0, 0, 0, 0.08);
16418
+ --db-elevation-high: 0px 8px 40px 0px rgba(0, 0, 0, 0.13);
16419
+ }
16420
+
16421
+ :where(.du-bois-dark) {
16422
+ --db-focus-ring-color: var(--db-color-action-default-border-focus);
16423
+ --db-focus-ring-width: 2px;
16424
+ }
16425
+
16426
+ :where(.du-bois-dark) {
16427
+ /* Shape */
16428
+ --db-selection-toggle-border-radius: 4px;
16429
+
16430
+ /* Color */
16431
+ --db-selection-toggle-surface: var(--db-neutral-surface);
16432
+ --db-selection-toggle-mark: var(--db-text-on-primary-surface);
16433
+ --db-selection-toggle-text: var(--db-text-on-neutral-surface);
16434
+ --db-selection-toggle-border: var(--db-strong-neutral-border);
16435
+
16436
+ --db-selection-toggle-surface-hover: var(--db-neutral-surface-hover);
16437
+ --db-selection-toggle-surface-press: var(--db-neutral-surface-pressed);
16438
+ --db-selection-toggle-surface-checked: var(--db-primary-surface);
16439
+ --db-selection-toggle-surface-checked-hover: var(--db-primary-surface-hover);
16440
+ --db-selection-toggle-surface-checked-press: var(--db-primary-surface-pressed);
16441
+ --db-selection-toggle-surface-disabled: var(--db-neutral-surface-disabled);
16442
+ --db-selection-toggle-surface-checked-disabled: var(--db-neutral-surface-disabled);
16443
+
16444
+ --db-selection-toggle-border-hover: var(--db-primary-surface-hover);
16445
+ --db-selection-toggle-border-press: var(--db-primary-surface-pressed);
16446
+ --db-selection-toggle-border-disabled: var(--db-neutral-border);
16447
+
16448
+ --db-selection-toggle-mark-disabled: var(--db-text-on-neutral-surface-disabled);
16449
+ --db-selection-toggle-text-disabled: var(--db-text-on-neutral-surface-disabled);
16629
16450
 
16630
- /* Focus ring matches AntD legacy variant; offset keeps it outside the toggle.
16631
- * Hard-coded for now — Figma export doesn't include shadow tokens. */
16632
16451
  --db-selection-toggle-shadow-checked: 0 0 0 1px var(--db-color-action-primary-background-default);
16633
- --db-selection-toggle-focus-ring-width: 2px;
16634
- --db-selection-toggle-focus-ring-offset: 2px;
16452
+
16453
+ /* Density */
16454
+ --db-selection-toggle-size: var(--db-size-xs);
16455
+ --db-selection-toggle-label-spacing: var(--db-spacing-2xs);
16456
+
16457
+ /* Motion */
16635
16458
  --db-selection-toggle-transition-duration: 120ms;
16636
16459
  }
16637
16460
 
16638
- /* Component-tier tokens for <Checkbox>. Each value defaults to a CATEGORY
16639
- * (selection-toggle) token via var(); consumers can override here to retheme
16640
- * checkboxes without affecting switch / radio. */
16641
-
16642
- /* Re-declared under both theme classes (not just :root) so the var() chain onto
16643
- * category/system tokens re-resolves inside a `.du-bois-dark` subtree instead of
16644
- * freezing at the root (light) values. See DUBOIS-448 dark-mode scoping. */
16645
- :where(:root, .du-bois-light, .du-bois-dark) {
16646
- --db-checkbox-size: var(--db-selection-toggle-size);
16461
+ :where(.du-bois-dark) {
16462
+ /* Shape */
16647
16463
  --db-checkbox-border-radius: var(--db-selection-toggle-border-radius);
16648
16464
  --db-checkbox-border-width: 1px;
16649
- --db-checkbox-spacing: var(--db-selection-toggle-spacing);
16650
16465
 
16651
- --db-checkbox-bg-default: var(--db-selection-toggle-bg-default);
16652
- --db-checkbox-bg-hover: var(--db-selection-toggle-bg-hover);
16653
- --db-checkbox-bg-press: var(--db-selection-toggle-bg-press);
16654
- --db-checkbox-bg-checked: var(--db-selection-toggle-bg-checked);
16655
- --db-checkbox-bg-checked-hover: var(--db-selection-toggle-bg-checked-hover);
16656
- --db-checkbox-bg-checked-press: var(--db-selection-toggle-bg-checked-press);
16657
- --db-checkbox-bg-disabled: var(--db-selection-toggle-bg-disabled);
16466
+ /* Color */
16467
+ --db-checkbox-surface: var(--db-selection-toggle-surface);
16468
+ --db-checkbox-surface-hover: var(--db-color-action-default-background-hover);
16469
+ --db-checkbox-surface-press: var(--db-color-action-default-background-press);
16470
+ --db-checkbox-surface-checked: var(--db-selection-toggle-surface-checked);
16471
+ --db-checkbox-surface-checked-hover: var(--db-selection-toggle-surface-checked-hover);
16472
+ --db-checkbox-surface-checked-press: var(--db-selection-toggle-surface-checked-press);
16473
+ --db-checkbox-surface-disabled: var(--db-selection-toggle-surface-disabled);
16658
16474
 
16659
- --db-checkbox-border-default: var(--db-selection-toggle-border-default);
16475
+ --db-checkbox-border: var(--db-color-action-default-border-default);
16660
16476
  --db-checkbox-border-hover: var(--db-selection-toggle-border-hover);
16661
16477
  --db-checkbox-border-press: var(--db-selection-toggle-border-press);
16662
- --db-checkbox-border-focus: var(--db-selection-toggle-border-focus);
16663
- --db-checkbox-border-disabled: var(--db-selection-toggle-border-disabled);
16478
+ --db-checkbox-focus-ring: var(--db-focus-ring-color);
16479
+ --db-checkbox-border-disabled: var(--db-color-action-disabled-border);
16664
16480
 
16665
- --db-checkbox-icon-color: var(--db-selection-toggle-icon-color);
16666
- --db-checkbox-icon-color-disabled: var(--db-selection-toggle-icon-color-disabled);
16481
+ --db-checkbox-mark: #ffffff;
16482
+ --db-checkbox-mark-disabled: var(--db-selection-toggle-mark-disabled);
16667
16483
  --db-checkbox-text: var(--db-selection-toggle-text);
16668
16484
  --db-checkbox-text-disabled: var(--db-selection-toggle-text-disabled);
16669
16485
 
16670
16486
  --db-checkbox-shadow-checked: var(--db-selection-toggle-shadow-checked);
16671
- --db-checkbox-focus-ring-width: var(--db-selection-toggle-focus-ring-width);
16672
- --db-checkbox-focus-ring-offset: var(--db-selection-toggle-focus-ring-offset);
16673
- --db-checkbox-transition-duration: var(--db-selection-toggle-transition-duration);
16674
16487
 
16675
- /* Indeterminate mark — sized to look like AntD's `<inner>` ::after dash. */
16676
- --db-checkbox-indeterminate-mark-width: 8px;
16677
- --db-checkbox-indeterminate-mark-height: 2px;
16488
+ /* Density */
16489
+ --db-checkbox-size: var(--db-selection-toggle-size);
16490
+ --db-checkbox-label-spacing: var(--db-selection-toggle-label-spacing);
16491
+ --db-checkbox-focus-ring-width: var(--db-focus-ring-width);
16492
+ --db-checkbox-indeterminate-mark-width: var(--db-size-2xs); /* 8px */
16493
+ --db-checkbox-indeterminate-mark-height: calc(var(--db-size-3xs) * 0.75); /* 3px */
16494
+
16495
+ /* Motion */
16496
+ --db-checkbox-transition-duration: var(--db-selection-toggle-transition-duration);
16678
16497
  }
16679
16498
 
16680
16499
  /* Native-input <Checkbox> styles. Classic CSS only — no native nesting (the
@@ -16699,10 +16518,9 @@ span.du-bois-dark-typography-ellipsis-single-line {
16699
16518
  * field) inside the label children, and a descendant `input` selector would hide
16700
16519
  * / absolutely-position that field and mis-drive the `:has(…)` state rules. */
16701
16520
 
16702
- /* Hover/press live on the root (label), not on the input: the input has
16703
- * `pointer-events: none` (so a single click target stays on the label and
16704
- * label/input association toggles the box), which means `input:hover` would
16705
- * never match. Putting `:hover` on the root also makes the entire label area
16521
+ /* Hover/press live on the root (label), not on the input: the input is
16522
+ * visually hidden (opacity:0), so an `input:hover` rule wouldn't be visible
16523
+ * anyway. Putting `:hover` on the root also makes the entire label area
16706
16524
  * — not just the indicator square — drive the visual feedback. */
16707
16525
 
16708
16526
  /* Selected fill — checked and indeterminate share the same surface. */
@@ -16715,9 +16533,15 @@ span.du-bois-dark-typography-ellipsis-single-line {
16715
16533
  * `input:disabled` so the standalone-disabled and group-disabled paths both
16716
16534
  * land here without needing a separate root modifier class. */
16717
16535
 
16718
- /* Visually-hidden native input, kept interactive and in the tab order so
16719
- * `:has()` lookups above can read its state. Pointer events fall through to
16720
- * the label, so clicking anywhere toggles the box. */
16536
+ /* Visually-hidden native input (opacity:0) overlaying the indicator square,
16537
+ * kept interactive and in the tab order so `:has()` lookups above can read its
16538
+ * state. It stays pointer-clickable matching AntD's `.ant-checkbox-input`
16539
+ * so it is the top-most hit-test target over the box: `getByRole('checkbox').click()`
16540
+ * (Playwright, and any coordinate click that lands on the box) resolves to the
16541
+ * real control instead of the decorative indicator overlay. Making the input
16542
+ * `pointer-events: none` (the prior native-only behavior) is what regressed
16543
+ * interaction tests vs. the AntD variant. `cursor: inherit` tracks the label's
16544
+ * pointer / disabled `not-allowed` cursor so the box keeps AntD's cursor too. */
16721
16545
 
16722
16546
  /* Indicator — square with the border/fill that responds to state above.
16723
16547
  * Vertical math: aligns the indicator to the cap-height of the first text
@@ -16761,73 +16585,42 @@ span.du-bois-dark-typography-ellipsis-single-line {
16761
16585
 
16762
16586
  /* Vertical: .ds-stack supplies flex-direction + gap; we only retarget the knob. */
16763
16587
 
16764
- /* Component-tier tokens for <Radio>. Each value defaults to a CATEGORY
16765
- * (selection-toggle) token via var(); consumers can override here to retheme
16766
- * radios without affecting checkbox / switch.
16767
- *
16768
- * Radio differs from Checkbox in two ways: the indicator is a full circle
16769
- * (border-radius) and the "mark" is a filled dot rather than a checkmark/dash. */
16770
-
16771
- /* Re-declared under both theme classes (not just :root) so the var() chain onto
16772
- * category/system tokens re-resolves inside a `.du-bois-dark` subtree instead of
16773
- * freezing at the root (light) values. See DUBOIS-448 dark-mode scoping. */
16774
- :where(:root, .du-bois-light, .du-bois-dark) {
16775
- --db-radio-size: var(--db-selection-toggle-size);
16776
- /* Circle, not a rounded square — the one shape token that does NOT inherit
16777
- * the category (square) radius. */
16588
+ :where(.du-bois-dark) {
16589
+ /* Shape */
16778
16590
  --db-radio-border-radius: var(--db-radius-full);
16779
16591
  --db-radio-border-width: 1px;
16780
- --db-radio-spacing: var(--db-selection-toggle-spacing);
16781
16592
 
16782
- --db-radio-bg-default: var(--db-selection-toggle-bg-default);
16783
- --db-radio-bg-hover: var(--db-selection-toggle-bg-hover);
16784
- --db-radio-bg-press: var(--db-selection-toggle-bg-press);
16785
- --db-radio-bg-checked: var(--db-selection-toggle-bg-checked);
16786
- --db-radio-bg-checked-hover: var(--db-selection-toggle-bg-checked-hover);
16787
- /* AntD checked active/press background is actionDefaultBackgroundPress (NOT the
16788
- * primary press), so this maps to the default press bg category token — see
16789
- * getRadioInputStyles checked active in AntDRadioInternal.tsx. */
16790
- --db-radio-bg-checked-press: var(--db-selection-toggle-bg-press);
16791
- --db-radio-bg-disabled: var(--db-selection-toggle-bg-disabled);
16593
+ /* Color */
16594
+ --db-radio-surface: var(--db-selection-toggle-surface);
16595
+ --db-radio-surface-hover: var(--db-color-action-default-background-hover);
16596
+ --db-radio-surface-press: var(--db-color-action-default-background-press);
16597
+ --db-radio-surface-checked: var(--db-selection-toggle-surface-checked);
16598
+ --db-radio-surface-checked-hover: var(--db-selection-toggle-surface-checked-hover);
16599
+ --db-radio-surface-checked-press: var(--db-color-action-default-background-press);
16600
+ --db-radio-surface-disabled: var(--db-selection-toggle-surface-disabled);
16792
16601
 
16793
- --db-radio-border-default: var(--db-selection-toggle-border-default);
16602
+ --db-radio-border: var(--db-color-action-default-border-default);
16794
16603
  --db-radio-border-hover: var(--db-selection-toggle-border-hover);
16795
16604
  --db-radio-border-press: var(--db-selection-toggle-border-press);
16796
- --db-radio-border-focus: var(--db-selection-toggle-border-focus);
16797
- --db-radio-border-disabled: var(--db-selection-toggle-border-disabled);
16798
-
16799
- /* Two-tone checked hover/press border ring (AntD getRadioInputStyles checked
16800
- * states): the border is a DARKER shade than the fill, not equal to it.
16801
- * - checked hover border = actionPrimaryBackgroundPress (== the press category
16802
- * token, which is action-primary-background-press).
16803
- * - checked press border = actionDefaultBorderPress; no selection-toggle
16804
- * category token equals this color, so reference the system token directly. */
16605
+ --db-radio-border-focus: var(--db-focus-ring-color);
16606
+ --db-radio-border-disabled: var(--db-color-action-disabled-border);
16805
16607
  --db-radio-border-checked-hover: var(--db-selection-toggle-border-press);
16806
16608
  --db-radio-border-checked-press: var(--db-color-action-default-border-press);
16609
+ --db-radio-border-unchecked-focus: var(--db-color-action-primary-background-default);
16610
+ --db-radio-outline-checked-focus: var(--db-color-action-primary-background-default);
16807
16611
 
16808
- /* Unchecked keyboard-focus border (AntD getRadioInputStyles unchecked focus):
16809
- * borderColor = actionPrimaryBackgroundDefault, with NO outline ring. No
16810
- * selection-toggle category token equals this color (the closest is a bg
16811
- * token), so reference the system token directly. */
16812
- --db-radio-border-focus-unchecked: var(--db-color-action-primary-background-default);
16813
- /* Checked focus-visible outline color (AntD: outline 1px solid
16814
- * actionPrimaryBackgroundDefault, outlineOffset 1). */
16815
- --db-radio-focus-outline-checked-color: var(--db-color-action-primary-background-default);
16816
-
16817
- /* The dot. Shares the category icon-color token (white over the filled
16818
- * primary surface) so a retheme moves checkbox checkmark + radio dot together. */
16819
- --db-radio-dot-color: var(--db-selection-toggle-icon-color);
16820
- --db-radio-dot-color-disabled: var(--db-selection-toggle-icon-color-disabled);
16612
+ --db-radio-mark: #ffffff;
16613
+ --db-radio-mark-disabled: var(--db-selection-toggle-mark-disabled);
16821
16614
  --db-radio-text: var(--db-selection-toggle-text);
16822
16615
  --db-radio-text-disabled: var(--db-selection-toggle-text-disabled);
16823
16616
 
16824
- --db-radio-focus-ring-width: var(--db-selection-toggle-focus-ring-width);
16825
- --db-radio-focus-ring-offset: var(--db-selection-toggle-focus-ring-offset);
16826
- --db-radio-transition-duration: var(--db-selection-toggle-transition-duration);
16617
+ /* Density */
16618
+ --db-radio-size: var(--db-selection-toggle-size);
16619
+ --db-radio-label-spacing: var(--db-selection-toggle-label-spacing);
16620
+ --db-radio-mark-size: var(--db-size-3xs);
16827
16621
 
16828
- /* Diameter of the inner dot. Mirrors the AntD checked `::after` size, which uses
16829
- * `theme.spacing.xs` (4px) — see getRadioInputStyles in AntDRadioInternal.tsx. */
16830
- --db-radio-dot-size: var(--db-space-xs);
16622
+ /* Motion */
16623
+ --db-radio-transition-duration: var(--db-selection-toggle-transition-duration);
16831
16624
  }
16832
16625
 
16833
16626
  /* Native-input <Radio> styles. Classic CSS only — no native nesting (the
@@ -16854,9 +16647,9 @@ span.du-bois-dark-typography-ellipsis-single-line {
16854
16647
  * TODO(DUBOIS-452): the indicator/dot state styles below are identical to
16855
16648
  * NativeCheckbox.css — consolidate them into a shared `.ds-selection-toggle` class. */
16856
16649
 
16857
- /* Hover/press live on the root (label), not on the input: the input has
16858
- * `pointer-events: none`, so `input:hover` would never match, and the whole
16859
- * label area should drive the feedback. */
16650
+ /* Hover/press live on the root (label), not on the input: the input is
16651
+ * visually hidden (opacity:0), so an `input:hover` rule wouldn't be visible
16652
+ * anyway, and the whole label area should drive the feedback. */
16860
16653
 
16861
16654
  /* Selected fill. */
16862
16655
 
@@ -16881,9 +16674,15 @@ span.du-bois-dark-typography-ellipsis-single-line {
16881
16674
  /* Disabled (covers checked and unchecked). Sourced from `input:disabled` so the
16882
16675
  * standalone-disabled and group-disabled paths both land here. */
16883
16676
 
16884
- /* Visually-hidden native input, kept interactive and in the tab order so the
16885
- * `:has()` lookups above can read its state. Pointer events fall through to the
16886
- * label, so clicking anywhere toggles the radio. */
16677
+ /* Visually-hidden native input (opacity:0) overlaying the indicator circle,
16678
+ * kept interactive and in the tab order so the `:has()` lookups above can read
16679
+ * its state. It stays pointer-clickable matching AntD's `.ant-radio-input`
16680
+ * so it is the top-most hit-test target over the circle: `getByRole('radio').click()`
16681
+ * (Playwright, and any coordinate click that lands on the circle) resolves to the
16682
+ * real control instead of the decorative indicator overlay. Making the input
16683
+ * `pointer-events: none` (the prior native-only behavior) is what regressed
16684
+ * interaction tests vs. the AntD variant. `cursor: inherit` tracks the label's
16685
+ * pointer / disabled `not-allowed` cursor so the circle keeps AntD's cursor too. */
16887
16686
 
16888
16687
  /* Indicator — circle with the border/fill that responds to state above.
16889
16688
  * Vertical math aligns the indicator to the cap-height of the first text line
@@ -16954,68 +16753,58 @@ span.du-bois-dark-typography-ellipsis-single-line {
16954
16753
  /* AntD `&& + form-message { marginTop: sm }` (horizontal): a form-message following
16955
16754
  * the whole group is separated by sm. */
16956
16755
 
16957
- /* Component-tier tokens for <Switch>. Colors default to the selection-toggle category tokens;
16958
- * geometry is hand-authored (the pill track + sliding thumb are unique to Switch). */
16959
-
16960
- /* Re-declared under both theme classes (not just :root) so the var() chain onto
16961
- * category/system tokens re-resolves inside a `.du-bois-dark` subtree instead of
16962
- * freezing at the root (light) values. See DUBOIS-448 dark-mode scoping. */
16963
- :where(:root, .du-bois-light, .du-bois-dark) {
16964
- --db-switch-track-width: 28px;
16965
- --db-switch-track-height: 16px;
16966
- /* Thumb fills the track height by design; expressed via track-height so the two can't drift. */
16967
- --db-switch-thumb-size: var(--db-switch-track-height);
16968
- /* Pill radius overrides the category (square) radius, mirroring Radio's circular override. */
16756
+ :where(.du-bois-dark) {
16757
+ /* Shape */
16969
16758
  --db-switch-border-radius: var(--db-radius-full);
16970
16759
  --db-switch-border-width: 1px;
16971
- --db-switch-spacing: var(--db-selection-toggle-spacing);
16972
16760
 
16973
- --db-switch-bg-default: var(--db-selection-toggle-bg-default);
16974
- --db-switch-bg-hover: var(--db-selection-toggle-bg-hover);
16975
- --db-switch-bg-press: var(--db-selection-toggle-bg-press);
16976
- --db-switch-bg-checked: var(--db-selection-toggle-bg-checked);
16977
- --db-switch-bg-checked-hover: var(--db-selection-toggle-bg-checked-hover);
16978
- --db-switch-bg-checked-press: var(--db-selection-toggle-bg-checked-press);
16979
- --db-switch-bg-disabled: var(--db-selection-toggle-bg-disabled);
16761
+ /* Color */
16762
+ --db-switch-surface: var(--db-selection-toggle-surface);
16763
+ --db-switch-surface-hover: var(--db-color-action-default-background-hover);
16764
+ --db-switch-surface-press: var(--db-color-action-default-background-press);
16765
+ --db-switch-surface-checked: var(--db-selection-toggle-surface-checked);
16766
+ --db-switch-surface-checked-hover: var(--db-selection-toggle-surface-checked-hover);
16767
+ --db-switch-surface-checked-press: var(--db-selection-toggle-surface-checked-press);
16768
+ --db-switch-surface-disabled: var(--db-selection-toggle-surface-disabled);
16769
+ --db-switch-surface-checked-disabled: var(--db-color-action-disabled-text);
16980
16770
 
16981
- --db-switch-border-default: var(--db-selection-toggle-border-default);
16771
+ --db-switch-border: var(--db-color-action-default-border-default);
16982
16772
  --db-switch-border-hover: var(--db-selection-toggle-border-hover);
16983
16773
  --db-switch-border-press: var(--db-selection-toggle-border-press);
16984
- --db-switch-border-disabled: var(--db-selection-toggle-border-disabled);
16985
- /* AntD paints the checked track border equal to the checked fill, so these alias the checked bg. */
16986
- --db-switch-border-checked: var(--db-selection-toggle-bg-checked);
16987
- --db-switch-border-checked-hover: var(--db-selection-toggle-bg-checked-hover);
16988
- --db-switch-border-checked-press: var(--db-selection-toggle-bg-checked-press);
16989
- --db-switch-border-focus: var(--db-selection-toggle-bg-checked);
16990
- /* AntD fills the disabled+checked track with actionDisabledText; no category token matches, so
16991
- * reference the system token directly (same escape hatch Radio uses for its checked-press border). */
16992
- --db-switch-bg-checked-disabled: var(--db-color-action-disabled-text);
16774
+ --db-switch-border-disabled: var(--db-color-action-disabled-border);
16775
+ --db-switch-border-checked: var(--db-selection-toggle-surface-checked);
16776
+ --db-switch-border-checked-hover: var(--db-selection-toggle-surface-checked-hover);
16777
+ --db-switch-border-checked-press: var(--db-selection-toggle-surface-checked-press);
16778
+ --db-switch-border-focus: var(--db-selection-toggle-surface-checked);
16993
16779
 
16994
- /* AntD paints the handle the off-track surface color in every state. */
16995
- --db-switch-thumb-color: var(--db-selection-toggle-bg-default);
16780
+ --db-switch-thumb: var(--db-selection-toggle-surface);
16996
16781
 
16997
- /* A token (not inherit) so the label text flips in dark mode. */
16998
- --db-switch-text: var(--db-color-text-primary);
16782
+ --db-switch-text: var(--db-selection-toggle-text);
16999
16783
  --db-switch-text-disabled: var(--db-selection-toggle-text-disabled);
17000
16784
 
17001
- /* AntD's focus ring is a 1px outline (the category default is 2px). */
17002
- --db-switch-focus-ring-width: 1px;
17003
- --db-switch-focus-ring-offset: 1px;
17004
- --db-switch-focus-ring-color: var(--db-selection-toggle-border-focus);
16785
+ /* Density */
16786
+ --db-switch-track-width: calc(var(--db-size-xs) * 1.75); /* 28px */
16787
+ --db-switch-track-height: var(--db-size-xs); /* 16px */
16788
+ --db-switch-thumb-size: var(--db-switch-track-height);
16789
+ --db-switch-label-spacing: var(--db-selection-toggle-label-spacing);
16790
+
16791
+ /* Motion */
17005
16792
  --db-switch-transition-duration: var(--db-selection-toggle-transition-duration);
17006
16793
  }
17007
16794
 
17008
- /* Hover/press live on the root (label), not the input: the input has `pointer-events: none`. */
16795
+ /* The track. `appearance: none` strips the native checkbox rendering so the input itself can be styled. */
17009
16796
 
17010
- /* On focus, recolor the track border to the checked-fill color on top of the outline ring. Matching
17011
- * AntD, the ring sits flush when off and gains a 1px offset when checked (see the checked rule below). */
16797
+ /* The thumb. A pseudo-element keeps the input the switch's only element, so nothing can overlay it
16798
+ * and intercept clicks. Offset left by the border width to sit flush with the track's outer edge. */
17012
16799
 
17013
- /* Disabled + on: more specific than the plain disabled rule, so it wins regardless of source order. */
16800
+ /* `<label for>` propagates `:hover` to the input, so scope hover/press to the control, not `input:hover`. */
17014
16801
 
17015
- /* Hidden but still focusable/in tab order so `:has()` can read its state; pointer events fall through
17016
- * to the label. */
16802
+ /* On focus, recolor the border to the checked-fill color on top of the outline ring. Matching AntD,
16803
+ * the ring sits flush when off and gains a 1px offset when checked.
16804
+ * TODO: width/offset are hardcoded 1px to preserve the AntD look; adopt the system 2px focus ring
16805
+ * (var(--db-focus-ring-width)) in a separate change. */
17017
16806
 
17018
- /* `border-color: inherit` picks up the track's per-state color, so it's only set on the track. */
16807
+ /* Disabled + on: more specific than the plain disabled rule, so it wins regardless of source order. */
17019
16808
 
17020
16809
  /* `:first-child` scopes this to the label-first layout; the plain layout renders the label last. */
17021
16810