@allxsmith/bestax-bulma 5.37.0 → 5.38.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.
Files changed (90) hide show
  1. package/dist/bestax.css +1 -1
  2. package/dist/bestax.css.map +1 -1
  3. package/dist/esm/components/Card.js +2 -2
  4. package/dist/esm/components/Carousel.js +14 -6
  5. package/dist/esm/components/Carousel.js.map +1 -1
  6. package/dist/esm/components/Dropdown.js +7 -2
  7. package/dist/esm/components/Dropdown.js.map +1 -1
  8. package/dist/esm/components/Loading.js +7 -1
  9. package/dist/esm/components/Loading.js.map +1 -1
  10. package/dist/esm/components/Panel.js +34 -4
  11. package/dist/esm/components/Panel.js.map +1 -1
  12. package/dist/esm/components/Popover.js +7 -2
  13. package/dist/esm/components/Popover.js.map +1 -1
  14. package/dist/esm/components/Sidebar.js +46 -17
  15. package/dist/esm/components/Sidebar.js.map +1 -1
  16. package/dist/esm/elements/Button.js.map +1 -1
  17. package/dist/esm/elements/ToggleButton.js.map +1 -1
  18. package/dist/esm/form/Autocomplete.js +28 -18
  19. package/dist/esm/form/Autocomplete.js.map +1 -1
  20. package/dist/esm/form/Combobox.js +592 -0
  21. package/dist/esm/form/Combobox.js.map +1 -0
  22. package/dist/esm/form/Field.js +3 -3
  23. package/dist/esm/form/Field.js.map +1 -1
  24. package/dist/esm/form/_pickerInternals/PickerPopover.js +10 -5
  25. package/dist/esm/form/_pickerInternals/PickerPopover.js.map +1 -1
  26. package/dist/esm/form/useAutoLabelId.js.map +1 -1
  27. package/dist/esm/helpers/Theme.js.map +1 -1
  28. package/dist/esm/helpers/useAnchoredPosition.js +35 -6
  29. package/dist/esm/helpers/useAnchoredPosition.js.map +1 -1
  30. package/dist/esm/helpers/useComboboxEngine.js +331 -0
  31. package/dist/esm/helpers/useComboboxEngine.js.map +1 -0
  32. package/dist/esm/helpers/useFocusTrap.js +87 -49
  33. package/dist/esm/helpers/useFocusTrap.js.map +1 -1
  34. package/dist/esm/helpers/useInertSiblings.js +106 -0
  35. package/dist/esm/helpers/useInertSiblings.js.map +1 -0
  36. package/dist/esm/helpers/useTreeView.js +2 -2
  37. package/dist/esm/layout/Container.js +2 -2
  38. package/dist/esm/layout/Container.js.map +1 -1
  39. package/dist/esm/layout/Hero.js +6 -6
  40. package/dist/esm/layout/Hero.js.map +1 -1
  41. package/dist/extras.css +1 -1
  42. package/dist/extras.css.map +1 -1
  43. package/dist/index.cjs +1504 -351
  44. package/dist/index.cjs.map +1 -1
  45. package/dist/index.esm.js +1 -0
  46. package/dist/index.esm.js.map +1 -1
  47. package/dist/types/components/Loading.d.ts +16 -2
  48. package/dist/types/components/Panel.d.ts +45 -5
  49. package/dist/types/components/Sidebar.d.ts +17 -2
  50. package/dist/types/elements/Button.d.ts +2 -1
  51. package/dist/types/elements/ToggleButton.d.ts +3 -2
  52. package/dist/types/form/Combobox.d.ts +416 -0
  53. package/dist/types/form/Field.d.ts +5 -5
  54. package/dist/types/form/useAutoLabelId.d.ts +3 -2
  55. package/dist/types/helpers/Theme.d.ts +6 -0
  56. package/dist/types/helpers/useAnchoredPosition.d.ts +25 -2
  57. package/dist/types/helpers/useComboboxEngine.d.ts +111 -0
  58. package/dist/types/helpers/useFocusTrap.d.ts +15 -2
  59. package/dist/types/helpers/useInertSiblings.d.ts +30 -0
  60. package/dist/types/index.d.ts +1 -0
  61. package/dist/types/layout/Container.d.ts +9 -1
  62. package/dist/types/layout/Hero.d.ts +27 -2
  63. package/dist/types-cjs/components/Loading.d.ts +16 -2
  64. package/dist/types-cjs/components/Panel.d.ts +45 -5
  65. package/dist/types-cjs/components/Sidebar.d.ts +17 -2
  66. package/dist/types-cjs/elements/Button.d.ts +2 -1
  67. package/dist/types-cjs/elements/ToggleButton.d.ts +3 -2
  68. package/dist/types-cjs/form/Combobox.d.ts +416 -0
  69. package/dist/types-cjs/form/Field.d.ts +5 -5
  70. package/dist/types-cjs/form/useAutoLabelId.d.ts +3 -2
  71. package/dist/types-cjs/helpers/Theme.d.ts +6 -0
  72. package/dist/types-cjs/helpers/useAnchoredPosition.d.ts +25 -2
  73. package/dist/types-cjs/helpers/useComboboxEngine.d.ts +111 -0
  74. package/dist/types-cjs/helpers/useFocusTrap.d.ts +15 -2
  75. package/dist/types-cjs/helpers/useInertSiblings.d.ts +30 -0
  76. package/dist/types-cjs/index.d.ts +1 -0
  77. package/dist/types-cjs/layout/Container.d.ts +9 -1
  78. package/dist/types-cjs/layout/Hero.d.ts +27 -2
  79. package/dist/versions/bestax-no-dark-mode.css +1 -1
  80. package/dist/versions/bestax-no-dark-mode.css.map +1 -1
  81. package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
  82. package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
  83. package/dist/versions/bestax-no-helpers.css +1 -1
  84. package/dist/versions/bestax-no-helpers.css.map +1 -1
  85. package/dist/versions/bestax-prefixed.css +1 -1
  86. package/dist/versions/bestax-prefixed.css.map +1 -1
  87. package/package.json +1 -1
  88. package/src/scss/elements/_loader.scss +79 -0
  89. package/src/scss/form/_combobox.scss +323 -0
  90. package/src/scss/form/_index.scss +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"Theme.js","sources":["../../../src/helpers/Theme.tsx"],"sourcesContent":["import React, {\n useEffect,\n useMemo,\n useState,\n ReactNode,\n CSSProperties,\n} from 'react';\nimport classNames from './classNames';\nimport { useBulmaClasses, BulmaClassesProps } from './useBulmaClasses';\nimport { validGaps, validRadii, type BulmaGapStep } from './bulmaClassHelpers';\nimport { isDev, warnOnce } from './devWarnings';\nimport { useClassPrefix } from './Config';\n\n// --- Bulma v1 CSS variables Theme sets (originally generated from\n// CSSVAR_KEYS), in two lists by where Bulma declares them ---\n\n/**\n * Variables a value set on an ancestor reaches. Bulma declares them on\n * `:root` (or a theme scope), or on no component in its plain state, so the\n * value Theme writes on its wrapper or at `:root` is the one the components\n * under it use.\n */\nconst bulmaGlobalVars = [\n // scheme\n '--bulma-scheme-h',\n '--bulma-scheme-s',\n '--bulma-scheme-main',\n '--bulma-scheme-main-bis',\n '--bulma-scheme-main-ter',\n '--bulma-scheme-invert',\n '--bulma-scheme-invert-bis',\n '--bulma-scheme-invert-ter',\n '--bulma-light-l',\n '--bulma-light-invert-l',\n '--bulma-dark-l',\n '--bulma-dark-invert-l',\n '--bulma-soft-l',\n '--bulma-bold-l',\n '--bulma-soft-invert-l',\n '--bulma-bold-invert-l',\n '--bulma-hover-background-l-delta',\n '--bulma-active-background-l-delta',\n '--bulma-hover-border-l-delta',\n '--bulma-active-border-l-delta',\n '--bulma-hover-color-l-delta',\n '--bulma-active-color-l-delta',\n '--bulma-hover-shadow-a-delta',\n '--bulma-active-shadow-a-delta',\n // colors\n '--bulma-primary-h',\n '--bulma-primary-s',\n '--bulma-primary-l',\n '--bulma-link-h',\n '--bulma-link-s',\n '--bulma-link-l',\n '--bulma-info-h',\n '--bulma-info-s',\n '--bulma-info-l',\n '--bulma-success-h',\n '--bulma-success-s',\n '--bulma-success-l',\n '--bulma-warning-h',\n '--bulma-warning-s',\n '--bulma-warning-l',\n '--bulma-danger-h',\n '--bulma-danger-s',\n '--bulma-danger-l',\n // shadow (the upstream token .box/.card/.dropdown/.panel derive their own\n // shadow variables from; overriding it from an ancestor is the route that\n // cascades, since those selectors re-declare their derived var on\n // themselves)\n '--bulma-shadow-h',\n '--bulma-shadow-s',\n '--bulma-shadow-l',\n '--bulma-shadow',\n // typography\n '--bulma-family-primary',\n '--bulma-family-secondary',\n '--bulma-family-code',\n '--bulma-size-small',\n '--bulma-size-normal',\n '--bulma-size-medium',\n '--bulma-size-large',\n '--bulma-weight-light',\n '--bulma-weight-normal',\n '--bulma-weight-medium',\n '--bulma-weight-semibold',\n '--bulma-weight-bold',\n '--bulma-weight-extrabold',\n // other\n '--bulma-block-spacing',\n '--bulma-duration',\n '--bulma-easing',\n '--bulma-radius-small',\n '--bulma-radius',\n '--bulma-radius-medium',\n '--bulma-radius-large',\n '--bulma-radius-rounded',\n '--bulma-speed',\n '--bulma-arrow-color',\n '--bulma-loading-color',\n '--bulma-burger-h',\n '--bulma-burger-s',\n '--bulma-burger-l',\n '--bulma-burger-border-radius',\n '--bulma-burger-gap',\n '--bulma-burger-item-height',\n '--bulma-burger-item-width',\n // generic\n '--bulma-body-background-color',\n '--bulma-body-size',\n '--bulma-body-min-width',\n '--bulma-body-rendering',\n '--bulma-body-family',\n '--bulma-body-overflow-x',\n '--bulma-body-overflow-y',\n '--bulma-body-color',\n '--bulma-body-font-size',\n '--bulma-body-weight',\n '--bulma-body-line-height',\n '--bulma-code-family',\n '--bulma-code-padding',\n '--bulma-code-weight',\n '--bulma-code-size',\n '--bulma-small-font-size',\n '--bulma-hr-background-color',\n '--bulma-hr-height',\n '--bulma-hr-margin',\n '--bulma-strong-color',\n '--bulma-strong-weight',\n '--bulma-pre-font-size',\n '--bulma-pre-padding',\n '--bulma-pre-code-font-size',\n // skeleton\n '--bulma-skeleton-background',\n '--bulma-skeleton-radius',\n '--bulma-skeleton-block-min-height',\n '--bulma-skeleton-lines-gap',\n '--bulma-skeleton-line-height',\n // control\n '--bulma-control-radius',\n '--bulma-control-radius-small',\n '--bulma-control-border-width',\n '--bulma-control-height',\n '--bulma-control-line-height',\n '--bulma-control-padding-vertical',\n '--bulma-control-padding-horizontal',\n '--bulma-control-size',\n '--bulma-control-focus-shadow-l',\n // columns\n '--bulma-column-gap',\n // grid\n '--bulma-grid-cell-column-start',\n] as const;\n\n/**\n * Variables Bulma declares on the component's own element, such as\n * `--bulma-card-radius` on `.card`. An element that declares a variable uses\n * its own value whatever its ancestors set, so a value Theme writes for one\n * of these, on its wrapper or at `:root`, never reaches the component.\n *\n * They stay in `BulmaVars`, and so stay valid `bulmaVars` keys and variable\n * props, because taking a key out would be a breaking change. Setting one\n * warns in development instead; see `warnComponentVars`.\n *\n * `scripts/css-var-scopes.test.mjs` holds this split to Bulma's compiled\n * stylesheet in both directions, so a Bulma upgrade that moves a variable\n * fails there.\n */\nconst bulmaComponentVars = [\n // breadcrumb\n '--bulma-breadcrumb-item-color',\n '--bulma-breadcrumb-item-hover-color',\n '--bulma-breadcrumb-item-active-color',\n '--bulma-breadcrumb-item-padding-vertical',\n '--bulma-breadcrumb-item-padding-horizontal',\n '--bulma-breadcrumb-item-separator-color',\n // card\n '--bulma-card-color',\n '--bulma-card-background-color',\n '--bulma-card-shadow',\n '--bulma-card-radius',\n '--bulma-card-header-background-color',\n '--bulma-card-header-color',\n '--bulma-card-header-padding',\n '--bulma-card-header-shadow',\n '--bulma-card-header-weight',\n '--bulma-card-content-background-color',\n '--bulma-card-content-padding',\n '--bulma-card-footer-background-color',\n '--bulma-card-footer-border-top',\n '--bulma-card-footer-padding',\n '--bulma-card-media-margin',\n // dropdown\n '--bulma-dropdown-menu-min-width',\n '--bulma-dropdown-content-background-color',\n '--bulma-dropdown-content-offset',\n '--bulma-dropdown-content-padding-bottom',\n '--bulma-dropdown-content-padding-top',\n '--bulma-dropdown-content-radius',\n '--bulma-dropdown-content-shadow',\n '--bulma-dropdown-content-z',\n '--bulma-dropdown-item-h',\n '--bulma-dropdown-item-s',\n '--bulma-dropdown-item-l',\n '--bulma-dropdown-item-background-l',\n '--bulma-dropdown-item-background-l-delta',\n '--bulma-dropdown-item-hover-background-l-delta',\n '--bulma-dropdown-item-active-background-l-delta',\n '--bulma-dropdown-item-color-l',\n '--bulma-dropdown-item-selected-h',\n '--bulma-dropdown-item-selected-s',\n '--bulma-dropdown-item-selected-l',\n '--bulma-dropdown-item-selected-background-l',\n '--bulma-dropdown-item-selected-color-l',\n '--bulma-dropdown-divider-background-color',\n // menu\n '--bulma-menu-item-h',\n '--bulma-menu-item-s',\n '--bulma-menu-item-l',\n '--bulma-menu-item-background-l',\n '--bulma-menu-item-background-l-delta',\n '--bulma-menu-item-hover-background-l-delta',\n '--bulma-menu-item-active-background-l-delta',\n '--bulma-menu-item-color-l',\n '--bulma-menu-item-radius',\n '--bulma-menu-item-selected-h',\n '--bulma-menu-item-selected-s',\n '--bulma-menu-item-selected-l',\n '--bulma-menu-item-selected-background-l',\n '--bulma-menu-item-selected-color-l',\n '--bulma-menu-list-border-left',\n '--bulma-menu-list-line-height',\n '--bulma-menu-list-link-padding',\n '--bulma-menu-nested-list-margin',\n '--bulma-menu-nested-list-padding-left',\n '--bulma-menu-label-color',\n '--bulma-menu-label-font-size',\n '--bulma-menu-label-letter-spacing',\n '--bulma-menu-label-spacing',\n // message\n '--bulma-message-h',\n '--bulma-message-s',\n '--bulma-message-background-l',\n '--bulma-message-border-l',\n '--bulma-message-border-l-delta',\n '--bulma-message-border-style',\n '--bulma-message-border-width',\n '--bulma-message-color-l',\n '--bulma-message-radius',\n '--bulma-message-header-weight',\n '--bulma-message-header-padding',\n '--bulma-message-header-radius',\n '--bulma-message-header-body-border-width',\n '--bulma-message-header-background-l',\n '--bulma-message-header-color-l',\n '--bulma-message-body-border-width',\n '--bulma-message-body-color',\n '--bulma-message-body-padding',\n '--bulma-message-body-radius',\n '--bulma-message-body-pre-code-background-color',\n // modal\n '--bulma-modal-z',\n '--bulma-modal-background-background-color',\n '--bulma-modal-content-width',\n '--bulma-modal-content-margin-mobile',\n '--bulma-modal-content-spacing-mobile',\n '--bulma-modal-content-spacing-tablet',\n '--bulma-modal-close-dimensions',\n '--bulma-modal-close-right',\n '--bulma-modal-close-top',\n '--bulma-modal-card-spacing',\n '--bulma-modal-card-head-background-color',\n '--bulma-modal-card-head-padding',\n '--bulma-modal-card-head-radius',\n '--bulma-modal-card-title-color',\n '--bulma-modal-card-title-line-height',\n '--bulma-modal-card-title-size',\n '--bulma-modal-card-foot-background-color',\n '--bulma-modal-card-foot-radius',\n '--bulma-modal-card-body-background-color',\n '--bulma-modal-card-body-padding',\n // navbar\n '--bulma-navbar-h',\n '--bulma-navbar-s',\n '--bulma-navbar-l',\n '--bulma-navbar-background-color',\n '--bulma-navbar-box-shadow-size',\n '--bulma-navbar-box-shadow-color',\n '--bulma-navbar-padding-vertical',\n '--bulma-navbar-padding-horizontal',\n '--bulma-navbar-z',\n '--bulma-navbar-fixed-z',\n '--bulma-navbar-item-background-a',\n '--bulma-navbar-item-background-l',\n '--bulma-navbar-item-background-l-delta',\n '--bulma-navbar-item-hover-background-l-delta',\n '--bulma-navbar-item-active-background-l-delta',\n '--bulma-navbar-item-color-l',\n '--bulma-navbar-item-selected-h',\n '--bulma-navbar-item-selected-s',\n '--bulma-navbar-item-selected-l',\n '--bulma-navbar-item-selected-background-l',\n '--bulma-navbar-item-selected-color-l',\n '--bulma-navbar-item-img-max-height',\n '--bulma-navbar-burger-color',\n '--bulma-navbar-tab-hover-background-color',\n '--bulma-navbar-tab-hover-border-bottom-color',\n '--bulma-navbar-tab-active-color',\n '--bulma-navbar-tab-active-background-color',\n '--bulma-navbar-tab-active-border-bottom-color',\n '--bulma-navbar-tab-active-border-bottom-style',\n '--bulma-navbar-tab-active-border-bottom-width',\n '--bulma-navbar-dropdown-background-color',\n '--bulma-navbar-dropdown-border-l',\n '--bulma-navbar-dropdown-border-color',\n '--bulma-navbar-dropdown-border-style',\n '--bulma-navbar-dropdown-border-width',\n '--bulma-navbar-dropdown-offset',\n '--bulma-navbar-dropdown-arrow',\n '--bulma-navbar-dropdown-radius',\n '--bulma-navbar-dropdown-z',\n '--bulma-navbar-dropdown-boxed-radius',\n '--bulma-navbar-dropdown-boxed-shadow',\n '--bulma-navbar-dropdown-item-h',\n '--bulma-navbar-dropdown-item-s',\n '--bulma-navbar-dropdown-item-l',\n '--bulma-navbar-dropdown-item-background-l',\n '--bulma-navbar-dropdown-item-color-l',\n '--bulma-navbar-divider-background-l',\n '--bulma-navbar-divider-height',\n '--bulma-navbar-bottom-box-shadow-size',\n // pagination\n '--bulma-pagination-margin',\n '--bulma-pagination-min-width',\n '--bulma-pagination-item-h',\n '--bulma-pagination-item-s',\n '--bulma-pagination-item-l',\n '--bulma-pagination-item-background-l-delta',\n '--bulma-pagination-item-hover-background-l-delta',\n '--bulma-pagination-item-active-background-l-delta',\n '--bulma-pagination-item-border-style',\n '--bulma-pagination-item-border-width',\n '--bulma-pagination-item-border-l',\n '--bulma-pagination-item-border-l-delta',\n '--bulma-pagination-item-hover-border-l-delta',\n '--bulma-pagination-item-active-border-l-delta',\n '--bulma-pagination-item-focus-border-l-delta',\n '--bulma-pagination-item-color-l',\n '--bulma-pagination-item-font-size',\n '--bulma-pagination-item-margin',\n '--bulma-pagination-item-padding-left',\n '--bulma-pagination-item-padding-right',\n '--bulma-pagination-item-outer-shadow-h',\n '--bulma-pagination-item-outer-shadow-s',\n '--bulma-pagination-item-outer-shadow-l',\n '--bulma-pagination-item-outer-shadow-a',\n '--bulma-pagination-nav-padding-left',\n '--bulma-pagination-nav-padding-right',\n '--bulma-pagination-disabled-color',\n '--bulma-pagination-disabled-background-color',\n '--bulma-pagination-disabled-border-color',\n '--bulma-pagination-current-color',\n '--bulma-pagination-current-background-color',\n '--bulma-pagination-current-border-color',\n '--bulma-pagination-ellipsis-color',\n '--bulma-pagination-shadow-inset',\n '--bulma-pagination-selected-item-h',\n '--bulma-pagination-selected-item-s',\n '--bulma-pagination-selected-item-l',\n '--bulma-pagination-selected-item-background-l',\n '--bulma-pagination-selected-item-border-l',\n '--bulma-pagination-selected-item-color-l',\n // panel\n '--bulma-panel-margin',\n '--bulma-panel-item-border',\n '--bulma-panel-radius',\n '--bulma-panel-shadow',\n '--bulma-panel-heading-line-height',\n '--bulma-panel-heading-padding',\n '--bulma-panel-heading-radius',\n '--bulma-panel-heading-size',\n '--bulma-panel-heading-weight',\n '--bulma-panel-tabs-font-size',\n '--bulma-panel-tab-border-bottom-color',\n '--bulma-panel-tab-border-bottom-style',\n '--bulma-panel-tab-border-bottom-width',\n '--bulma-panel-tab-active-color',\n '--bulma-panel-list-item-color',\n '--bulma-panel-list-item-hover-color',\n '--bulma-panel-block-color',\n '--bulma-panel-block-hover-background-color',\n '--bulma-panel-block-active-border-left-color',\n '--bulma-panel-block-active-color',\n '--bulma-panel-block-active-icon-color',\n '--bulma-panel-icon-color',\n // tabs\n '--bulma-tabs-border-bottom-color',\n '--bulma-tabs-border-bottom-style',\n '--bulma-tabs-border-bottom-width',\n '--bulma-tabs-link-color',\n '--bulma-tabs-link-hover-border-bottom-color',\n '--bulma-tabs-link-hover-color',\n '--bulma-tabs-link-active-border-bottom-color',\n '--bulma-tabs-link-active-color',\n '--bulma-tabs-link-padding',\n '--bulma-tabs-boxed-link-radius',\n '--bulma-tabs-boxed-link-hover-background-color',\n '--bulma-tabs-boxed-link-hover-border-bottom-color',\n '--bulma-tabs-boxed-link-active-background-color',\n '--bulma-tabs-boxed-link-active-border-color',\n '--bulma-tabs-boxed-link-active-border-bottom-color',\n '--bulma-tabs-toggle-link-border-color',\n '--bulma-tabs-toggle-link-border-style',\n '--bulma-tabs-toggle-link-border-width',\n '--bulma-tabs-toggle-link-hover-background-color',\n '--bulma-tabs-toggle-link-hover-border-color',\n '--bulma-tabs-toggle-link-radius',\n '--bulma-tabs-toggle-link-active-background-color',\n '--bulma-tabs-toggle-link-active-border-color',\n '--bulma-tabs-toggle-link-active-color',\n // box\n '--bulma-box-background-color',\n '--bulma-box-color',\n '--bulma-box-radius',\n '--bulma-box-shadow',\n '--bulma-box-padding',\n '--bulma-box-link-hover-shadow',\n '--bulma-box-link-active-shadow',\n // content\n '--bulma-content-heading-color',\n '--bulma-content-heading-weight',\n '--bulma-content-heading-line-height',\n '--bulma-content-block-margin-bottom',\n '--bulma-content-blockquote-background-color',\n '--bulma-content-blockquote-border-left',\n '--bulma-content-blockquote-padding',\n '--bulma-content-pre-padding',\n '--bulma-content-table-cell-border',\n '--bulma-content-table-cell-border-width',\n '--bulma-content-table-cell-padding',\n '--bulma-content-table-cell-heading-color',\n '--bulma-content-table-head-cell-border-width',\n '--bulma-content-table-head-cell-color',\n '--bulma-content-table-body-last-row-cell-border-bottom-width',\n '--bulma-content-table-foot-cell-border-width',\n '--bulma-content-table-foot-cell-color',\n // delete\n '--bulma-delete-dimensions',\n '--bulma-delete-background-l',\n '--bulma-delete-background-alpha',\n '--bulma-delete-color',\n // icon\n '--bulma-icon-dimensions',\n '--bulma-icon-dimensions-small',\n '--bulma-icon-dimensions-medium',\n '--bulma-icon-dimensions-large',\n '--bulma-icon-text-spacing',\n // notification\n '--bulma-notification-h',\n '--bulma-notification-s',\n '--bulma-notification-background-l',\n '--bulma-notification-color-l',\n '--bulma-notification-code-background-color',\n '--bulma-notification-radius',\n '--bulma-notification-padding',\n // progress\n '--bulma-progress-border-radius',\n '--bulma-progress-bar-background-color',\n '--bulma-progress-value-background-color',\n '--bulma-progress-indeterminate-duration',\n // table\n '--bulma-table-color',\n '--bulma-table-background-color',\n '--bulma-table-cell-border-color',\n '--bulma-table-cell-border-style',\n '--bulma-table-cell-border-width',\n '--bulma-table-cell-padding',\n '--bulma-table-cell-heading-color',\n '--bulma-table-cell-text-align',\n '--bulma-table-head-cell-border-width',\n '--bulma-table-head-cell-color',\n '--bulma-table-foot-cell-border-width',\n '--bulma-table-foot-cell-color',\n '--bulma-table-head-background-color',\n '--bulma-table-body-background-color',\n '--bulma-table-foot-background-color',\n '--bulma-table-row-hover-background-color',\n '--bulma-table-row-active-background-color',\n '--bulma-table-row-active-color',\n '--bulma-table-striped-row-even-background-color',\n '--bulma-table-striped-row-even-hover-background-color',\n // tag\n '--bulma-tag-h',\n '--bulma-tag-s',\n '--bulma-tag-background-l',\n '--bulma-tag-background-l-delta',\n '--bulma-tag-hover-background-l-delta',\n '--bulma-tag-active-background-l-delta',\n '--bulma-tag-color-l',\n '--bulma-tag-radius',\n '--bulma-tag-delete-margin',\n // title\n '--bulma-title-color',\n '--bulma-title-family',\n '--bulma-title-size',\n '--bulma-title-weight',\n '--bulma-title-line-height',\n '--bulma-title-strong-color',\n '--bulma-title-strong-weight',\n '--bulma-title-sub-size',\n '--bulma-title-sup-size',\n '--bulma-subtitle-color',\n '--bulma-subtitle-family',\n '--bulma-subtitle-size',\n '--bulma-subtitle-weight',\n '--bulma-subtitle-line-height',\n '--bulma-subtitle-strong-color',\n '--bulma-subtitle-strong-weight',\n // file\n '--bulma-file-radius',\n '--bulma-file-name-border-color',\n '--bulma-file-name-border-style',\n '--bulma-file-name-border-width',\n '--bulma-file-name-max-width',\n '--bulma-file-h',\n '--bulma-file-s',\n '--bulma-file-background-l',\n '--bulma-file-background-l-delta',\n '--bulma-file-hover-background-l-delta',\n '--bulma-file-active-background-l-delta',\n '--bulma-file-border-l',\n '--bulma-file-border-l-delta',\n '--bulma-file-hover-border-l-delta',\n '--bulma-file-active-border-l-delta',\n '--bulma-file-cta-color-l',\n '--bulma-file-name-color-l',\n '--bulma-file-color-l-delta',\n '--bulma-file-hover-color-l-delta',\n '--bulma-file-active-color-l-delta',\n // input\n '--bulma-input-h',\n '--bulma-input-s',\n '--bulma-input-l',\n '--bulma-input-border-style',\n '--bulma-input-border-l',\n '--bulma-input-border-l-delta',\n '--bulma-input-hover-border-l-delta',\n '--bulma-input-active-border-l-delta',\n '--bulma-input-focus-h',\n '--bulma-input-focus-s',\n '--bulma-input-focus-l',\n '--bulma-input-focus-shadow-size',\n '--bulma-input-focus-shadow-alpha',\n '--bulma-input-color-l',\n '--bulma-input-background-l',\n '--bulma-input-background-l-delta',\n '--bulma-input-height',\n '--bulma-input-shadow',\n '--bulma-input-placeholder-color',\n '--bulma-input-disabled-color',\n '--bulma-input-disabled-background-color',\n '--bulma-input-disabled-border-color',\n '--bulma-input-disabled-placeholder-color',\n '--bulma-input-arrow',\n '--bulma-input-icon-color',\n '--bulma-input-icon-hover-color',\n '--bulma-input-icon-focus-color',\n '--bulma-input-radius',\n // grid\n '--bulma-grid-gap',\n '--bulma-grid-column-count',\n '--bulma-grid-column-min',\n '--bulma-grid-cell-column-span',\n // footer\n '--bulma-footer-background-color',\n '--bulma-footer-color',\n '--bulma-footer-padding',\n // hero\n '--bulma-hero-body-padding',\n '--bulma-hero-body-padding-tablet',\n '--bulma-hero-body-padding-small',\n '--bulma-hero-body-padding-medium',\n '--bulma-hero-body-padding-large',\n // media\n '--bulma-media-border-color',\n '--bulma-media-border-size',\n '--bulma-media-spacing',\n '--bulma-media-spacing-large',\n '--bulma-media-content-spacing',\n '--bulma-media-level-1-spacing',\n '--bulma-media-level-1-content-spacing',\n '--bulma-media-level-2-spacing',\n // section\n '--bulma-section-padding',\n '--bulma-section-padding-desktop',\n '--bulma-section-padding-medium',\n '--bulma-section-padding-large',\n] as const;\n\n/** Every Bulma CSS variable Theme accepts: the two lists above. */\nconst bulmaCssVars = [...bulmaGlobalVars, ...bulmaComponentVars] as const;\n\n/** A single Bulma CSS variable key from the `bulmaCssVars` tuple. */\ntype BulmaVarKey = (typeof bulmaCssVars)[number];\n/** A partial record mapping Bulma CSS variable keys to string values. */\ntype BulmaVars = Partial<Record<BulmaVarKey, string>>;\n\n/**\n * Convert a Bulma CSS variable name to a camelCase prop name.\n * @param {string} varName - CSS variable name (e.g., '--bulma-primary-h').\n * @returns {string} The camelCase prop name (e.g., 'primaryH').\n */\nfunction cssVarToProp(varName: string): string {\n return varName\n .replace(/^--bulma-/, '')\n .split('-')\n .map((part, i) =>\n i === 0 ? part : part.charAt(0).toUpperCase() + part.slice(1)\n )\n .join('');\n}\n\n/**\n * Prop names `cssVarToProp` would mint that are already helper props:\n * `--bulma-shadow` becomes `shadow`, `--bulma-radius` becomes `radius` and\n * `--bulma-column-gap` becomes `columnGap`. They stay out of\n * `bulmaVarPropMap`, so on Theme each is the helper prop it is on every other\n * component, and every one of those variables is still reachable through\n * `bulmaVars`.\n *\n * `radius` was missed here once and set `--bulma-radius` while typed as the\n * helper (#694). It still writes that variable, so what it did then keeps\n * working; see `themeRadiusVar`. `columnGap` joined when the gap helpers\n * became shared helper props, and keeps its old variable route the same way;\n * see `themeColumnGapVar`.\n */\nconst helperPropNames: readonly string[] = ['shadow', 'radius', 'columnGap'];\n\n/**\n * Mapping of camelCase prop names to their Bulma CSS variable counterparts,\n * minus the `helperPropNames` above.\n */\nconst bulmaVarPropMap = Object.fromEntries(\n bulmaCssVars\n .map(cssVar => [cssVarToProp(cssVar), cssVar])\n .filter(([prop]) => !helperPropNames.includes(prop))\n) as Record<string, string>;\n\n/**\n * What each helper value of `radius` writes to `--bulma-radius` on a Theme,\n * alongside its class.\n *\n * Before #694, `radius=\"radiusless\"` wrote `--bulma-radius: radiusless`. That\n * is not a length, and a declaration reading an invalid variable falls back\n * to its property's initial value, which for a border radius is 0. So\n * everything inside the Theme that takes its radius from that variable lost\n * it, and under `isRoot` so did everything on the page that does. Writing a\n * real 0 keeps what\n * people see and makes it valid CSS. Keyed by the helper values, so adding\n * one means saying what it writes.\n *\n * The sizes write nothing and only add their class. Their classes read the\n * radius variables, so `normal` would point `--bulma-radius` at itself, which\n * is invalid and computes to 0, and `rounded` would turn every control inside\n * the Theme into a pill.\n */\nconst radiusHelperVars: Record<\n (typeof validRadii)[number],\n string | undefined\n> = {\n radiusless: '0',\n small: undefined,\n normal: undefined,\n large: undefined,\n rounded: undefined,\n};\n\n/**\n * What `radius` writes to `--bulma-radius` on a Theme, or `undefined` when it\n * writes nothing.\n *\n * A helper value writes its `radiusHelperVars` entry. Any other non-empty\n * string is written as given: before #694 every `radius` on Theme set the\n * variable whatever its type said, and a JavaScript caller passing a length\n * got the radius it asked for. That keeps working so nothing breaks, but the\n * type rejects it, so it warns in development and points at `bulmaVars`.\n *\n * Only a string writes anything, because only a string ever set the variable\n * to something usable: an empty value or zero was dropped, and a boolean or\n * any other bare number is not a length. The helper ignores those too, the\n * way it does on every other component.\n */\nconst themeRadiusVar = (radius: unknown): string | undefined => {\n if (typeof radius !== 'string' || radius === '') {\n return undefined;\n }\n if ((validRadii as readonly string[]).includes(radius)) {\n return radiusHelperVars[radius as keyof typeof radiusHelperVars];\n }\n warnOnce(\n 'Theme:radius-variable',\n `[bestax-bulma] <Theme radius=\"${radius}\">: setting --bulma-radius ` +\n 'through the radius prop is deprecated and will stop working in a ' +\n 'future major version. On Theme, as on every other component, radius ' +\n `is the border radius helper (\"${validRadii.join('\", \"')}\"). Set the variable with ` +\n `bulmaVars={{ '--bulma-radius': '${radius}' }} instead.`\n );\n return radius;\n};\n\n/**\n * What `columnGap` writes to `--bulma-column-gap` on a Theme, or `undefined`\n * when it writes nothing.\n *\n * Until the gap helpers were shared helper props, `columnGap` on Theme was\n * the camelCase prop Theme mints for `--bulma-column-gap`. It was never in\n * `ThemeProps`, so only untyped code reached it, but that code got the\n * columns gutter it asked for. It is the column gap helper now, as on every\n * other component, so a gap step goes to the helper and writes nothing here.\n * Any other non-empty string is still written as given, so a length such as\n * `'1rem'` keeps working, with a development warning pointing at `bulmaVars`.\n *\n * Only a string writes anything, for the reason `themeRadiusVar` gives: a\n * number or a boolean was never a usable length.\n */\nconst themeColumnGapVar = (columnGap: unknown): string | undefined => {\n if (typeof columnGap !== 'string' || columnGap === '') {\n return undefined;\n }\n if ((validGaps as readonly string[]).includes(columnGap)) {\n return undefined;\n }\n warnOnce(\n 'Theme:column-gap-variable',\n `[bestax-bulma] <Theme columnGap=\"${columnGap}\">: setting ` +\n '--bulma-column-gap through the columnGap prop is deprecated and will ' +\n 'stop working in a future major version. On Theme, as on every other ' +\n 'component, columnGap is the column gap helper ' +\n `(\"${validGaps.join('\", \"')}\"). Set the variable with ` +\n `bulmaVars={{ '--bulma-column-gap': '${columnGap}' }} instead.`\n );\n return columnGap;\n};\n\n/**\n * `bulmaComponentVars` as a lookup, built by `warnComponentVars` the first\n * time it is needed.\n */\nlet componentVarKeys: ReadonlySet<string> | undefined;\n\n/**\n * Warn in development when a Theme is given variables Bulma declares on the\n * component itself (`bulmaComponentVars`), whether through `bulmaVars` or a\n * variable prop such as `cardRadius`. Theme writes them where they can never\n * win, so nothing changes on the page, and saying so is the only way to find\n * out short of reading Bulma's stylesheet.\n *\n * Keyed by the set of variables, so a Theme that keeps passing the same ones\n * warns once, and a different set warns again. An empty value writes nothing,\n * so it is not reported.\n *\n * All of this is development-only, so it returns before doing anything in\n * production, and it builds its lookup on the first development call rather\n * than when the module loads.\n */\nconst warnComponentVars = (vars: BulmaVars): void => {\n if (!isDev()) {\n return;\n }\n const keys = (componentVarKeys ??= new Set<string>(bulmaComponentVars));\n const inert = Object.entries(vars)\n .filter(([key, value]) => value && keys.has(key))\n .map(([key]) => key)\n .sort();\n if (inert.length === 0) {\n return;\n }\n const one = inert.length === 1;\n warnOnce(\n `Theme:component-vars:${inert.join(',')}`,\n `[bestax-bulma] <Theme>: Bulma declares ${inert.join(', ')} on the ` +\n `component itself, so a value set on Theme never reaches ` +\n `${one ? 'it' : 'them'}. Set ${one ? 'it' : 'them'} on that ` +\n 'component instead, with className or style, or through Sass.'\n );\n};\n\n/** The one `<style>` element every `isRoot` Theme writes into. */\nconst ROOT_STYLE_ID = 'bestax-bulma-theme-vars';\n\n/**\n * The `:root` rules of every mounted `isRoot` Theme that has any, keyed by the\n * Theme's render order.\n *\n * Root Themes share one `<style>` element, so each keeps its rules here and\n * the element is rebuilt from all of them whenever one mounts, changes or\n * unmounts. Before this each Theme overwrote the element with only its own\n * rules, and the first to unmount removed it for all of them (#736).\n *\n * The key is a number each Theme takes when it first renders. React renders a\n * parent before its children and an earlier sibling before a later one, so an\n * inner or later-mounted root Theme sorts later, comes later in the\n * stylesheet, and wins a variable two of them set, as an inner scoped Theme\n * does. Effects would give the wrong answer for nesting: React runs a child's\n * effects before its parent's. Only the relative order matters, so a number\n * skipped by StrictMode calling the initializer twice, or by a render React\n * throws away, is harmless. The key never changes, so an update keeps its\n * place and re-rendering one Theme never changes which one wins.\n */\nconst rootThemeRules = new Map<number, string>();\nlet nextRootOrder = 0;\n\n/**\n * Write every registered root Theme's rules into the shared element, creating\n * it when needed and removing it once no Theme has any rules left.\n */\nconst renderRootThemeRules = (): void => {\n let element = document.getElementById(ROOT_STYLE_ID);\n if (rootThemeRules.size === 0) {\n element?.remove();\n return;\n }\n if (!element) {\n element = document.createElement('style');\n element.id = ROOT_STYLE_ID;\n document.head.appendChild(element);\n }\n element.textContent = [...rootThemeRules]\n .sort(([a], [b]) => a - b)\n .map(([, rules]) => rules)\n .join('\\n');\n};\n\n/**\n * Record one Theme's `:root` rules, where an empty string means it has none,\n * and rebuild the shared element if that changed anything. A Theme with no\n * rules never touches the element, which is what it did before the registry\n * too.\n */\nconst setRootThemeRules = (order: number, rules: string): void => {\n if ((rootThemeRules.get(order) ?? '') === rules) {\n return;\n }\n if (rules) {\n rootThemeRules.set(order, rules);\n } else {\n rootThemeRules.delete(order);\n }\n renderRootThemeRules();\n};\n\n/**\n * Props for the Theme component.\n */\nexport interface ThemeProps extends Omit<\n BulmaClassesProps,\n 'color' | 'backgroundColor'\n> {\n /** The content the theme applies to. */\n children: ReactNode;\n /**\n * Additional CSS classes for the wrapper div. A root Theme (`isRoot`) has no\n * wrapper, so there this does nothing, and says so in development.\n */\n className?: string;\n /**\n * Inject the variables globally at `:root` instead of scoping them to a\n * wrapper div. Default: false.\n *\n * A root Theme renders its children with no wrapper, so `className` and the\n * helper props, such as `m` or `shadow`, have no element to land on. They\n * do nothing, and say so in development. `radius` and `columnGap` describe\n * what each does at the root.\n *\n * Several root Themes can be mounted at once, and each contributes its own\n * variables. Where two set the same one, the inner or later-mounted Theme\n * wins, as with nested scoped Themes, and unmounting a Theme removes only\n * what it contributed. The variables are written from an effect, so a\n * server render does not include them.\n */\n isRoot?: boolean;\n /**\n * Set Bulma's light/dark scheme by writing its theme attribute on the\n * document root (`<html>`). This is always global, even on a scoped Theme.\n * `'system'` removes the attribute so Bulma follows the OS\n * `prefers-color-scheme`. Omit to leave the current setting untouched.\n *\n * The attribute is `data-theme`. A stylesheet built with a class prefix\n * reads Bulma's prefixed form instead (`data-bestax-theme` for the\n * `bestax-prefixed` builds), so under a `ConfigProvider` `classPrefix`\n * Theme writes both, and `'system'` or unmounting clears or restores both.\n * If the prefix cannot form an attribute name, `'light'` and `'dark'`\n * write only `data-theme` and warn in development.\n */\n colorMode?: 'light' | 'dark' | 'system';\n /**\n * Bulma CSS variables to set, by name, such as\n * `{ '--bulma-primary-h': '210' }`. Only Bulma's own variables, the keys\n * the `BulmaVars` type allows, are applied, and an empty value is skipped.\n * Where a variable prop, such as `primaryH`, sets the same variable, the\n * prop wins.\n *\n * Theme writes them on its wrapper, or at `:root` under `isRoot`, so only a\n * variable that inherits from there changes anything. Bulma declares many\n * component variables, such as `--bulma-card-radius` or\n * `--bulma-delete-dimensions`, on the component's own element, and that\n * declaration beats any value set further up. Those keys are accepted but\n * do nothing here, and warn in development. Set them on the component\n * itself, with `className` or `style`, or through Sass. Each component's\n * API page says where Bulma declares its variables.\n *\n * Some global variables Bulma also declares again on one component, which\n * keeps its own value while everything else takes the Theme's. Those do not\n * warn, because the value still reaches the rest of the page.\n */\n bulmaVars?: BulmaVars;\n /**\n * Border radius helper, as on every other component: `radiusless` adds\n * `is-radiusless` to the wrapper div. On a Theme it also sets\n * `--bulma-radius` to 0, so what is inside the Theme loses its radius too.\n * Under `isRoot` there is no wrapper for the class, and the variable is\n * written at `:root`, which squares everything on the page that takes its\n * radius from it.\n *\n * The sizes (`small`, `normal`, `large`, `rounded`) add their\n * `has-radius-<value>` class to the wrapper div and set no variable, so\n * they round the wrapper and leave what is inside it alone. Under `isRoot`\n * there is no wrapper, so they do nothing, and say so in development.\n *\n * To change the radius of what is inside, set the variable through `bulmaVars`\n * (`bulmaVars={{ '--bulma-radius': '6px' }}`). This prop used to write the\n * variable for every value, so any other non-empty string still does, but\n * that route is deprecated and logs a warning in development. A number or\n * a boolean never produced a usable radius that way, and is now ignored as\n * it is on every other component.\n */\n radius?: (typeof validRadii)[number];\n /**\n * Column gap helper, as on every other component: a gap step adds\n * `is-column-gap-<step>` to the wrapper div, which spaces the wrapper's own\n * children when it is a flex or grid container. Under `isRoot` there is no\n * wrapper, so it does nothing, and says so in development.\n *\n * It does not set `--bulma-column-gap`, the variable `Columns` reads for\n * its gutters; set that through `bulmaVars`\n * (`bulmaVars={{ '--bulma-column-gap': '1rem' }}`). Before `columnGap` was\n * a helper prop, untyped JavaScript could pass it to Theme as that\n * variable. A string that is not a gap step (`'1rem'`) still sets it, but\n * that route is deprecated and logs a warning in development. A gap step\n * does not: `columnGap=\"0\"` used to zero the gutters inside the Theme, and\n * now adds `is-column-gap-0` to the wrapper instead.\n */\n columnGap?: BulmaGapStep;\n // Bulma scheme variables\n /** Base hue for the color scheme, 0 to 360. Sets `--bulma-scheme-h`. */\n schemeH?: string;\n /** Base saturation for the color scheme, as a percentage. Sets `--bulma-scheme-s`. */\n schemeS?: string;\n /** Lightness for light backgrounds. Sets `--bulma-light-l`. */\n lightL?: string;\n /** Inverted lightness for light backgrounds. Sets `--bulma-light-invert-l`. */\n lightInvertL?: string;\n /** Lightness for dark backgrounds. Sets `--bulma-dark-l`. */\n darkL?: string;\n /** Inverted lightness for dark backgrounds. Sets `--bulma-dark-invert-l`. */\n darkInvertL?: string;\n /** Lightness for soft colors. Sets `--bulma-soft-l`. */\n softL?: string;\n /** Lightness for bold colors. Sets `--bulma-bold-l`. */\n boldL?: string;\n /** Inverted lightness for soft colors. Sets `--bulma-soft-invert-l`. */\n softInvertL?: string;\n /** Inverted lightness for bold colors. Sets `--bulma-bold-invert-l`. */\n boldInvertL?: string;\n /** Lightness change of a background on hover. Sets `--bulma-hover-background-l-delta`. */\n hoverBackgroundLDelta?: string;\n /** Lightness change of a background when active. Sets `--bulma-active-background-l-delta`. */\n activeBackgroundLDelta?: string;\n /** Lightness change of a border on hover. Sets `--bulma-hover-border-l-delta`. */\n hoverBorderLDelta?: string;\n /** Lightness change of a border when active. Sets `--bulma-active-border-l-delta`. */\n activeBorderLDelta?: string;\n /** Lightness change of text color on hover. Sets `--bulma-hover-color-l-delta`. */\n hoverColorLDelta?: string;\n /** Lightness change of text color when active. Sets `--bulma-active-color-l-delta`. */\n activeColorLDelta?: string;\n /** Alpha change of a shadow on hover. Sets `--bulma-hover-shadow-a-delta`. */\n hoverShadowADelta?: string;\n /** Alpha change of a shadow when active. Sets `--bulma-active-shadow-a-delta`. */\n activeShadowADelta?: string;\n // Bulma color variables\n /** Primary color hue, 0 to 360. Sets `--bulma-primary-h`. */\n primaryH?: string;\n /** Primary color saturation, as a percentage. Sets `--bulma-primary-s`. */\n primaryS?: string;\n /** Primary color lightness, as a percentage. Sets `--bulma-primary-l`. */\n primaryL?: string;\n /** Link color hue, 0 to 360. Sets `--bulma-link-h`. */\n linkH?: string;\n /** Link color saturation, as a percentage. Sets `--bulma-link-s`. */\n linkS?: string;\n /** Link color lightness, as a percentage. Sets `--bulma-link-l`. */\n linkL?: string;\n /** Info color hue, 0 to 360. Sets `--bulma-info-h`. */\n infoH?: string;\n /** Info color saturation, as a percentage. Sets `--bulma-info-s`. */\n infoS?: string;\n /** Info color lightness, as a percentage. Sets `--bulma-info-l`. */\n infoL?: string;\n /** Success color hue, 0 to 360. Sets `--bulma-success-h`. */\n successH?: string;\n /** Success color saturation, as a percentage. Sets `--bulma-success-s`. */\n successS?: string;\n /** Success color lightness, as a percentage. Sets `--bulma-success-l`. */\n successL?: string;\n /** Warning color hue, 0 to 360. Sets `--bulma-warning-h`. */\n warningH?: string;\n /** Warning color saturation, as a percentage. Sets `--bulma-warning-s`. */\n warningS?: string;\n /** Warning color lightness, as a percentage. Sets `--bulma-warning-l`. */\n warningL?: string;\n /** Danger color hue, 0 to 360. Sets `--bulma-danger-h`. */\n dangerH?: string;\n /** Danger color saturation, as a percentage. Sets `--bulma-danger-s`. */\n dangerS?: string;\n /** Danger color lightness, as a percentage. Sets `--bulma-danger-l`. */\n dangerL?: string;\n // Add other commonly used ones as needed\n}\n\n/**\n * Theme component that injects Bulma CSS variables either globally or locally.\n *\n * When `isRoot` is true, variables are injected at `:root`. Otherwise, a wrapping\n * `<div>` scopes the variables to its children.\n *\n * @function\n * @param {ThemeProps} props - Props for the Theme component.\n * @returns {JSX.Element} The theme wrapper or fragment.\n *\n * @example\n * // Local theme scope\n * <Theme primaryH=\"171\" primaryS=\"100%\" primaryL=\"41%\">\n * <Button color=\"primary\">Themed</Button>\n * </Theme>\n */\nexport const Theme: React.FC<ThemeProps> = ({\n bulmaVars = {},\n children,\n className,\n isRoot = false,\n colorMode,\n radius,\n columnGap,\n ...restProps\n}) => {\n const radiusVar = themeRadiusVar(radius);\n const columnGapVar = themeColumnGapVar(columnGap);\n const radiusHelper = (validRadii as readonly unknown[]).includes(radius)\n ? radius\n : undefined;\n\n // A radius size only adds its class, and a root Theme renders no wrapper to\n // carry one, so on `isRoot` it does nothing at all. Say so, as the other\n // radius routes that do not do what they look like do.\n if (isRoot && radiusHelper && radiusHelperVars[radiusHelper] === undefined) {\n warnOnce(\n 'Theme:root-radius-size',\n `[bestax-bulma] <Theme isRoot radius=\"${radiusHelper}\">: a root Theme ` +\n `has no wrapper element for has-radius-${radiusHelper}, and the ` +\n 'radius sizes set no variable, so this does nothing. To round one ' +\n `element, put radius=\"${radiusHelper}\" on it. To change the radius ` +\n \"across the page, set bulmaVars={{ '--bulma-radius': '…' }} instead.\"\n );\n }\n\n // The same for a gap step in `columnGap`, which reads like the columns\n // gutter it once set and, at the root, has no element for its class.\n const columnGapStep =\n typeof columnGap === 'number' ? String(columnGap) : columnGap;\n if (\n isRoot &&\n columnGapStep !== undefined &&\n (validGaps as readonly unknown[]).includes(columnGapStep)\n ) {\n warnOnce(\n 'Theme:root-column-gap',\n `[bestax-bulma] <Theme isRoot columnGap=\"${columnGapStep}\">: a root ` +\n `Theme has no wrapper element for is-column-gap-${columnGapStep}, ` +\n 'and a gap step sets no variable, so this does nothing. To change ' +\n 'the columns gutter across the page, set ' +\n \"bulmaVars={{ '--bulma-column-gap': '…' }} instead.\"\n );\n }\n\n // Extract Bulma variable props from restProps\n const { bulmaVarProps, otherProps } = useMemo(() => {\n const varProps: Record<string, string | undefined> = {};\n const otherPropsObj: Record<string, unknown> = {};\n\n for (const [key, value] of Object.entries(restProps)) {\n if (Object.prototype.hasOwnProperty.call(bulmaVarPropMap, key)) {\n varProps[key] = value as string;\n } else {\n otherPropsObj[key] = value;\n }\n }\n\n return { bulmaVarProps: varProps, otherProps: otherPropsObj };\n }, [restProps]);\n\n // Everything left in `otherProps` lands on the wrapper div, as a helper\n // class or an attribute, and so does `className`. A root Theme renders no\n // wrapper, so under `isRoot` all of it is dropped. `radius` and `columnGap`\n // are not in `otherProps`; the checks above cover them.\n if (isRoot) {\n const dropped = Object.entries(otherProps)\n .filter(\n ([, value]) => value !== undefined && value !== null && value !== false\n )\n .map(([key]) => key);\n if (className) {\n dropped.unshift('className');\n }\n if (dropped.length > 0) {\n warnOnce(\n 'Theme:root-dropped-props',\n `[bestax-bulma] <Theme isRoot>: a root Theme renders no wrapper ` +\n `element, so ${dropped.join(', ')} ` +\n `${dropped.length === 1 ? 'has' : 'have'} nothing to apply to. ` +\n 'Put helper props and classes on an element inside the Theme ' +\n 'instead.'\n );\n }\n }\n\n // Use Bulma classes for styling (only when not isRoot). Only a helper value\n // of `radius` reaches the helper; a legacy string went to the variable.\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n ...otherProps,\n radius: radiusHelper,\n columnGap,\n });\n\n // Merge bulmaVars and individual props, with props taking precedence\n const mergedVars: BulmaVars = useMemo(() => {\n const vars: BulmaVars = { ...bulmaVars };\n for (const [propName, cssVar] of Object.entries(bulmaVarPropMap)) {\n if (bulmaVarProps[propName] !== undefined) {\n vars[cssVar as BulmaVarKey] = bulmaVarProps[propName] as string;\n }\n }\n if (radiusVar !== undefined) {\n vars['--bulma-radius'] = radiusVar;\n }\n if (columnGapVar !== undefined) {\n vars['--bulma-column-gap'] = columnGapVar;\n }\n return vars;\n }, [bulmaVars, bulmaVarProps, radiusVar, columnGapVar]);\n\n // From an effect rather than the render body, so rendering does none of\n // this work, and a server render none at all. In production it returns\n // at its development check before looking at the variables.\n useEffect(() => {\n warnComponentVars(mergedVars);\n }, [mergedVars]);\n\n // This Theme's place among root Themes; see `rootThemeRules`.\n const [rootOrder] = useState(() => nextRootOrder++);\n\n // The `:root` rules this Theme contributes, or '' when it contributes none.\n const rootRules = useMemo(() => {\n if (!isRoot) {\n return '';\n }\n const cssRules = Object.entries(mergedVars)\n .filter(\n ([key, value]) => bulmaCssVars.includes(key as BulmaVarKey) && value\n )\n .map(([key, value]) => `${key}: ${value};`)\n .join(' ');\n return cssRules ? `:root { ${cssRules} }` : '';\n }, [mergedVars, isRoot]);\n\n // Inject CSS variables globally at :root level, alongside any other root\n // Themes. Clearing `isRoot` or every variable passes '', which withdraws\n // this Theme's rules.\n useEffect(() => {\n setRootThemeRules(rootOrder, rootRules);\n }, [rootOrder, rootRules]);\n\n // Withdraw them on unmount. Kept apart from the effect above so a change\n // rewrites the shared element in place rather than removing and recreating\n // it between the cleanup and the next run.\n useEffect(() => () => setRootThemeRules(rootOrder, ''), [rootOrder]);\n\n // Bulma names its scheme attribute after the class prefix a stylesheet was\n // built with (`data-<prefix>theme`), so the prefixed builds read\n // `data-bestax-theme` and never `data-theme`.\n const classPrefix = useClassPrefix();\n\n // Toggle Bulma's light/dark scheme by writing the theme attribute on the\n // document root (<html>). This is always global, even on a scoped Theme.\n // Under a class prefix the prefixed attribute is written as well as\n // `data-theme`, so whichever build is loaded sees it; with no prefix only\n // `data-theme` is. `'system'` removes them so Bulma follows the OS\n // preference.\n useEffect(() => {\n if (colorMode === undefined) {\n return;\n }\n\n const root = document.documentElement;\n const names = classPrefix\n ? ['data-theme', `data-${classPrefix}theme`]\n : ['data-theme'];\n const previous = names.map(name => root.getAttribute(name));\n\n for (const name of names) {\n if (colorMode === 'system') {\n root.removeAttribute(name);\n continue;\n }\n try {\n root.setAttribute(name, colorMode);\n } catch {\n // A class prefix can hold characters an attribute name cannot.\n // `data-theme` is still written, as it was before the prefixed\n // attribute existed, but a sheet built with that prefix keeps its\n // scheme, so say so.\n warnOnce(\n 'Theme:color-mode-prefix',\n `[bestax-bulma] <Theme colorMode=\"${colorMode}\">: the class ` +\n `prefix \"${classPrefix}\" makes ${name} an invalid attribute ` +\n 'name, so only data-theme is written, and a stylesheet built ' +\n 'with that prefix keeps its scheme.'\n );\n }\n }\n\n // Restore the previous values when colorMode changes or the component unmounts.\n return () => {\n names.forEach((name, i) => {\n const value = previous[i];\n if (value === null) {\n root.removeAttribute(name);\n } else {\n root.setAttribute(name, value);\n }\n });\n };\n }, [colorMode, classPrefix]);\n\n // For local injection (when isRoot is false), prepare style object for CSS vars\n const style: CSSProperties = useMemo(() => {\n if (isRoot) {\n return {};\n }\n\n const styleObj: CSSProperties = {};\n for (const [key, value] of Object.entries(mergedVars)) {\n if (bulmaCssVars.includes(key as BulmaVarKey) && value) {\n (styleObj as Record<string, string>)[key] = value;\n }\n }\n return styleObj;\n }, [mergedVars, isRoot]);\n\n // Generate combined class names for the wrapper div\n const combinedClassName = useMemo(() => {\n if (isRoot) {\n return '';\n }\n return classNames(className, bulmaHelperClasses);\n }, [className, bulmaHelperClasses, isRoot]);\n\n return isRoot ? (\n <>{children}</>\n ) : (\n <div className={combinedClassName || undefined} style={style} {...rest}>\n {children}\n </div>\n );\n};\n"],"names":["_jsx","_Fragment"],"mappings":";;;;;;;;;AAaA;AACA;AAEA;;;;;AAKG;AACH,MAAM,eAAe,GAAG;;IAEtB,kBAAkB;IAClB,kBAAkB;IAClB,qBAAqB;IACrB,yBAAyB;IACzB,yBAAyB;IACzB,uBAAuB;IACvB,2BAA2B;IAC3B,2BAA2B;IAC3B,iBAAiB;IACjB,wBAAwB;IACxB,gBAAgB;IAChB,uBAAuB;IACvB,gBAAgB;IAChB,gBAAgB;IAChB,uBAAuB;IACvB,uBAAuB;IACvB,kCAAkC;IAClC,mCAAmC;IACnC,8BAA8B;IAC9B,+BAA+B;IAC/B,6BAA6B;IAC7B,8BAA8B;IAC9B,8BAA8B;IAC9B,+BAA+B;;IAE/B,mBAAmB;IACnB,mBAAmB;IACnB,mBAAmB;IACnB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,mBAAmB;IACnB,mBAAmB;IACnB,mBAAmB;IACnB,mBAAmB;IACnB,mBAAmB;IACnB,mBAAmB;IACnB,kBAAkB;IAClB,kBAAkB;IAClB,kBAAkB;;;;;I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AAE;AACrD,gBAAA,QAAmC,CAAC,GAAG,CAAC,GAAG,KAAK;YACnD;QACF;AACA,QAAA,OAAO,QAAQ;AACjB,IAAA,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;;AAGxB,IAAA,MAAM,iBAAiB,GAAG,OAAO,CAAC,MAAK;QACrC,IAAI,MAAM,EAAE;AACV,YAAA,OAAO,EAAE;QACX;AACA,QAAA,OAAO,UAAU,CAAC,SAAS,EAAE,kBAAkB,CAAC;IAClD,CAAC,EAAE,CAAC,SAAS,EAAE,kBAAkB,EAAE,MAAM,CAAC,CAAC;AAE3C,IAAA,OAAO,MAAM,IACXA,GAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAI,KAEfD,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,iBAAiB,IAAI,SAAS,EAAE,KAAK,EAAE,KAAK,EAAA,GAAM,IAAI,EAAA,QAAA,EACnE,QAAQ,EAAA,CACL,CACP;AACH;;"}
