@msviderok/base-ui-solid 1.0.0-beta.8 → 1.0.0-beta.9

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.
@@ -176,13 +176,14 @@ function ScrollAreaRoot(componentProps) {
176
176
  };
177
177
  (0, _solidJs.onMount)(() => {
178
178
  if (!document.head.getElementsByTagName('style').namedItem(_styles.STYLE_TAG_ID)) {
179
- document.head.appendChild(_styles.styleDisableScrollbar.element);
179
+ const el = _styles.styleDisableScrollbar.element();
180
+ document.head.appendChild(el);
181
+ (0, _solidJs.onCleanup)(() => {
182
+ if (document.head.getElementsByTagName('style').namedItem(_styles.STYLE_TAG_ID)) {
183
+ document.head.removeChild(el);
184
+ }
185
+ });
180
186
  }
181
- (0, _solidJs.onCleanup)(() => {
182
- if (document.head.getElementsByTagName('style').namedItem(_styles.STYLE_TAG_ID)) {
183
- document.head.removeChild(_styles.styleDisableScrollbar.element);
184
- }
185
- });
186
187
  });
187
188
  const element = (0, _useRenderElement.useRenderElement)('div', componentProps, {
188
189
  props: [{
@@ -315,7 +315,18 @@ function SelectPopup(componentProps) {
315
315
  }
316
316
  }, elementProps]
317
317
  });