1
+ {"version":3,"file":"Theme.js","sources":["../../../src/helpers/Theme.tsx"],"sourcesContent":["import React, {\n useEffect,\n useMemo,\n useState,\n ReactNode,\n CSSProperties,\n} from 'react';\nimport classNames from './classNames';\nimport { useBulmaClasses, BulmaClassesProps } from './useBulmaClasses';\nimport { validGaps, validRadii, type BulmaGapStep } from './bulmaClassHelpers';\nimport { isDev, warnOnce } from './devWarnings';\nimport { useClassPrefix } from './Config';\n\n// --- Bulma v1 CSS variables Theme sets (originally generated from\n// CSSVAR_KEYS), in two lists by where Bulma declares them ---\n\n/**\n * Variables a value set on an ancestor reaches. Bulma declares them on\n * `:root` (or a theme scope), or on no component in its plain state, so the\n * value Theme writes on its wrapper or at `:root` is the one the components\n * under it use.\n */\nconst bulmaGlobalVars = [\n // scheme\n '--bulma-scheme-h',\n '--bulma-scheme-s',\n '--bulma-scheme-main',\n '--bulma-scheme-main-bis',\n '--bulma-scheme-main-ter',\n '--bulma-scheme-invert',\n '--bulma-scheme-invert-bis',\n '--bulma-scheme-invert-ter',\n '--bulma-light-l',\n '--bulma-light-invert-l',\n '--bulma-dark-l',\n '--bulma-dark-invert-l',\n '--bulma-soft-l',\n '--bulma-bold-l',\n '--bulma-soft-invert-l',\n '--bulma-bold-invert-l',\n '--bulma-hover-background-l-delta',\n '--bulma-active-background-l-delta',\n '--bulma-hover-border-l-delta',\n '--bulma-active-border-l-delta',\n '--bulma-hover-color-l-delta',\n '--bulma-active-color-l-delta',\n '--bulma-hover-shadow-a-delta',\n '--bulma-active-shadow-a-delta',\n // colors\n '--bulma-primary-h',\n '--bulma-primary-s',\n '--bulma-primary-l',\n '--bulma-link-h',\n '--bulma-link-s',\n '--bulma-link-l',\n '--bulma-info-h',\n '--bulma-info-s',\n '--bulma-info-l',\n '--bulma-success-h',\n '--bulma-success-s',\n '--bulma-success-l',\n '--bulma-warning-h',\n '--bulma-warning-s',\n '--bulma-warning-l',\n '--bulma-danger-h',\n '--bulma-danger-s',\n '--bulma-danger-l',\n // shadow (the upstream token .box/.card/.dropdown/.panel derive their own\n // shadow variables from; overriding it from an ancestor is the route that\n // cascades, since those selectors re-declare their derived var on\n // themselves)\n '--bulma-shadow-h',\n '--bulma-shadow-s',\n '--bulma-shadow-l',\n '--bulma-shadow',\n // typography\n '--bulma-family-primary',\n '--bulma-family-secondary',\n '--bulma-family-code',\n '--bulma-size-small',\n '--bulma-size-normal',\n '--bulma-size-medium',\n '--bulma-size-large',\n '--bulma-weight-light',\n '--bulma-weight-normal',\n '--bulma-weight-medium',\n '--bulma-weight-semibold',\n '--bulma-weight-bold',\n '--bulma-weight-extrabold',\n // other\n '--bulma-block-spacing',\n '--bulma-duration',\n '--bulma-easing',\n '--bulma-radius-small',\n '--bulma-radius',\n '--bulma-radius-medium',\n '--bulma-radius-large',\n '--bulma-radius-rounded',\n '--bulma-speed',\n '--bulma-arrow-color',\n '--bulma-loading-color',\n '--bulma-burger-h',\n '--bulma-burger-s',\n '--bulma-burger-l',\n '--bulma-burger-border-radius',\n '--bulma-burger-gap',\n '--bulma-burger-item-height',\n '--bulma-burger-item-width',\n // generic\n '--bulma-body-background-color',\n '--bulma-body-size',\n '--bulma-body-min-width',\n '--bulma-body-rendering',\n '--bulma-body-family',\n '--bulma-body-overflow-x',\n '--bulma-body-overflow-y',\n '--bulma-body-color',\n '--bulma-body-font-size',\n '--bulma-body-weight',\n '--bulma-body-line-height',\n '--bulma-code-family',\n '--bulma-code-padding',\n '--bulma-code-weight',\n '--bulma-code-size',\n '--bulma-small-font-size',\n '--bulma-hr-background-color',\n '--bulma-hr-height',\n '--bulma-hr-margin',\n '--bulma-strong-color',\n '--bulma-strong-weight',\n '--bulma-pre-font-size',\n '--bulma-pre-padding',\n '--bulma-pre-code-font-size',\n // skeleton\n '--bulma-skeleton-background',\n '--bulma-skeleton-radius',\n '--bulma-skeleton-block-min-height',\n '--bulma-skeleton-lines-gap',\n '--bulma-skeleton-line-height',\n // control\n '--bulma-control-radius',\n '--bulma-control-radius-small',\n '--bulma-control-border-width',\n '--bulma-control-height',\n '--bulma-control-line-height',\n '--bulma-control-padding-vertical',\n '--bulma-control-padding-horizontal',\n '--bulma-control-size',\n '--bulma-control-focus-shadow-l',\n // columns\n '--bulma-column-gap',\n // grid\n '--bulma-grid-cell-column-start',\n] as const;\n\n/**\n * Variables Bulma declares on the component's own element, such as\n * `--bulma-card-radius` on `.card`. An element that declares a variable uses\n * its own value whatever its ancestors set, so a value Theme writes for one\n * of these, on its wrapper or at `:root`, never reaches the component.\n *\n * They stay in `BulmaVars`, and so stay valid `bulmaVars` keys and variable\n * props, because taking a key out would be a breaking change. Setting one\n * warns in development instead; see `warnComponentVars`.\n *\n * `scripts/css-var-scopes.test.mjs` holds this split to Bulma's compiled\n * stylesheet in both directions, so a Bulma upgrade that moves a variable\n * fails there.\n */\nconst bulmaComponentVars = [\n // breadcrumb\n '--bulma-breadcrumb-item-color',\n '--bulma-breadcrumb-item-hover-color',\n '--bulma-breadcrumb-item-active-color',\n '--bulma-breadcrumb-item-padding-vertical',\n '--bulma-breadcrumb-item-padding-horizontal',\n '--bulma-breadcrumb-item-separator-color',\n // card\n '--bulma-card-color',\n '--bulma-card-background-color',\n '--bulma-card-shadow',\n '--bulma-card-radius',\n '--bulma-card-header-background-color',\n '--bulma-card-header-color',\n '--bulma-card-header-padding',\n '--bulma-card-header-shadow',\n '--bulma-card-header-weight',\n '--bulma-card-content-background-color',\n '--bulma-card-content-padding',\n '--bulma-card-footer-background-color',\n '--bulma-card-footer-border-top',\n '--bulma-card-footer-padding',\n '--bulma-card-media-margin',\n // dropdown\n '--bulma-dropdown-menu-min-width',\n '--bulma-dropdown-content-background-color',\n '--bulma-dropdown-content-offset',\n '--bulma-dropdown-content-padding-bottom',\n '--bulma-dropdown-content-padding-top',\n '--bulma-dropdown-content-radius',\n '--bulma-dropdown-content-shadow',\n '--bulma-dropdown-content-z',\n '--bulma-dropdown-item-h',\n '--bulma-dropdown-item-s',\n '--bulma-dropdown-item-l',\n '--bulma-dropdown-item-background-l',\n '--bulma-dropdown-item-background-l-delta',\n '--bulma-dropdown-item-hover-background-l-delta',\n '--bulma-dropdown-item-active-background-l-delta',\n '--bulma-dropdown-item-color-l',\n '--bulma-dropdown-item-selected-h',\n '--bulma-dropdown-item-selected-s',\n '--bulma-dropdown-item-selected-l',\n '--bulma-dropdown-item-selected-background-l',\n '--bulma-dropdown-item-selected-color-l',\n '--bulma-dropdown-divider-background-color',\n // menu\n '--bulma-menu-item-h',\n '--bulma-menu-item-s',\n '--bulma-menu-item-l',\n '--bulma-menu-item-background-l',\n '--bulma-menu-item-background-l-delta',\n '--bulma-menu-item-hover-background-l-delta',\n '--bulma-menu-item-active-background-l-delta',\n '--bulma-menu-item-color-l',\n '--bulma-menu-item-radius',\n '--bulma-menu-item-selected-h',\n '--bulma-menu-item-selected-s',\n '--bulma-menu-item-selected-l',\n '--bulma-menu-item-selected-background-l',\n '--bulma-menu-item-selected-color-l',\n '--bulma-menu-list-border-left',\n '--bulma-menu-list-line-height',\n '--bulma-menu-list-link-padding',\n '--bulma-menu-nested-list-margin',\n '--bulma-menu-nested-list-padding-left',\n '--bulma-menu-label-color',\n '--bulma-menu-label-font-size',\n '--bulma-menu-label-letter-spacing',\n '--bulma-menu-label-spacing',\n // message\n '--bulma-message-h',\n '--bulma-message-s',\n '--bulma-message-background-l',\n '--bulma-message-border-l',\n '--bulma-message-border-l-delta',\n '--bulma-message-border-style',\n '--bulma-message-border-width',\n '--bulma-message-color-l',\n '--bulma-message-radius',\n '--bulma-message-header-weight',\n '--bulma-message-header-padding',\n '--bulma-message-header-radius',\n '--bulma-message-header-body-border-width',\n '--bulma-message-header-background-l',\n '--bulma-message-header-color-l',\n '--bulma-message-body-border-width',\n '--bulma-message-body-color',\n '--bulma-message-body-padding',\n '--bulma-message-body-radius',\n '--bulma-message-body-pre-code-background-color',\n // modal\n '--bulma-modal-z',\n '--bulma-modal-background-background-color',\n '--bulma-modal-content-width',\n '--bulma-modal-content-margin-mobile',\n '--bulma-modal-content-spacing-mobile',\n '--bulma-modal-content-spacing-tablet',\n '--bulma-modal-close-dimensions',\n '--bulma-modal-close-right',\n '--bulma-modal-close-top',\n '--bulma-modal-card-spacing',\n '--bulma-modal-card-head-background-color',\n '--bulma-modal-card-head-padding',\n '--bulma-modal-card-head-radius',\n '--bulma-modal-card-title-color',\n '--bulma-modal-card-title-line-height',\n '--bulma-modal-card-title-size',\n '--bulma-modal-card-foot-background-color',\n '--bulma-modal-card-foot-radius',\n '--bulma-modal-card-body-background-color',\n '--bulma-modal-card-body-padding',\n // navbar\n '--bulma-navbar-h',\n '--bulma-navbar-s',\n '--bulma-navbar-l',\n '--bulma-navbar-background-color',\n '--bulma-navbar-box-shadow-size',\n '--bulma-navbar-box-shadow-color',\n '--bulma-navbar-padding-vertical',\n '--bulma-navbar-padding-horizontal',\n '--bulma-navbar-z',\n '--bulma-navbar-fixed-z',\n '--bulma-navbar-item-background-a',\n '--bulma-navbar-item-background-l',\n '--bulma-navbar-item-background-l-delta',\n '--bulma-navbar-item-hover-background-l-delta',\n '--bulma-navbar-item-active-background-l-delta',\n '--bulma-navbar-item-color-l',\n '--bulma-navbar-item-selected-h',\n '--bulma-navbar-item-selected-s',\n '--bulma-navbar-item-selected-l',\n '--bulma-navbar-item-selected-background-l',\n '--bulma-navbar-item-selected-color-l',\n '--bulma-navbar-item-img-max-height',\n '--bulma-navbar-burger-color',\n '--bulma-navbar-tab-hover-background-color',\n '--bulma-navbar-tab-hover-border-bottom-color',\n '--bulma-navbar-tab-active-color',\n '--bulma-navbar-tab-active-background-color',\n '--bulma-navbar-tab-active-border-bottom-color',\n '--bulma-navbar-tab-active-border-bottom-style',\n '--bulma-navbar-tab-active-border-bottom-width',\n '--bulma-navbar-dropdown-background-color',\n '--bulma-navbar-dropdown-border-l',\n '--bulma-navbar-dropdown-border-color',\n '--bulma-navbar-dropdown-border-style',\n '--bulma-navbar-dropdown-border-width',\n '--bulma-navbar-dropdown-offset',\n '--bulma-navbar-dropdown-arrow',\n '--bulma-navbar-dropdown-radius',\n '--bulma-navbar-dropdown-z',\n '--bulma-navbar-dropdown-boxed-radius',\n '--bulma-navbar-dropdown-boxed-shadow',\n '--bulma-navbar-dropdown-item-h',\n '--bulma-navbar-dropdown-item-s',\n '--bulma-navbar-dropdown-item-l',\n '--bulma-navbar-dropdown-item-background-l',\n '--bulma-navbar-dropdown-item-color-l',\n '--bulma-navbar-divider-background-l',\n '--bulma-navbar-divider-height',\n '--bulma-navbar-bottom-box-shadow-size',\n // pagination\n '--bulma-pagination-margin',\n '--bulma-pagination-min-width',\n '--bulma-pagination-item-h',\n '--bulma-pagination-item-s',\n '--bulma-pagination-item-l',\n '--bulma-pagination-item-background-l-delta',\n '--bulma-pagination-item-hover-background-l-delta',\n '--bulma-pagination-item-active-background-l-delta',\n '--bulma-pagination-item-border-style',\n '--bulma-pagination-item-border-width',\n '--bulma-pagination-item-border-l',\n '--bulma-pagination-item-border-l-delta',\n '--bulma-pagination-item-hover-border-l-delta',\n '--bulma-pagination-item-active-border-l-delta',\n '--bulma-pagination-item-focus-border-l-delta',\n '--bulma-pagination-item-color-l',\n '--bulma-pagination-item-font-size',\n '--bulma-pagination-item-margin',\n '--bulma-pagination-item-padding-left',\n '--bulma-pagination-item-padding-right',\n '--bulma-pagination-item-outer-shadow-h',\n '--bulma-pagination-item-outer-shadow-s',\n '--bulma-pagination-item-outer-shadow-l',\n '--bulma-pagination-item-outer-shadow-a',\n '--bulma-pagination-nav-padding-left',\n '--bulma-pagination-nav-padding-right',\n '--bulma-pagination-disabled-color',\n '--bulma-pagination-disabled-background-color',\n '--bulma-pagination-disabled-border-color',\n '--bulma-pagination-current-color',\n '--bulma-pagination-current-background-color',\n '--bulma-pagination-current-border-color',\n '--bulma-pagination-ellipsis-color',\n '--bulma-pagination-shadow-inset',\n '--bulma-pagination-selected-item-h',\n '--bulma-pagination-selected-item-s',\n '--bulma-pagination-selected-item-l',\n '--bulma-pagination-selected-item-background-l',\n '--bulma-pagination-selected-item-border-l',\n '--bulma-pagination-selected-item-color-l',\n // panel\n '--bulma-panel-margin',\n '--bulma-panel-item-border',\n '--bulma-panel-radius',\n '--bulma-panel-shadow',\n '--bulma-panel-heading-line-height',\n '--bulma-panel-heading-padding',\n '--bulma-panel-heading-radius',\n '--bulma-panel-heading-size',\n '--bulma-panel-heading-weight',\n '--bulma-panel-tabs-font-size',\n '--bulma-panel-tab-border-bottom-color',\n '--bulma-panel-tab-border-bottom-style',\n '--bulma-panel-tab-border-bottom-width',\n '--bulma-panel-tab-active-color',\n '--bulma-panel-list-item-color',\n '--bulma-panel-list-item-hover-color',\n '--bulma-panel-block-color',\n '--bulma-panel-block-hover-background-color',\n '--bulma-panel-block-active-border-left-color',\n '--bulma-panel-block-active-color',\n '--bulma-panel-block-active-icon-color',\n '--bulma-panel-icon-color',\n // tabs\n '--bulma-tabs-border-bottom-color',\n '--bulma-tabs-border-bottom-style',\n '--bulma-tabs-border-bottom-width',\n '--bulma-tabs-link-color',\n '--bulma-tabs-link-hover-border-bottom-color',\n '--bulma-tabs-link-hover-color',\n '--bulma-tabs-link-active-border-bottom-color',\n '--bulma-tabs-link-active-color',\n '--bulma-tabs-link-padding',\n '--bulma-tabs-boxed-link-radius',\n '--bulma-tabs-boxed-link-hover-background-color',\n '--bulma-tabs-boxed-link-hover-border-bottom-color',\n '--bulma-tabs-boxed-link-active-background-color',\n '--bulma-tabs-boxed-link-active-border-color',\n '--bulma-tabs-boxed-link-active-border-bottom-color',\n '--bulma-tabs-toggle-link-border-color',\n '--bulma-tabs-toggle-link-border-style',\n '--bulma-tabs-toggle-link-border-width',\n '--bulma-tabs-toggle-link-hover-background-color',\n '--bulma-tabs-toggle-link-hover-border-color',\n '--bulma-tabs-toggle-link-radius',\n '--bulma-tabs-toggle-link-active-background-color',\n '--bulma-tabs-toggle-link-active-border-color',\n '--bulma-tabs-toggle-link-active-color',\n // box\n '--bulma-box-background-color',\n '--bulma-box-color',\n '--bulma-box-radius',\n '--bulma-box-shadow',\n '--bulma-box-padding',\n '--bulma-box-link-hover-shadow',\n '--bulma-box-link-active-shadow',\n // content\n '--bulma-content-heading-color',\n '--bulma-content-heading-weight',\n '--bulma-content-heading-line-height',\n '--bulma-content-block-margin-bottom',\n '--bulma-content-blockquote-background-color',\n '--bulma-content-blockquote-border-left',\n '--bulma-content-blockquote-padding',\n '--bulma-content-pre-padding',\n '--bulma-content-table-cell-border',\n '--bulma-content-table-cell-border-width',\n '--bulma-content-table-cell-padding',\n '--bulma-content-table-cell-heading-color',\n '--bulma-content-table-head-cell-border-width',\n '--bulma-content-table-head-cell-color',\n '--bulma-content-table-body-last-row-cell-border-bottom-width',\n '--bulma-content-table-foot-cell-border-width',\n '--bulma-content-table-foot-cell-color',\n // delete\n '--bulma-delete-dimensions',\n '--bulma-delete-background-l',\n '--bulma-delete-background-alpha',\n '--bulma-delete-color',\n // icon\n '--bulma-icon-dimensions',\n '--bulma-icon-dimensions-small',\n '--bulma-icon-dimensions-medium',\n '--bulma-icon-dimensions-large',\n '--bulma-icon-text-spacing',\n // notification\n '--bulma-notification-h',\n '--bulma-notification-s',\n '--bulma-notification-background-l',\n '--bulma-notification-color-l',\n '--bulma-notification-code-background-color',\n '--bulma-notification-radius',\n '--bulma-notification-padding',\n // progress\n '--bulma-progress-border-radius',\n '--bulma-progress-bar-background-color',\n '--bulma-progress-value-background-color',\n '--bulma-progress-indeterminate-duration',\n // table\n '--bulma-table-color',\n '--bulma-table-background-color',\n '--bulma-table-cell-border-color',\n '--bulma-table-cell-border-style',\n '--bulma-table-cell-border-width',\n '--bulma-table-cell-padding',\n '--bulma-table-cell-heading-color',\n '--bulma-table-cell-text-align',\n '--bulma-table-head-cell-border-width',\n '--bulma-table-head-cell-color',\n '--bulma-table-foot-cell-border-width',\n '--bulma-table-foot-cell-color',\n '--bulma-table-head-background-color',\n '--bulma-table-body-background-color',\n '--bulma-table-foot-background-color',\n '--bulma-table-row-hover-background-color',\n '--bulma-table-row-active-background-color',\n '--bulma-table-row-active-color',\n '--bulma-table-striped-row-even-background-color',\n '--bulma-table-striped-row-even-hover-background-color',\n // tag\n '--bulma-tag-h',\n '--bulma-tag-s',\n '--bulma-tag-background-l',\n '--bulma-tag-background-l-delta',\n '--bulma-tag-hover-background-l-delta',\n '--bulma-tag-active-background-l-delta',\n '--bulma-tag-color-l',\n '--bulma-tag-radius',\n '--bulma-tag-delete-margin',\n // title\n '--bulma-title-color',\n '--bulma-title-family',\n '--bulma-title-size',\n '--bulma-title-weight',\n '--bulma-title-line-height',\n '--bulma-title-strong-color',\n '--bulma-title-strong-weight',\n '--bulma-title-sub-size',\n '--bulma-title-sup-size',\n '--bulma-subtitle-color',\n '--bulma-subtitle-family',\n '--bulma-subtitle-size',\n '--bulma-subtitle-weight',\n '--bulma-subtitle-line-height',\n '--bulma-subtitle-strong-color',\n '--bulma-subtitle-strong-weight',\n // file\n '--bulma-file-radius',\n '--bulma-file-name-border-color',\n '--bulma-file-name-border-style',\n '--bulma-file-name-border-width',\n '--bulma-file-name-max-width',\n '--bulma-file-h',\n '--bulma-file-s',\n '--bulma-file-background-l',\n '--bulma-file-background-l-delta',\n '--bulma-file-hover-background-l-delta',\n '--bulma-file-active-background-l-delta',\n '--bulma-file-border-l',\n '--bulma-file-border-l-delta',\n '--bulma-file-hover-border-l-delta',\n '--bulma-file-active-border-l-delta',\n '--bulma-file-cta-color-l',\n '--bulma-file-name-color-l',\n '--bulma-file-color-l-delta',\n '--bulma-file-hover-color-l-delta',\n '--bulma-file-active-color-l-delta',\n // input\n '--bulma-input-h',\n '--bulma-input-s',\n '--bulma-input-l',\n '--bulma-input-border-style',\n '--bulma-input-border-l',\n '--bulma-input-border-l-delta',\n '--bulma-input-hover-border-l-delta',\n '--bulma-input-active-border-l-delta',\n '--bulma-input-focus-h',\n '--bulma-input-focus-s',\n '--bulma-input-focus-l',\n '--bulma-input-focus-shadow-size',\n '--bulma-input-focus-shadow-alpha',\n '--bulma-input-color-l',\n '--bulma-input-background-l',\n '--bulma-input-background-l-delta',\n '--bulma-input-height',\n '--bulma-input-shadow',\n '--bulma-input-placeholder-color',\n '--bulma-input-disabled-color',\n '--bulma-input-disabled-background-color',\n '--bulma-input-disabled-border-color',\n '--bulma-input-disabled-placeholder-color',\n '--bulma-input-arrow',\n '--bulma-input-icon-color',\n '--bulma-input-icon-hover-color',\n '--bulma-input-icon-focus-color',\n '--bulma-input-radius',\n // grid\n '--bulma-grid-gap',\n '--bulma-grid-column-count',\n '--bulma-grid-column-min',\n '--bulma-grid-cell-column-span',\n // footer\n '--bulma-footer-background-color',\n '--bulma-footer-color',\n '--bulma-footer-padding',\n // hero\n '--bulma-hero-body-padding',\n '--bulma-hero-body-padding-tablet',\n '--bulma-hero-body-padding-small',\n '--bulma-hero-body-padding-medium',\n '--bulma-hero-body-padding-large',\n // media\n '--bulma-media-border-color',\n '--bulma-media-border-size',\n '--bulma-media-spacing',\n '--bulma-media-spacing-large',\n '--bulma-media-content-spacing',\n '--bulma-media-level-1-spacing',\n '--bulma-media-level-1-content-spacing',\n '--bulma-media-level-2-spacing',\n // section\n '--bulma-section-padding',\n '--bulma-section-padding-desktop',\n '--bulma-section-padding-medium',\n '--bulma-section-padding-large',\n] as const;\n\n/** Every Bulma CSS variable Theme accepts: the two lists above. */\nconst bulmaCssVars = [...bulmaGlobalVars, ...bulmaComponentVars] as const;\n\n/** A single Bulma CSS variable key from the `bulmaCssVars` tuple. */\ntype BulmaVarKey = (typeof bulmaCssVars)[number];\n/** A partial record mapping Bulma CSS variable keys to string values. */\ntype BulmaVars = Partial<Record<BulmaVarKey, string>>;\n\n/**\n * Convert a Bulma CSS variable name to a camelCase prop name.\n * @param {string} varName - CSS variable name (e.g., '--bulma-primary-h').\n * @returns {string} The camelCase prop name (e.g., 'primaryH').\n */\nfunction cssVarToProp(varName: string): string {\n return varName\n .replace(/^--bulma-/, '')\n .split('-')\n .map((part, i) =>\n i === 0 ? part : part.charAt(0).toUpperCase() + part.slice(1)\n )\n .join('');\n}\n\n/**\n * Prop names `cssVarToProp` would mint that are already helper props:\n * `--bulma-shadow` becomes `shadow`, `--bulma-radius` becomes `radius` and\n * `--bulma-column-gap` becomes `columnGap`. They stay out of\n * `bulmaVarPropMap`, so on Theme each is the helper prop it is on every other\n * component, and every one of those variables is still reachable through\n * `bulmaVars`.\n *\n * `radius` was missed here once and set `--bulma-radius` while typed as the\n * helper (#694). It still writes that variable, so what it did then keeps\n * working; see `themeRadiusVar`. `columnGap` joined when the gap helpers\n * became shared helper props, and keeps its old variable route the same way;\n * see `themeColumnGapVar`.\n */\nconst helperPropNames: readonly string[] = ['shadow', 'radius', 'columnGap'];\n\n/**\n * Mapping of camelCase prop names to their Bulma CSS variable counterparts,\n * minus the `helperPropNames` above.\n */\nconst bulmaVarPropMap = Object.fromEntries(\n bulmaCssVars\n .map(cssVar => [cssVarToProp(cssVar), cssVar])\n .filter(([prop]) => !helperPropNames.includes(prop))\n) as Record<string, string>;\n\n/**\n * What each helper value of `radius` writes to `--bulma-radius` on a Theme,\n * alongside its class.\n *\n * Before #694, `radius=\"radiusless\"` wrote `--bulma-radius: radiusless`. That\n * is not a length, and a declaration reading an invalid variable falls back\n * to its property's initial value, which for a border radius is 0. So\n * everything inside the Theme that takes its radius from that variable lost\n * it, and under `isRoot` so did everything on the page that does. Writing a\n * real 0 keeps what\n * people see and makes it valid CSS. Keyed by the helper values, so adding\n * one means saying what it writes.\n *\n * The sizes write nothing and only add their class. Their classes read the\n * radius variables, so `normal` would point `--bulma-radius` at itself, which\n * is invalid and computes to 0, and `rounded` would turn every control inside\n * the Theme into a pill.\n */\nconst radiusHelperVars: Record<\n (typeof validRadii)[number],\n string | undefined\n> = {\n radiusless: '0',\n small: undefined,\n normal: undefined,\n large: undefined,\n rounded: undefined,\n};\n\n/**\n * What `radius` writes to `--bulma-radius` on a Theme, or `undefined` when it\n * writes nothing.\n *\n * A helper value writes its `radiusHelperVars` entry. Any other non-empty\n * string is written as given: before #694 every `radius` on Theme set the\n * variable whatever its type said, and a JavaScript caller passing a length\n * got the radius it asked for. That keeps working so nothing breaks, but the\n * type rejects it, so it warns in development and points at `bulmaVars`.\n *\n * Only a string writes anything, because only a string ever set the variable\n * to something usable: an empty value or zero was dropped, and a boolean or\n * any other bare number is not a length. The helper ignores those too, the\n * way it does on every other component.\n */\nconst themeRadiusVar = (radius: unknown): string | undefined => {\n if (typeof radius !== 'string' || radius === '') {\n return undefined;\n }\n if ((validRadii as readonly string[]).includes(radius)) {\n return radiusHelperVars[radius as keyof typeof radiusHelperVars];\n }\n warnOnce(\n 'Theme:radius-variable',\n `[bestax-bulma] <Theme radius=\"${radius}\">: setting --bulma-radius ` +\n 'through the radius prop is deprecated and will stop working in a ' +\n 'future major version. On Theme, as on every other component, radius ' +\n `is the border radius helper (\"${validRadii.join('\", \"')}\"). Set the variable with ` +\n `bulmaVars={{ '--bulma-radius': '${radius}' }} instead.`\n );\n return radius;\n};\n\n/**\n * What `columnGap` writes to `--bulma-column-gap` on a Theme, or `undefined`\n * when it writes nothing.\n *\n * Until the gap helpers were shared helper props, `columnGap` on Theme was\n * the camelCase prop Theme mints for `--bulma-column-gap`. It was never in\n * `ThemeProps`, so only untyped code reached it, but that code got the\n * columns gutter it asked for. It is the column gap helper now, as on every\n * other component, so a gap step goes to the helper and writes nothing here.\n * Any other non-empty string is still written as given, so a length such as\n * `'1rem'` keeps working, with a development warning pointing at `bulmaVars`.\n *\n * Only a string writes anything, for the reason `themeRadiusVar` gives: a\n * number or a boolean was never a usable length.\n */\nconst themeColumnGapVar = (columnGap: unknown): string | undefined => {\n if (typeof columnGap !== 'string' || columnGap === '') {\n return undefined;\n }\n if ((validGaps as readonly string[]).includes(columnGap)) {\n return undefined;\n }\n warnOnce(\n 'Theme:column-gap-variable',\n `[bestax-bulma] <Theme columnGap=\"${columnGap}\">: setting ` +\n '--bulma-column-gap through the columnGap prop is deprecated and will ' +\n 'stop working in a future major version. On Theme, as on every other ' +\n 'component, columnGap is the column gap helper ' +\n `(\"${validGaps.join('\", \"')}\"). Set the variable with ` +\n `bulmaVars={{ '--bulma-column-gap': '${columnGap}' }} instead.`\n );\n return columnGap;\n};\n\n/**\n * `bulmaComponentVars` as a lookup, built by `warnComponentVars` the first\n * time it is needed.\n */\nlet componentVarKeys: ReadonlySet<string> | undefined;\n\n/**\n * Warn in development when a Theme is given variables Bulma declares on the\n * component itself (`bulmaComponentVars`), whether through `bulmaVars` or a\n * variable prop such as `cardRadius`. Theme writes them where they can never\n * win, so nothing changes on the page, and saying so is the only way to find\n * out short of reading Bulma's stylesheet.\n *\n * Keyed by the set of variables, so a Theme that keeps passing the same ones\n * warns once, and a different set warns again. An empty value writes nothing,\n * so it is not reported.\n *\n * All of this is development-only, so it returns before doing anything in\n * production, and it builds its lookup on the first development call rather\n * than when the module loads.\n */\nconst warnComponentVars = (vars: BulmaVars): void => {\n if (!isDev()) {\n return;\n }\n const keys = (componentVarKeys ??= new Set<string>(bulmaComponentVars));\n const inert = Object.entries(vars)\n .filter(([key, value]) => value && keys.has(key))\n .map(([key]) => key)\n .sort();\n if (inert.length === 0) {\n return;\n }\n const one = inert.length === 1;\n warnOnce(\n `Theme:component-vars:${inert.join(',')}`,\n `[bestax-bulma] <Theme>: Bulma declares ${inert.join(', ')} on the ` +\n `component itself, so a value set on Theme never reaches ` +\n `${one ? 'it' : 'them'}. Set ${one ? 'it' : 'them'} on that ` +\n 'component instead, with className or style, or through Sass.'\n );\n};\n\n/** The one `<style>` element every `isRoot` Theme writes into. */\nconst ROOT_STYLE_ID = 'bestax-bulma-theme-vars';\n\n/**\n * The `:root` rules of every mounted `isRoot` Theme that has any, keyed by the\n * Theme's render order.\n *\n * Root Themes share one `<style>` element, so each keeps its rules here and\n * the element is rebuilt from all of them whenever one mounts, changes or\n * unmounts. Before this each Theme overwrote the element with only its own\n * rules, and the first to unmount removed it for all of them (#736).\n *\n * The key is a number each Theme takes when it first renders. React renders a\n * parent before its children and an earlier sibling before a later one, so an\n * inner or later-mounted root Theme sorts later, comes later in the\n * stylesheet, and wins a variable two of them set, as an inner scoped Theme\n * does. Effects would give the wrong answer for nesting: React runs a child's\n * effects before its parent's. Only the relative order matters, so a number\n * skipped by StrictMode calling the initializer twice, or by a render React\n * throws away, is harmless. The key never changes, so an update keeps its\n * place and re-rendering one Theme never changes which one wins.\n */\nconst rootThemeRules = new Map<number, string>();\nlet nextRootOrder = 0;\n\n/**\n * Write every registered root Theme's rules into the shared element, creating\n * it when needed and removing it once no Theme has any rules left.\n */\nconst renderRootThemeRules = (): void => {\n let element = document.getElementById(ROOT_STYLE_ID);\n if (rootThemeRules.size === 0) {\n element?.remove();\n return;\n }\n if (!element) {\n element = document.createElement('style');\n element.id = ROOT_STYLE_ID;\n document.head.appendChild(element);\n }\n element.textContent = [...rootThemeRules]\n .sort(([a], [b]) => a - b)\n .map(([, rules]) => rules)\n .join('\\n');\n};\n\n/**\n * Record one Theme's `:root` rules, where an empty string means it has none,\n * and rebuild the shared element if that changed anything. A Theme with no\n * rules never touches the element, which is what it did before the registry\n * too.\n */\nconst setRootThemeRules = (order: number, rules: string): void => {\n if ((rootThemeRules.get(order) ?? '') === rules) {\n return;\n }\n if (rules) {\n rootThemeRules.set(order, rules);\n } else {\n rootThemeRules.delete(order);\n }\n renderRootThemeRules();\n};\n\n/**\n * Props for the Theme component.\n */\nexport interface ThemeProps extends Omit<\n BulmaClassesProps,\n 'color' | 'backgroundColor'\n> {\n /** The content the theme applies to. */\n children: ReactNode;\n /**\n * Additional CSS classes for the wrapper div. A root Theme (`isRoot`) has no\n * wrapper, so there this does nothing, and says so in development.\n */\n className?: string;\n /**\n * Inject the variables globally at `:root` instead of scoping them to a\n * wrapper div. Default: false.\n *\n * A root Theme renders its children with no wrapper, so `className` and the\n * helper props, such as `m` or `shadow`, have no element to land on. They\n * do nothing, and say so in development. `radius` and `columnGap` describe\n * what each does at the root.\n *\n * Several root Themes can be mounted at once, and each contributes its own\n * variables. Where two set the same one, the inner or later-mounted Theme\n * wins, as with nested scoped Themes, and unmounting a Theme removes only\n * what it contributed. The variables are written from an effect, so a\n * server render does not include them.\n */\n isRoot?: boolean;\n /**\n * Set Bulma's light/dark scheme by writing its theme attribute on the\n * document root (`<html>`). This is always global, even on a scoped Theme.\n * `'system'` removes the attribute so Bulma follows the OS\n * `prefers-color-scheme`. Omit to leave the current setting untouched.\n *\n * The attribute is `data-theme`. A stylesheet built with a class prefix\n * reads Bulma's prefixed form instead (`data-bestax-theme` for the\n * `bestax-prefixed` builds), so under a `ConfigProvider` `classPrefix`\n * Theme writes both, and `'system'` or unmounting clears or restores both.\n * If the prefix cannot form an attribute name, `'light'` and `'dark'`\n * write only `data-theme` and warn in development.\n *\n * The attribute is written from an effect, so a page rendered in the\n * browser paints its first frame with whatever `<html>` already has, the\n * visitor's OS scheme when that is nothing. Put a scheme that never changes\n * on `<html>` in `index.html` instead, and write a saved choice from an\n * inline `<head>` script, starting `colorMode` from what it wrote.\n */\n colorMode?: 'light' | 'dark' | 'system';\n /**\n * Bulma CSS variables to set, by name, such as\n * `{ '--bulma-primary-h': '210' }`. Only Bulma's own variables, the keys\n * the `BulmaVars` type allows, are applied, and an empty value is skipped.\n * Where a variable prop, such as `primaryH`, sets the same variable, the\n * prop wins.\n *\n * Theme writes them on its wrapper, or at `:root` under `isRoot`, so only a\n * variable that inherits from there changes anything. Bulma declares many\n * component variables, such as `--bulma-card-radius` or\n * `--bulma-delete-dimensions`, on the component's own element, and that\n * declaration beats any value set further up. Those keys are accepted but\n * do nothing here, and warn in development. Set them on the component\n * itself, with `className` or `style`, or through Sass. Each component's\n * API page says where Bulma declares its variables.\n *\n * Some global variables Bulma also declares again on one component, which\n * keeps its own value while everything else takes the Theme's. Those do not\n * warn, because the value still reaches the rest of the page.\n */\n bulmaVars?: BulmaVars;\n /**\n * Border radius helper, as on every other component: `radiusless` adds\n * `is-radiusless` to the wrapper div. On a Theme it also sets\n * `--bulma-radius` to 0, so what is inside the Theme loses its radius too.\n * Under `isRoot` there is no wrapper for the class, and the variable is\n * written at `:root`, which squares everything on the page that takes its\n * radius from it.\n *\n * The sizes (`small`, `normal`, `large`, `rounded`) add their\n * `has-radius-<value>` class to the wrapper div and set no variable, so\n * they round the wrapper and leave what is inside it alone. Under `isRoot`\n * there is no wrapper, so they do nothing, and say so in development.\n *\n * To change the radius of what is inside, set the variable through `bulmaVars`\n * (`bulmaVars={{ '--bulma-radius': '6px' }}`). This prop used to write the\n * variable for every value, so any other non-empty string still does, but\n * that route is deprecated and logs a warning in development. A number or\n * a boolean never produced a usable radius that way, and is now ignored as\n * it is on every other component.\n */\n radius?: (typeof validRadii)[number];\n /**\n * Column gap helper, as on every other component: a gap step adds\n * `is-column-gap-<step>` to the wrapper div, which spaces the wrapper's own\n * children when it is a flex or grid container. Under `isRoot` there is no\n * wrapper, so it does nothing, and says so in development.\n *\n * It does not set `--bulma-column-gap`, the variable `Columns` reads for\n * its gutters; set that through `bulmaVars`\n * (`bulmaVars={{ '--bulma-column-gap': '1rem' }}`). Before `columnGap` was\n * a helper prop, untyped JavaScript could pass it to Theme as that\n * variable. A string that is not a gap step (`'1rem'`) still sets it, but\n * that route is deprecated and logs a warning in development. A gap step\n * does not: `columnGap=\"0\"` used to zero the gutters inside the Theme, and\n * now adds `is-column-gap-0` to the wrapper instead.\n */\n columnGap?: BulmaGapStep;\n // Bulma scheme variables\n /** Base hue for the color scheme, 0 to 360. Sets `--bulma-scheme-h`. */\n schemeH?: string;\n /** Base saturation for the color scheme, as a percentage. Sets `--bulma-scheme-s`. */\n schemeS?: string;\n /** Lightness for light backgrounds. Sets `--bulma-light-l`. */\n lightL?: string;\n /** Inverted lightness for light backgrounds. Sets `--bulma-light-invert-l`. */\n lightInvertL?: string;\n /** Lightness for dark backgrounds. Sets `--bulma-dark-l`. */\n darkL?: string;\n /** Inverted lightness for dark backgrounds. Sets `--bulma-dark-invert-l`. */\n darkInvertL?: string;\n /** Lightness for soft colors. Sets `--bulma-soft-l`. */\n softL?: string;\n /** Lightness for bold colors. Sets `--bulma-bold-l`. */\n boldL?: string;\n /** Inverted lightness for soft colors. Sets `--bulma-soft-invert-l`. */\n softInvertL?: string;\n /** Inverted lightness for bold colors. Sets `--bulma-bold-invert-l`. */\n boldInvertL?: string;\n /** Lightness change of a background on hover. Sets `--bulma-hover-background-l-delta`. */\n hoverBackgroundLDelta?: string;\n /** Lightness change of a background when active. Sets `--bulma-active-background-l-delta`. */\n activeBackgroundLDelta?: string;\n /** Lightness change of a border on hover. Sets `--bulma-hover-border-l-delta`. */\n hoverBorderLDelta?: string;\n /** Lightness change of a border when active. Sets `--bulma-active-border-l-delta`. */\n activeBorderLDelta?: string;\n /** Lightness change of text color on hover. Sets `--bulma-hover-color-l-delta`. */\n hoverColorLDelta?: string;\n /** Lightness change of text color when active. Sets `--bulma-active-color-l-delta`. */\n activeColorLDelta?: string;\n /** Alpha change of a shadow on hover. Sets `--bulma-hover-shadow-a-delta`. */\n hoverShadowADelta?: string;\n /** Alpha change of a shadow when active. Sets `--bulma-active-shadow-a-delta`. */\n activeShadowADelta?: string;\n // Bulma color variables\n /** Primary color hue, 0 to 360. Sets `--bulma-primary-h`. */\n primaryH?: string;\n /** Primary color saturation, as a percentage. Sets `--bulma-primary-s`. */\n primaryS?: string;\n /** Primary color lightness, as a percentage. Sets `--bulma-primary-l`. */\n primaryL?: string;\n /** Link color hue, 0 to 360. Sets `--bulma-link-h`. */\n linkH?: string;\n /** Link color saturation, as a percentage. Sets `--bulma-link-s`. */\n linkS?: string;\n /** Link color lightness, as a percentage. Sets `--bulma-link-l`. */\n linkL?: string;\n /** Info color hue, 0 to 360. Sets `--bulma-info-h`. */\n infoH?: string;\n /** Info color saturation, as a percentage. Sets `--bulma-info-s`. */\n infoS?: string;\n /** Info color lightness, as a percentage. Sets `--bulma-info-l`. */\n infoL?: string;\n /** Success color hue, 0 to 360. Sets `--bulma-success-h`. */\n successH?: string;\n /** Success color saturation, as a percentage. Sets `--bulma-success-s`. */\n successS?: string;\n /** Success color lightness, as a percentage. Sets `--bulma-success-l`. */\n successL?: string;\n /** Warning color hue, 0 to 360. Sets `--bulma-warning-h`. */\n warningH?: string;\n /** Warning color saturation, as a percentage. Sets `--bulma-warning-s`. */\n warningS?: string;\n /** Warning color lightness, as a percentage. Sets `--bulma-warning-l`. */\n warningL?: string;\n /** Danger color hue, 0 to 360. Sets `--bulma-danger-h`. */\n dangerH?: string;\n /** Danger color saturation, as a percentage. Sets `--bulma-danger-s`. */\n dangerS?: string;\n /** Danger color lightness, as a percentage. Sets `--bulma-danger-l`. */\n dangerL?: string;\n // Add other commonly used ones as needed\n}\n\n/**\n * Theme component that injects Bulma CSS variables either globally or locally.\n *\n * When `isRoot` is true, variables are injected at `:root`. Otherwise, a wrapping\n * `<div>` scopes the variables to its children.\n *\n * @function\n * @param {ThemeProps} props - Props for the Theme component.\n * @returns {JSX.Element} The theme wrapper or fragment.\n *\n * @example\n * // Local theme scope\n * <Theme primaryH=\"171\" primaryS=\"100%\" primaryL=\"41%\">\n * <Button color=\"primary\">Themed</Button>\n * </Theme>\n */\nexport const Theme: React.FC<ThemeProps> = ({\n bulmaVars = {},\n children,\n className,\n isRoot = false,\n colorMode,\n radius,\n columnGap,\n ...restProps\n}) => {\n const radiusVar = themeRadiusVar(radius);\n const columnGapVar = themeColumnGapVar(columnGap);\n const radiusHelper = (validRadii as readonly unknown[]).includes(radius)\n ? radius\n : undefined;\n\n // A radius size only adds its class, and a root Theme renders no wrapper to\n // carry one, so on `isRoot` it does nothing at all. Say so, as the other\n // radius routes that do not do what they look like do.\n if (isRoot && radiusHelper && radiusHelperVars[radiusHelper] === undefined) {\n warnOnce(\n 'Theme:root-radius-size',\n `[bestax-bulma] <Theme isRoot radius=\"${radiusHelper}\">: a root Theme ` +\n `has no wrapper element for has-radius-${radiusHelper}, and the ` +\n 'radius sizes set no variable, so this does nothing. To round one ' +\n `element, put radius=\"${radiusHelper}\" on it. To change the radius ` +\n \"across the page, set bulmaVars={{ '--bulma-radius': '…' }} instead.\"\n );\n }\n\n // The same for a gap step in `columnGap`, which reads like the columns\n // gutter it once set and, at the root, has no element for its class.\n const columnGapStep =\n typeof columnGap === 'number' ? String(columnGap) : columnGap;\n if (\n isRoot &&\n columnGapStep !== undefined &&\n (validGaps as readonly unknown[]).includes(columnGapStep)\n ) {\n warnOnce(\n 'Theme:root-column-gap',\n `[bestax-bulma] <Theme isRoot columnGap=\"${columnGapStep}\">: a root ` +\n `Theme has no wrapper element for is-column-gap-${columnGapStep}, ` +\n 'and a gap step sets no variable, so this does nothing. To change ' +\n 'the columns gutter across the page, set ' +\n \"bulmaVars={{ '--bulma-column-gap': '…' }} instead.\"\n );\n }\n\n // Extract Bulma variable props from restProps\n const { bulmaVarProps, otherProps } = useMemo(() => {\n const varProps: Record<string, string | undefined> = {};\n const otherPropsObj: Record<string, unknown> = {};\n\n for (const [key, value] of Object.entries(restProps)) {\n if (Object.prototype.hasOwnProperty.call(bulmaVarPropMap, key)) {\n varProps[key] = value as string;\n } else {\n otherPropsObj[key] = value;\n }\n }\n\n return { bulmaVarProps: varProps, otherProps: otherPropsObj };\n }, [restProps]);\n\n // Everything left in `otherProps` lands on the wrapper div, as a helper\n // class or an attribute, and so does `className`. A root Theme renders no\n // wrapper, so under `isRoot` all of it is dropped. `radius` and `columnGap`\n // are not in `otherProps`; the checks above cover them.\n if (isRoot) {\n const dropped = Object.entries(otherProps)\n .filter(\n ([, value]) => value !== undefined && value !== null && value !== false\n )\n .map(([key]) => key);\n if (className) {\n dropped.unshift('className');\n }\n if (dropped.length > 0) {\n warnOnce(\n 'Theme:root-dropped-props',\n `[bestax-bulma] <Theme isRoot>: a root Theme renders no wrapper ` +\n `element, so ${dropped.join(', ')} ` +\n `${dropped.length === 1 ? 'has' : 'have'} nothing to apply to. ` +\n 'Put helper props and classes on an element inside the Theme ' +\n 'instead.'\n );\n }\n }\n\n // Use Bulma classes for styling (only when not isRoot). Only a helper value\n // of `radius` reaches the helper; a legacy string went to the variable.\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n ...otherProps,\n radius: radiusHelper,\n columnGap,\n });\n\n // Merge bulmaVars and individual props, with props taking precedence\n const mergedVars: BulmaVars = useMemo(() => {\n const vars: BulmaVars = { ...bulmaVars };\n for (const [propName, cssVar] of Object.entries(bulmaVarPropMap)) {\n if (bulmaVarProps[propName] !== undefined) {\n vars[cssVar as BulmaVarKey] = bulmaVarProps[propName] as string;\n }\n }\n if (radiusVar !== undefined) {\n vars['--bulma-radius'] = radiusVar;\n }\n if (columnGapVar !== undefined) {\n vars['--bulma-column-gap'] = columnGapVar;\n }\n return vars;\n }, [bulmaVars, bulmaVarProps, radiusVar, columnGapVar]);\n\n // From an effect rather than the render body, so rendering does none of\n // this work, and a server render none at all. In production it returns\n // at its development check before looking at the variables.\n useEffect(() => {\n warnComponentVars(mergedVars);\n }, [mergedVars]);\n\n // This Theme's place among root Themes; see `rootThemeRules`.\n const [rootOrder] = useState(() => nextRootOrder++);\n\n // The `:root` rules this Theme contributes, or '' when it contributes none.\n const rootRules = useMemo(() => {\n if (!isRoot) {\n return '';\n }\n const cssRules = Object.entries(mergedVars)\n .filter(\n ([key, value]) => bulmaCssVars.includes(key as BulmaVarKey) && value\n )\n .map(([key, value]) => `${key}: ${value};`)\n .join(' ');\n return cssRules ? `:root { ${cssRules} }` : '';\n }, [mergedVars, isRoot]);\n\n // Inject CSS variables globally at :root level, alongside any other root\n // Themes. Clearing `isRoot` or every variable passes '', which withdraws\n // this Theme's rules.\n useEffect(() => {\n setRootThemeRules(rootOrder, rootRules);\n }, [rootOrder, rootRules]);\n\n // Withdraw them on unmount. Kept apart from the effect above so a change\n // rewrites the shared element in place rather than removing and recreating\n // it between the cleanup and the next run.\n useEffect(() => () => setRootThemeRules(rootOrder, ''), [rootOrder]);\n\n // Bulma names its scheme attribute after the class prefix a stylesheet was\n // built with (`data-<prefix>theme`), so the prefixed builds read\n // `data-bestax-theme` and never `data-theme`.\n const classPrefix = useClassPrefix();\n\n // Toggle Bulma's light/dark scheme by writing the theme attribute on the\n // document root (<html>). This is always global, even on a scoped Theme.\n // Under a class prefix the prefixed attribute is written as well as\n // `data-theme`, so whichever build is loaded sees it; with no prefix only\n // `data-theme` is. `'system'` removes them so Bulma follows the OS\n // preference.\n useEffect(() => {\n if (colorMode === undefined) {\n return;\n }\n\n const root = document.documentElement;\n const names = classPrefix\n ? ['data-theme', `data-${classPrefix}theme`]\n : ['data-theme'];\n const previous = names.map(name => root.getAttribute(name));\n\n for (const name of names) {\n if (colorMode === 'system') {\n root.removeAttribute(name);\n continue;\n }\n try {\n root.setAttribute(name, colorMode);\n } catch {\n // A class prefix can hold characters an attribute name cannot.\n // `data-theme` is still written, as it was before the prefixed\n // attribute existed, but a sheet built with that prefix keeps its\n // scheme, so say so.\n warnOnce(\n 'Theme:color-mode-prefix',\n `[bestax-bulma] <Theme colorMode=\"${colorMode}\">: the class ` +\n `prefix \"${classPrefix}\" makes ${name} an invalid attribute ` +\n 'name, so only data-theme is written, and a stylesheet built ' +\n 'with that prefix keeps its scheme.'\n );\n }\n }\n\n // Restore the previous values when colorMode changes or the component unmounts.\n return () => {\n names.forEach((name, i) => {\n const value = previous[i];\n if (value === null) {\n root.removeAttribute(name);\n } else {\n root.setAttribute(name, value);\n }\n });\n };\n }, [colorMode, classPrefix]);\n\n // For local injection (when isRoot is false), prepare style object for CSS vars\n const style: CSSProperties = useMemo(() => {\n if (isRoot) {\n return {};\n }\n\n const styleObj: CSSProperties = {};\n for (const [key, value] of Object.entries(mergedVars)) {\n if (bulmaCssVars.includes(key as BulmaVarKey) && value) {\n (styleObj as Record<string, string>)[key] = value;\n }\n }\n return styleObj;\n }, [mergedVars, isRoot]);\n\n // Generate combined class names for the wrapper div\n const combinedClassName = useMemo(() => {\n if (isRoot) {\n return '';\n }\n return classNames(className, bulmaHelperClasses);\n }, [className, bulmaHelperClasses, isRoot]);\n\n return isRoot ? (\n <>{children}</>\n ) : (\n <div className={combinedClassName || undefined} style={style} {...rest}>\n {children}\n </div>\n );\n};\n"],"names":["_jsx","_Fragment"],"mappings":";;;;;;;;;AAaA;AACA;AAEA;;;;;AAKG;AACH,MAAM,eAAe,GAAG;;IAEtB,kBAAkB;IAClB,kBAAkB;IAClB,qBAAqB;IACrB,yBAAyB;IACzB,yBAAyB;IACzB,uBAAuB;IACvB,2BAA2B;IAC3B,2BAA2B;IAC3B,iBAAiB;IACjB,wBAAwB;IACxB,gBAAgB;IAChB,uBAAuB;IACvB,gBAAgB;IAChB,gBAAgB;IAChB,uBAAuB;IACvB,uBAAuB;IACvB,kCAAkC;IAClC,mCAAmC;IACnC,8BAA8B;IAC9B,+BAA+B;IAC/B,6BAA6B;IAC7B,8BAA8B;IAC9B,8BAA8B;IAC9B,+BAA+B;;IAE/B,mBAAmB;IACnB,mBAAmB;IACnB,mBAAmB;IACnB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,mBAAmB;IACnB,mBAAmB;IACnB,mBAAmB;IACnB,mBAAmB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AU,CAAC,EAAE;YACrD,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAkB,CAAC,IAAI,KAAK,EAAE;AACrD,gBAAA,QAAmC,CAAC,GAAG,CAAC,GAAG,KAAK;YACnD;QACF;AACA,QAAA,OAAO,QAAQ;AACjB,IAAA,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;;AAGxB,IAAA,MAAM,iBAAiB,GAAG,OAAO,CAAC,MAAK;QACrC,IAAI,MAAM,EAAE;AACV,YAAA,OAAO,EAAE;QACX;AACA,QAAA,OAAO,UAAU,CAAC,SAAS,EAAE,kBAAkB,CAAC;IAClD,CAAC,EAAE,CAAC,SAAS,EAAE,kBAAkB,EAAE,MAAM,CAAC,CAAC;AAE3C,IAAA,OAAO,MAAM,IACXA,GAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAI,KAEfD,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,iBAAiB,IAAI,SAAS,EAAE,KAAK,EAAE,KAAK,EAAA,GAAM,IAAI,EAAA,QAAA,EACnE,QAAQ,EAAA,CACL,CACP;AACH;;"}
@@ -1,5 +1,5 @@
1
1
  /* @allxsmith/bestax-bulma — AI agents: see AGENTS.md in the package root, or https://bestax.io/llms.txt */
2
- import { useState } from 'react';
2
+ import { useState, useRef } from 'react';
3
3
  import { useClientLayoutEffect } from './useClientLayoutEffect.js';
4
4
 
5
5
  // INTERNAL: deliberately not exported from src/index.ts.
@@ -23,13 +23,17 @@ function resolveAuto(view, rect, panelWidth, panelHeight, gap) {
23
23
  return fitsRight ? 'bottom-left' : 'bottom-right';
24
24
  return fitsRight ? 'top-left' : 'top-right';
25
25
  }
26
- const samePosition = (a, b) => a.position === b.position && a.top === b.top && a.left === b.left;
26
+ const samePosition = (a, b) => a.position === b.position &&
27
+ a.top === b.top &&
28
+ a.left === b.left &&
29
+ a.minWidth === b.minWidth;
27
30
  /**
28
31
  * Places a floating panel against its anchor: resolves `auto` to a corner
29
32
  * and, for a panel fixed to the viewport, works out its coordinates. It
30
33
  * measures again on resize and on any scroll of the anchor's window (an
31
34
  * iframe's, when the anchor renders into one), so a fixed panel follows its
32
- * anchor. A measurement that changes nothing doesn't render again.
35
+ * anchor, and with `followContent` after each render too. A measurement that
36
+ * changes nothing doesn't render again.
33
37
  *
34
38
  * Measuring happens in a layout effect, so the panel is placed before it
35
39
  * paints. It needs both elements on the page while `active` is on, and
@@ -41,10 +45,13 @@ const samePosition = (a, b) => a.position === b.position && a.top === b.top && a
41
45
  * @param options - Whether to measure, the corner asked for, and how the panel is placed.
42
46
  * @returns The corner the panel opens from, with coordinates when it is fixed.
43
47
  */