318
- return [(0, _web.memo)(() => _styles.styleDisableScrollbar.element), (0, _web.createComponent)(_floatingUiSolid.FloatingFocusManager, {
318
+ (0, _solidJs.onMount)(() => {
319
+ if (!document.head.getElementsByTagName('style').namedItem(_styles.STYLE_TAG_ID)) {
320
+ const el = _styles.styleDisableScrollbar.element();
321
+ document.head.appendChild(el);
322
+ (0, _solidJs.onCleanup)(() => {
323
+ if (document.head.getElementsByTagName('style').namedItem(_styles.STYLE_TAG_ID)) {
324
+ document.head.removeChild(el);
325
+ }
326
+ });
327
+ }
328
+ });
329
+ return (0, _web.createComponent)(_floatingUiSolid.FloatingFocusManager, {
319
330
  context: context,
320
331
  modal: false,
321
332
  get disabled() {
@@ -325,5 +336,5 @@ function SelectPopup(componentProps) {
325
336
  get children() {
326
337
  return element();
327
338
  }
328
- })];
339
+ });
329
340
  }
@@ -1,5 +1,5 @@
1
1
  export declare const STYLE_TAG_ID = "disable-scrollbar";
2
2
  export declare const styleDisableScrollbar: {
3
3
  class: string;
4
- element: Node;
4
+ element: () => HTMLStyleElement;
5
5
  };
@@ -4,10 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.styleDisableScrollbar = exports.STYLE_TAG_ID = void 0;
7
- var _web = require("solid-js/web");
8
- var _tmpl$ = /*#__PURE__*/(0, _web.template)(`<style id=disable-scrollbar>.base-ui-disable-scrollbar\{scrollbar-width:none}.base-ui-disable-scrollbar::-webkit-scrollbar\{display:none}`);
9
7
  const STYLE_TAG_ID = exports.STYLE_TAG_ID = 'disable-scrollbar';
10
8
  const styleDisableScrollbar = exports.styleDisableScrollbar = {
11
9
  class: 'base-ui-disable-scrollbar',
12
- element: _tmpl$()
10
+ element: () => {
11
+ const style = document.createElement('style');
12
+ style.id = STYLE_TAG_ID;
13
+ style.textContent = `.base-ui-disable-scrollbar{scrollbar-width:none}.base-ui-disable-scrollbar::-webkit-scrollbar{display:none}`;
14
+ return style;
15
+ }
13
16
  };
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @msviderok/base-ui-solid v1.0.0-beta.8
2
+ * @msviderok/base-ui-solid v1.0.0-beta.9
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -170,13 +170,14 @@ export function ScrollAreaRoot(componentProps) {
170
170
  };
171
171
  onMount(() => {
172
172
  if (!document.head.getElementsByTagName('style').namedItem(STYLE_TAG_ID)) {
173
- document.head.appendChild(styleDisableScrollbar.element);
173
+ const el = styleDisableScrollbar.element();
174
+ document.head.appendChild(el);
175
+ onCleanup(() => {
176
+ if (document.head.getElementsByTagName('style').namedItem(STYLE_TAG_ID)) {
177
+ document.head.removeChild(el);
178
+ }
179
+ });
174
180
  }
175
- onCleanup(() => {
176
- if (document.head.getElementsByTagName('style').namedItem(STYLE_TAG_ID)) {
177
- document.head.removeChild(styleDisableScrollbar.element);
178
- }
179
- });
180
181
  });
181
182
  const element = useRenderElement('div', componentProps, {
182
183
  props: [{
@@ -1,6 +1,5 @@
1
1
  import { createComponent as _$createComponent } from "solid-js/web";
2
- import { memo as _$memo } from "solid-js/web";
3
- import { createEffect, onCleanup } from 'solid-js';
2
+ import { createEffect, onCleanup, onMount } from 'solid-js';
4
3
  import { FloatingFocusManager } from "../../floating-ui-solid/index.js";
5
4
  import { splitComponentProps } from "../../solid-helpers.js";
6
5
  import { DISABLED_TRANSITIONS_STYLE } from "../../utils/constants.js";
@@ -9,7 +8,7 @@ import { isMouseWithinBounds } from "../../utils/isMouseWithinBounds.js";
9
8
  import { ownerDocument, ownerWindow } from "../../utils/owner.js";
10
9
  import { popupStateMapping } from "../../utils/popupStateMapping.js";
11
10
  import { transitionStatusMapping } from "../../utils/styleHookMapping.js";
12
- import { styleDisableScrollbar } from "../../utils/styles.js";
11
+ import { STYLE_TAG_ID, styleDisableScrollbar } from "../../utils/styles.js";
13
12
  import { useOpenChangeComplete } from "../../utils/useOpenChangeComplete.js";
14
13
  import { useRenderElement } from "../../utils/useRenderElement.js";
15
14
  import { useSelectPositionerContext } from "../positioner/SelectPositionerContext.js";
@@ -310,7 +309,18 @@ export function SelectPopup(componentProps) {
310
309
  }
311
310
  }, elementProps]
312
311
  });
313
- return [_$memo(() => styleDisableScrollbar.element), _$createComponent(FloatingFocusManager, {
312
+ onMount(() => {
313
+ if (!document.head.getElementsByTagName('style').namedItem(STYLE_TAG_ID)) {
314
+ const el = styleDisableScrollbar.element();
315
+ document.head.appendChild(el);
316
+ onCleanup(() => {
317
+ if (document.head.getElementsByTagName('style').namedItem(STYLE_TAG_ID)) {
318
+ document.head.removeChild(el);
319
+ }
320
+ });
321
+ }
322
+ });
323
+ return _$createComponent(FloatingFocusManager, {
314
324
  context: context,
315
325
  modal: false,
316
326
  get disabled() {
@@ -320,5 +330,5 @@ export function SelectPopup(componentProps) {
320
330
  get children() {
321
331
  return element();
322
332
  }
323
- })];
333
+ });
324
334
  }
@@ -1,5 +1,5 @@
1
1
  export declare const STYLE_TAG_ID = "disable-scrollbar";
2
2
  export declare const styleDisableScrollbar: {
3
3
  class: string;
4
- element: Node;
4
+ element: () => HTMLStyleElement;
5
5
  };
@@ -1,7 +1,10 @@
1
- import { template as _$template } from "solid-js/web";
2
- var _tmpl$ = /*#__PURE__*/_$template(`<style id=disable-scrollbar>.base-ui-disable-scrollbar\{scrollbar-width:none}.base-ui-disable-scrollbar::-webkit-scrollbar\{display:none}`);
3
1
  export const STYLE_TAG_ID = 'disable-scrollbar';
4
2
  export const styleDisableScrollbar = {
5
3
  class: 'base-ui-disable-scrollbar',
6
- element: _tmpl$()
4
+ element: () => {
5
+ const style = document.createElement('style');
6
+ style.id = STYLE_TAG_ID;
7
+ style.textContent = `.base-ui-disable-scrollbar{scrollbar-width:none}.base-ui-disable-scrollbar::-webkit-scrollbar{display:none}`;
8
+ return style;
9
+ }
7
10
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@msviderok/base-ui-solid",
3
- "version": "1.0.0-beta.8",
3
+ "version": "1.0.0-beta.9",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "Base UI is a library of headless ('unstyled') Solid components and low-level hooks. You gain complete control over your app's CSS and accessibility features.",