44
- function useAnchoredPosition(anchorRef, panelRef, { active, position, fixed, offset = 4, styledGap }) {
48
+ function useAnchoredPosition(anchorRef, panelRef, { active, position, fixed, offset = 4, styledGap, matchWidth = false, followContent = false, }) {
45
49
  const [resolved, setResolved] = useState({
46
50
  position: position === 'auto' ? 'bottom-left' : position,
47
51
  });
52
+ // The measurement while the panel is active, for `followContent` to run
53
+ // again after a render.
54
+ const updateRef = useRef(null);
48
55
  useClientLayoutEffect(() => {
49
56
  if (!active)
50
57
  return undefined;
@@ -56,7 +63,12 @@ function useAnchoredPosition(anchorRef, panelRef, { active, position, fixed, off
56
63
  if (!anchor || !panel)
57
64
  return;
58
65
  const rect = anchor.getBoundingClientRect();
59
- const { width, height } = panel.getBoundingClientRect();
66
+ const measured = panel.getBoundingClientRect();
67
+ // The width the panel has once it's at least as wide as the anchor.
68
+ const width = matchWidth
69
+ ? Math.max(measured.width, rect.width)
70
+ : measured.width;
71
+ const { height } = measured;
60
72
  const corner = position === 'auto'
61
73
  ? resolveAuto(view, rect, width, height, offset + (styledGap?.(panel) ?? 0))
62
74
  : position;
@@ -67,18 +79,35 @@ function useAnchoredPosition(anchorRef, panelRef, { active, position, fixed, off
67
79
  ? rect.bottom + offset
68
80
  : rect.top - height - offset,
69
81
  left: corner.endsWith('left') ? rect.left : rect.right - width,
82
+ ...(matchWidth ? { minWidth: rect.width } : {}),
70
83
  }
71
84
  : { position: corner };
72
85
  setResolved(prev => (samePosition(prev, next) ? prev : next));
73
86
  };
87
+ updateRef.current = update;
74
88
  update();
75
89
  view.addEventListener('resize', update, { passive: true });
76
90
  view.addEventListener('scroll', update, { passive: true, capture: true });
77
91
  return () => {
92
+ updateRef.current = null;
78
93
  view.removeEventListener('resize', update);
79
94
  view.removeEventListener('scroll', update, { capture: true });
80
95
  };
81
- }, [active, anchorRef, panelRef, position, fixed, offset, styledGap]);
96
+ }, [
97
+ active,
98
+ anchorRef,
99
+ panelRef,
100
+ position,
101
+ fixed,
102
+ offset,
103
+ styledGap,
104
+ matchWidth,
105
+ ]);
106
+ // After every render, on purpose: the panel's content is what changed.
107
+ useClientLayoutEffect(() => {
108
+ if (followContent)
109
+ updateRef.current?.();
110
+ });
82
111
  return resolved;
83
112
  }
84
113
 
@@ -1 +1 @@
1
- {"version":3,"file":"useAnchoredPosition.js","sources":["../../../src/helpers/useAnchoredPosition.ts"],"sourcesContent":["// INTERNAL: deliberately not exported from src/index.ts.\nimport { useState } from 'react';\nimport type { RefObject } from 'react';\nimport type { PickerPosition } from '../form/_pickerInternals/pickerTypes';\nimport { useClientLayoutEffect } from './useClientLayoutEffect';\n\n/** A corner of the anchor the panel opens from, once `auto` is resolved. */\nexport type AnchoredCorner = Exclude<PickerPosition, 'auto'>;\n\n/**\n * Where the panel goes: the corner it opens from and, when it is fixed to\n * the viewport, its coordinates there.\n */\nexport interface AnchoredPosition {\n position: AnchoredCorner;\n top?: number;\n left?: number;\n}\n\n/**\n * Options for `useAnchoredPosition`.\n */\nexport interface UseAnchoredPositionOptions {\n /** Whether the panel is on the page. Nothing is measured while it is not. */\n active: boolean;\n /** The corner asked for, or `auto` to pick one that keeps the panel in the viewport. */\n position: PickerPosition;\n /**\n * Whether the panel is fixed to the viewport (it was portaled away from the\n * anchor), which needs coordinates. Otherwise the panel's CSS places it\n * against the anchor from the corner alone.\n */\n fixed: boolean;\n /**\n * The gap between the anchor and the panel, in pixels, that the hook puts\n * there itself: added to the fixed coordinates and to the room `auto` asks\n * for below the anchor. Popover and the pickers' popover pass `0` and take\n * their gap from a margin in their stylesheet, read through `styledGap`, so\n * a theme's offset moves the panel and `auto` alike. A new panel should do\n * the same rather than rely on this default, which no stylesheet sees.\n * @defaultValue 4\n */\n offset?: number;\n /**\n * Reads the gap the panel's own stylesheet puts between it and the anchor,\n * in pixels, each time the panel is measured. `auto` leaves room for it as\n * well; the coordinates don't include it, because the stylesheet applies it.\n */\n styledGap?: (panel: HTMLElement) => number;\n}\n\n/**\n * A `styledGap` for a panel whose stylesheet puts the gap in a margin on the\n * side facing the anchor, negative on a portaled panel above it, so the\n * larger magnitude is the gap. In pixels.\n */\nexport function marginGap(panel: HTMLElement): number {\n const { marginTop, marginBottom } = getComputedStyle(panel);\n return Math.max(\n Math.abs(parseFloat(marginTop)) || 0,\n Math.abs(parseFloat(marginBottom)) || 0\n );\n}\n\n/**\n * The corner that keeps a panel of this size in the viewport, preferring\n * below the anchor and lined up with its left edge.\n */\nfunction resolveAuto(\n view: Window,\n rect: DOMRect,\n panelWidth: number,\n panelHeight: number,\n gap: number\n): AnchoredCorner {\n const fitsBelow = rect.bottom + panelHeight + gap <= view.innerHeight;\n const fitsRight = rect.left + panelWidth <= view.innerWidth;\n if (fitsBelow) return fitsRight ? 'bottom-left' : 'bottom-right';\n return fitsRight ? 'top-left' : 'top-right';\n}\n\nconst samePosition = (a: AnchoredPosition, b: AnchoredPosition): boolean =>\n a.position === b.position && a.top === b.top && a.left === b.left;\n\n/**\n * Places a floating panel against its anchor: resolves `auto` to a corner\n * and, for a panel fixed to the viewport, works out its coordinates. It\n * measures again on resize and on any scroll of the anchor's window (an\n * iframe's, when the anchor renders into one), so a fixed panel follows its\n * anchor. A measurement that changes nothing doesn't render again.\n *\n * Measuring happens in a layout effect, so the panel is placed before it\n * paints. It needs both elements on the page while `active` is on, and\n * keeps the last placement when either is missing.\n *\n * @function useAnchoredPosition\n * @param anchorRef - The element the panel opens from.\n * @param panelRef - The floating panel.\n * @param options - Whether to measure, the corner asked for, and how the panel is placed.\n * @returns The corner the panel opens from, with coordinates when it is fixed.\n */\nexport function useAnchoredPosition(\n anchorRef: RefObject<HTMLElement | null>,\n panelRef: RefObject<HTMLElement | null>,\n { active, position, fixed, offset = 4, styledGap }: UseAnchoredPositionOptions\n): AnchoredPosition {\n const [resolved, setResolved] = useState<AnchoredPosition>({\n position: position === 'auto' ? 'bottom-left' : position,\n });\n\n useClientLayoutEffect(() => {\n if (!active) return undefined;\n const view =\n (anchorRef.current ?? panelRef.current)?.ownerDocument.defaultView ??\n window;\n const update = () => {\n const anchor = anchorRef.current;\n const panel = panelRef.current;\n if (!anchor || !panel) return;\n const rect = anchor.getBoundingClientRect();\n const { width, height } = panel.getBoundingClientRect();\n const corner =\n position === 'auto'\n ? resolveAuto(\n view,\n rect,\n width,\n height,\n offset + (styledGap?.(panel) ?? 0)\n )\n : position;\n const next: AnchoredPosition = fixed\n ? {\n position: corner,\n top: corner.startsWith('bottom')\n ? rect.bottom + offset\n : rect.top - height - offset,\n left: corner.endsWith('left') ? rect.left : rect.right - width,\n }\n : { position: corner };\n setResolved(prev => (samePosition(prev, next) ? prev : next));\n };\n update();\n view.addEventListener('resize', update, { passive: true });\n view.addEventListener('scroll', update, { passive: true, capture: true });\n return () => {\n view.removeEventListener('resize', update);\n view.removeEventListener('scroll', update, { capture: true });\n };\n }, [active, anchorRef, panelRef, position, fixed, offset, styledGap]);\n\n return resolved;\n}\n"],"names":[],"mappings":";;;;AAAA;AAmDA;;;;AAIG;AACG,SAAU,SAAS,CAAC,KAAkB,EAAA;IAC1C,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,gBAAgB,CAAC,KAAK,CAAC;AAC3D,IAAA,OAAO,IAAI,CAAC,GAAG,CACb,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,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V,YAAA,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC;AAC1C,YAAA,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC/D,QAAA,CAAC;AACH,IAAA,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;AAErE,IAAA,OAAO,QAAQ;AACjB;;"}
1
+ {"version":3,"file":"useAnchoredPosition.js","sources":["../../../src/helpers/useAnchoredPosition.ts"],"sourcesContent":["// INTERNAL: deliberately not exported from src/index.ts.\nimport { useRef, useState } from 'react';\nimport type { RefObject } from 'react';\nimport type { PickerPosition } from '../form/_pickerInternals/pickerTypes';\nimport { useClientLayoutEffect } from './useClientLayoutEffect';\n\n/** A corner of the anchor the panel opens from, once `auto` is resolved. */\nexport type AnchoredCorner = Exclude<PickerPosition, 'auto'>;\n\n/**\n * Where the panel goes: the corner it opens from and, when it is fixed to\n * the viewport, its coordinates there.\n */\nexport interface AnchoredPosition {\n position: AnchoredCorner;\n top?: number;\n left?: number;\n /**\n * With `matchWidth`, the anchor's width, which a fixed panel takes as its\n * `min-width`.\n */\n minWidth?: number;\n}\n\n/**\n * Options for `useAnchoredPosition`.\n */\nexport interface UseAnchoredPositionOptions {\n /** Whether the panel is on the page. Nothing is measured while it is not. */\n active: boolean;\n /** The corner asked for, or `auto` to pick one that keeps the panel in the viewport. */\n position: PickerPosition;\n /**\n * Whether the panel is fixed to the viewport (it was portaled away from the\n * anchor), which needs coordinates. Otherwise the panel's CSS places it\n * against the anchor from the corner alone.\n */\n fixed: boolean;\n /**\n * The gap between the anchor and the panel, in pixels, that the hook puts\n * there itself: added to the fixed coordinates and to the room `auto` asks\n * for below the anchor. Popover and the pickers' popover pass `0` and take\n * their gap from a margin in their stylesheet, read through `styledGap`, so\n * a theme's offset moves the panel and `auto` alike. A new panel should do\n * the same rather than rely on this default, which no stylesheet sees.\n * @defaultValue 4\n */\n offset?: number;\n /**\n * Reads the gap the panel's own stylesheet puts between it and the anchor,\n * in pixels, each time the panel is measured. `auto` leaves room for it as\n * well; the coordinates don't include it, because the stylesheet applies it.\n */\n styledGap?: (panel: HTMLElement) => number;\n /**\n * Whether the panel is at least as wide as the anchor, as a list under its\n * field is. A panel in place gets that from its stylesheet. A fixed one\n * can't, so its placement carries the anchor's width as `minWidth` for the\n * panel to set, and its coordinates and `auto` already allow for it.\n * @defaultValue false\n */\n matchWidth?: boolean;\n /**\n * Measures again after each render of the component holding the hook, for\n * a panel whose content changes while it's open, as a filtered list's\n * does. A fixed panel above its anchor is placed from its height, and\n * `auto` reads the height too, so a measurement taken when it opened goes\n * stale as the content changes.\n * @defaultValue false\n */\n followContent?: boolean;\n}\n\n/**\n * A `styledGap` for a panel whose stylesheet puts the gap in a margin on the\n * side facing the anchor, negative on a portaled panel above it, so the\n * larger magnitude is the gap. In pixels.\n */\nexport function marginGap(panel: HTMLElement): number {\n const { marginTop, marginBottom } = getComputedStyle(panel);\n return Math.max(\n Math.abs(parseFloat(marginTop)) || 0,\n Math.abs(parseFloat(marginBottom)) || 0\n );\n}\n\n/**\n * The corner that keeps a panel of this size in the viewport, preferring\n * below the anchor and lined up with its left edge.\n */\nfunction resolveAuto(\n view: Window,\n rect: DOMRect,\n panelWidth: number,\n panelHeight: number,\n gap: number\n): AnchoredCorner {\n const fitsBelow = rect.bottom + panelHeight + gap <= view.innerHeight;\n const fitsRight = rect.left + panelWidth <= view.innerWidth;\n if (fitsBelow) return fitsRight ? 'bottom-left' : 'bottom-right';\n return fitsRight ? 'top-left' : 'top-right';\n}\n\nconst samePosition = (a: AnchoredPosition, b: AnchoredPosition): boolean =>\n a.position === b.position &&\n a.top === b.top &&\n a.left === b.left &&\n a.minWidth === b.minWidth;\n\n/**\n * Places a floating panel against its anchor: resolves `auto` to a corner\n * and, for a panel fixed to the viewport, works out its coordinates. It\n * measures again on resize and on any scroll of the anchor's window (an\n * iframe's, when the anchor renders into one), so a fixed panel follows its\n * anchor, and with `followContent` after each render too. A measurement that\n * changes nothing doesn't render again.\n *\n * Measuring happens in a layout effect, so the panel is placed before it\n * paints. It needs both elements on the page while `active` is on, and\n * keeps the last placement when either is missing.\n *\n * @function useAnchoredPosition\n * @param anchorRef - The element the panel opens from.\n * @param panelRef - The floating panel.\n * @param options - Whether to measure, the corner asked for, and how the panel is placed.\n * @returns The corner the panel opens from, with coordinates when it is fixed.\n */\nexport function useAnchoredPosition(\n anchorRef: RefObject<HTMLElement | null>,\n panelRef: RefObject<HTMLElement | null>,\n {\n active,\n position,\n fixed,\n offset = 4,\n styledGap,\n matchWidth = false,\n followContent = false,\n }: UseAnchoredPositionOptions\n): AnchoredPosition {\n const [resolved, setResolved] = useState<AnchoredPosition>({\n position: position === 'auto' ? 'bottom-left' : position,\n });\n // The measurement while the panel is active, for `followContent` to run\n // again after a render.\n const updateRef = useRef<(() => void) | null>(null);\n\n useClientLayoutEffect(() => {\n if (!active) return undefined;\n const view =\n (anchorRef.current ?? panelRef.current)?.ownerDocument.defaultView ??\n window;\n const update = () => {\n const anchor = anchorRef.current;\n const panel = panelRef.current;\n if (!anchor || !panel) return;\n const rect = anchor.getBoundingClientRect();\n const measured = panel.getBoundingClientRect();\n // The width the panel has once it's at least as wide as the anchor.\n const width = matchWidth\n ? Math.max(measured.width, rect.width)\n : measured.width;\n const { height } = measured;\n const corner =\n position === 'auto'\n ? resolveAuto(\n view,\n rect,\n width,\n height,\n offset + (styledGap?.(panel) ?? 0)\n )\n : position;\n const next: AnchoredPosition = fixed\n ? {\n position: corner,\n top: corner.startsWith('bottom')\n ? rect.bottom + offset\n : rect.top - height - offset,\n left: corner.endsWith('left') ? rect.left : rect.right - width,\n ...(matchWidth ? { minWidth: rect.width } : {}),\n }\n : { position: corner };\n setResolved(prev => (samePosition(prev, next) ? prev : next));\n };\n updateRef.current = update;\n update();\n view.addEventListener('resize', update, { passive: true });\n view.addEventListener('scroll', update, { passive: true, capture: true });\n return () => {\n updateRef.current = null;\n view.removeEventListener('resize', update);\n view.removeEventListener('scroll', update, { capture: true });\n };\n }, [\n active,\n anchorRef,\n panelRef,\n position,\n fixed,\n offset,\n styledGap,\n matchWidth,\n ]);\n\n // After every render, on purpose: the panel's content is what changed.\n useClientLayoutEffect(() => {\n if (followContent) updateRef.current?.();\n });\n\n return resolved;\n}\n"],"names":[],"mappings":";;;;AAAA;AAyEA;;;;AAIG;AACG,SAAU,SAAS,CAAC,KAAkB,EAAA;IAC1C,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,gBAAgB,CAAC,KAAK,CAAC;AAC3D,IAAA,OAAO,IAAI,CAAC,GAAG,CACb,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,EACpC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CACxC;AACH;AAEA;;;AAGG;AACH,SAAS,WAAW,CAClB,IAAY,EACZ,IAAa,EACb,UAAkB,EAClB,WAAmB,EACnB,GAAW,EAAA;AAEX,IAAA,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,GAAG,WAAW,GAAG,GAAG,IAAI,IAAI,CAAC,WAAW;IACrE,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,GAAG,UAAU,IAAI,IAAI,CAAC,UAAU;AAC3D,IAAA,IAAI,SAAS;QAAE,OAAO,SAAS,GAAG,aAAa,GAAG,cAAc;IAChE,OAAO,SAAS,GAAG,UAAU,GAAG,WAAW;AAC7C;AAEA,MAAM,YAAY,GAAG,CAAC,CAAmB,EAAE,CAAmB,KAC5D,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,QAAQ;AACzB,IAAA,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG;AACf,IAAA,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI;AACjB,IAA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