@moneyforward/mfui-components 3.1.0 → 3.3.0

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 (48) hide show
  1. package/dist/src/DateTimeSelection/shared/BasePicker/BasePicker.d.ts +1 -1
  2. package/dist/src/DateTimeSelection/shared/BasePicker/BasePicker.js +6 -6
  3. package/dist/src/DateTimeSelection/shared/BasePicker/BasePicker.types.d.ts +1 -1
  4. package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePicker.d.ts +1 -1
  5. package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePicker.js +4 -4
  6. package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePicker.types.d.ts +8 -0
  7. package/dist/src/DateTimeSelection/shared/CalendarGrid/CalendarGrid.js +3 -1
  8. package/dist/src/DisplayTable/DisplayTable.d.ts +3 -2
  9. package/dist/src/DisplayTable/DisplayTable.js +4 -3
  10. package/dist/src/DisplayTable/DisplayTable.types.d.ts +7 -0
  11. package/dist/src/DisplayTable/DisplayTableBody/DisplayTableBody.js +15 -0
  12. package/dist/src/DisplayTable/DisplayTableCell/DisplayTableCell.js +9 -2
  13. package/dist/src/DisplayTable/DisplayTableHeaderRow/DisplayTableHeaderRow.js +12 -1
  14. package/dist/src/DisplayTable/DisplayTableProvider.d.ts +8 -4
  15. package/dist/src/DisplayTable/DisplayTableProvider.js +12 -3
  16. package/dist/src/MultipleSelectBox/MultipleSelectBox.d.ts +1 -1
  17. package/dist/src/MultipleSelectBox/MultipleSelectBox.js +65 -15
  18. package/dist/src/MultipleSelectBox/MultipleSelectBox.types.d.ts +86 -0
  19. package/dist/src/SelectBox/SelectBox.js +49 -11
  20. package/dist/src/SelectBox/SelectBox.types.d.ts +80 -1
  21. package/dist/src/Tag/Tag.js +1 -1
  22. package/dist/src/ToggleSwitch/ToggleSwitch.d.ts +9 -0
  23. package/dist/src/ToggleSwitch/ToggleSwitch.js +32 -0
  24. package/dist/src/ToggleSwitch/ToggleSwitch.types.d.ts +6 -0
  25. package/dist/src/ToggleSwitch/ToggleSwitch.types.js +1 -0
  26. package/dist/src/ToggleSwitch/index.d.ts +2 -0
  27. package/dist/src/ToggleSwitch/index.js +2 -0
  28. package/dist/src/index.d.ts +1 -0
  29. package/dist/src/index.js +1 -0
  30. package/dist/src/utilities/dom/useFixedColumns.js +36 -10
  31. package/dist/src/utilities/dom/useInfiniteScroll.d.ts +22 -0
  32. package/dist/src/utilities/dom/useInfiniteScroll.js +65 -0
  33. package/dist/styled-system/css/conditions.js +1 -1
  34. package/dist/styled-system/jsx/is-valid-prop.js +1 -1
  35. package/dist/styled-system/recipes/display-table-cell-slot-recipe.d.ts +1 -1
  36. package/dist/styled-system/recipes/display-table-cell-slot-recipe.js +4 -0
  37. package/dist/styled-system/recipes/index.d.ts +2 -1
  38. package/dist/styled-system/recipes/index.js +1 -0
  39. package/dist/styled-system/recipes/multiple-select-box-slot-recipe.d.ts +1 -1
  40. package/dist/styled-system/recipes/multiple-select-box-slot-recipe.js +24 -0
  41. package/dist/styled-system/recipes/select-box-slot-recipe.d.ts +2 -2
  42. package/dist/styled-system/recipes/select-box-slot-recipe.js +30 -1
  43. package/dist/styled-system/recipes/toggle-switch-slot-recipe.d.ts +33 -0
  44. package/dist/styled-system/recipes/toggle-switch-slot-recipe.js +36 -0
  45. package/dist/styled-system/types/conditions.d.ts +10 -0
  46. package/dist/styles.css +298 -34
  47. package/dist/tsconfig.build.tsbuildinfo +1 -1
  48. package/package.json +2 -2
@@ -1,12 +1,14 @@
1
1
  'use client';
2
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import React, { forwardRef, useCallback, useEffect, useId, useMemo, useRef, useState } from 'react';
4
- import { Dropdown as DropdownIcon } from '@moneyforward/mfui-icons-react';
4
+ import { Dropdown as DropdownIcon, Error } from '@moneyforward/mfui-icons-react';
5
5
  import { ClearButton } from '../shared/ClearButton';
6
6
  import { FocusIndicator } from '../FocusIndicator';
7
7
  import { selectBoxSlotRecipe } from '../../styled-system/recipes';
8
8
  import { Typography } from '../Typography';
9
9
  import { SearchBox } from '../SearchBox';
10
+ import { Button } from '../Button';
11
+ import { ProgressIndicator } from '../ProgressIndicator';
10
12
  import { useSearchBox } from './hooks/useSearchBox';
11
13
  import { Skeleton } from '../Skeleton';
12
14
  import { useFocusTrap } from '../utilities/dom/useFocusTrap';
@@ -22,6 +24,7 @@ import { SelectBoxOptionComponent } from './SelectBoxOption';
22
24
  import { SelectBoxOptionGroup } from './SelectBoxOptionGroup';
23
25
  import { isOptionDisabled } from './utils/isSelectableOption';
24
26
  import { useVirtualizedOptions } from './hooks/useVirtualizedOptions';
27
+ import { useInfiniteScroll } from '../utilities/dom/useInfiniteScroll';
25
28
  const DEFAULT_SCROLL_OPTIONS = {
26
29
  behavior: 'auto',
27
30
  block: 'center',
@@ -35,7 +38,7 @@ const SKELETON_ITEM_COUNT = 4;
35
38
  export const SelectBox = forwardRef((props, ref) => {
36
39
  const { id, triggerProps, clearButtonProps, enableClearButton = false, size, options = [], defaultValue,
37
40
  // eslint-disable-next-line @typescript-eslint/no-deprecated
38
- placeholder, emptyMessage, disabled, invalid, targetDOMNode, name, onChange, onBlur, value, enableSearchOptions = false, notFoundMessage, searchBoxProps, loading = false, onSearchOptions, renderDisplayValue, renderOption, renderPopoverContent, enableAutoScrollToSelectedOption, popoverContentProps, popoverWrapperProps, onOpenStateChanged, showGroupOptionDivider, triggerWrapperProps, enableAutoUnmount = true, enableConstrainedPopoverWidth = false, enableVirtualization = false, virtualizationOptions, } = props;
41
+ placeholder, emptyMessage, disabled, invalid, targetDOMNode, name, onChange, onBlur, value, enableSearchOptions = false, notFoundMessage, searchBoxProps, loading = false, onSearchOptions, renderDisplayValue, renderOption, renderPopoverContent, enableAutoScrollToSelectedOption, popoverContentProps, popoverWrapperProps, onOpenStateChanged, showGroupOptionDivider, triggerWrapperProps, enableAutoUnmount = true, enableConstrainedPopoverWidth = false, enableVirtualization = false, virtualizationOptions, infiniteScroll, } = props;
39
42
  const classes = selectBoxSlotRecipe({ size, showGroupOptionDivider });
40
43
  const triggerRef = useRef(null);
41
44
  const listBoxId = useId();
@@ -117,6 +120,25 @@ export const SelectBox = forwardRef((props, ref) => {
117
120
  estimateSize: virtualizationOptions?.estimateSize,
118
121
  overscan: virtualizationOptions?.overscan,
119
122
  });
123
+ // Extract infinite scroll configuration with defaults
124
+ const baseEnabledInfiniteScroll = infiniteScroll?.enabled ?? false;
125
+ const onLoadMore = infiniteScroll?.onLoadMore;
126
+ const hasNextPage = infiniteScroll?.hasNextPage ?? true;
127
+ const hasPreviousPage = infiniteScroll?.hasPreviousPage ?? true;
128
+ const infiniteScrollThreshold = infiniteScroll?.threshold ?? 100;
129
+ const infiniteScrollErrorMessage = infiniteScroll?.errorMessage ?? '読み込みに失敗しました';
130
+ const infiniteScrollRetryButtonText = infiniteScroll?.retryButtonText ?? '再読み込み';
131
+ // Initialize infinite scroll
132
+ const { isLoading: isInfiniteScrollLoading, error: infiniteScrollError, handleScroll: handleInfiniteScroll, retryLoad: retryInfiniteScroll, } = useInfiniteScroll({
133
+ onLoadMore,
134
+ hasNextPage,
135
+ hasPreviousPage,
136
+ }, {
137
+ enabled: baseEnabledInfiniteScroll,
138
+ threshold: infiniteScrollThreshold,
139
+ });
140
+ // Disable infinite scroll when there's an error
141
+ const enableInfiniteScroll = baseEnabledInfiniteScroll && !infiniteScrollError;
120
142
  const handleSelectOption = useCallback((option) => {
121
143
  if (isOptionDisabled(option))
122
144
  return;
@@ -186,10 +208,10 @@ export const SelectBox = forwardRef((props, ref) => {
186
208
  if (renderDisplayValue) {
187
209
  return renderDisplayValue(localSelectedOption);
188
210
  }
189
- if (placeholder && !localSelectedOption) {
190
- return _jsx(Typography, { variant: "controlLabel", children: placeholder });
211
+ if (localSelectedOption) {
212
+ return (_jsx(Typography, { variant: "controlLabel", className: cx(classes.displayValue, 'mfui-SelectBox__displayValue'), children: localSelectedOption.label }));
191
213
  }
192
- return (_jsx(Typography, { variant: "controlLabel", children: localSelectedOption ? localSelectedOption.label : placeholder }));
214
+ return (_jsx(Typography, { variant: "controlLabel", className: cx(classes.placeholder, 'mfui-SelectBox__placeholder'), children: placeholder }));
193
215
  };
194
216
  const searchNode = enableSearchOptions ? (_jsx("div", { className: cx(classes.menuHeader, 'mfui-SelectBox__menuHeader'), children: _jsx(SearchBox, { ref: searchInputRef, enableClearButton: true, value: searchText, textBoxSize: "small", autoComplete: "off", onChange: onSearchTextChange, ...searchBoxProps }) })) : null;
195
217
  // Render virtualized items - extracted for better maintainability
@@ -266,7 +288,23 @@ export const SelectBox = forwardRef((props, ref) => {
266
288
  : options.length > 0
267
289
  ? notFoundMessage
268
290
  : emptyMessage }) })), [classes.emptyMessage, enableSearchOptions, searchText, notFoundMessage, options.length, emptyMessage]);
269
- const optionsNode = (_jsx("div", { ref: scrollWrapperRef, className: cx(classes.scrollWrapper, 'mfui-SelectBox__scrollWrapper'), children: _jsx("ul", { role: "listbox", id: listBoxId, className: cx(classes.listBox, 'mfui-SelectBox__listBox'), tabIndex: -1, style: isVirtualized
291
+ // Render infinite scroll error message with retry button
292
+ const renderInfiniteScrollError = useCallback(() => infiniteScrollError ? (_jsxs("li", { className: cx(classes.infiniteScrollError, 'mfui-SelectBox__infiniteScrollError'), role: "alert", children: [_jsxs("div", { className: cx(classes.infiniteScrollErrorMessage, 'mfui-SelectBox__infiniteScrollErrorMessage'), "aria-live": "polite", children: [_jsx(Error, { "aria-hidden": true, className: cx(classes.infiniteScrollErrorIcon, 'mfui-SelectBox__infiniteScrollErrorIcon') }), _jsx(Typography, { variant: "body", children: infiniteScrollErrorMessage })] }), _jsx("div", { className: cx(classes.infiniteScrollErrorButton, 'mfui-SelectBox__infiniteScrollErrorButton'), children: _jsx(Button, { size: "small", onClick: (event) => {
293
+ event.stopPropagation();
294
+ retryInfiniteScroll();
295
+ }, children: infiniteScrollRetryButtonText }) })] })) : null, [
296
+ infiniteScrollError,
297
+ classes.infiniteScrollError,
298
+ classes.infiniteScrollErrorIcon,
299
+ classes.infiniteScrollErrorMessage,
300
+ classes.infiniteScrollErrorButton,
301
+ retryInfiniteScroll,
302
+ infiniteScrollErrorMessage,
303
+ infiniteScrollRetryButtonText,
304
+ ]);
305
+ // Render infinite scroll loading indicator
306
+ const renderInfiniteScrollLoading = useCallback(() => isInfiniteScrollLoading && enableInfiniteScroll ? (_jsx("div", { className: cx(classes.infiniteScrollLoading, 'mfui-SelectBox__infiniteScrollLoading'), children: _jsx(ProgressIndicator, {}) })) : null, [isInfiniteScrollLoading, enableInfiniteScroll, classes.infiniteScrollLoading]);
307
+ const optionsNode = (_jsx("div", { ref: scrollWrapperRef, className: cx(classes.scrollWrapper, 'mfui-SelectBox__scrollWrapper'), onScroll: enableInfiniteScroll ? handleInfiniteScroll : undefined, children: _jsx("ul", { role: "listbox", id: listBoxId, className: cx(classes.listBox, 'mfui-SelectBox__listBox'), tabIndex: -1, style: isVirtualized
270
308
  ? {
271
309
  height: `${String(totalSize)}px`,
272
310
  position: 'relative',
@@ -275,10 +313,10 @@ export const SelectBox = forwardRef((props, ref) => {
275
313
  ? Array.from({ length: SKELETON_ITEM_COUNT }).map((_, index) => (_jsx("li", { className: cx(classes.skeletonItem, 'mfui-SelectBox__skeletonItem'), children: _jsx(Skeleton, {}) }, index)))
276
314
  : isVirtualized && virtualItems.length > 0
277
315
  ? // Virtualized rendering with group support
278
- renderVirtualizedItems()
316
+ [...renderVirtualizedItems(), renderInfiniteScrollLoading(), renderInfiniteScrollError()].filter(Boolean)
279
317
  : filteredOptions.length > 0
280
- ? renderNonVirtualizedItems()
281
- : renderEmptyMessage() }) }));
318
+ ? [...renderNonVirtualizedItems(), renderInfiniteScrollLoading(), renderInfiniteScrollError()].filter(Boolean)
319
+ : [renderEmptyMessage(), renderInfiniteScrollError()].filter(Boolean) }) }));
282
320
  const handleClearValue = () => {
283
321
  setLocalSelectedOption(null);
284
322
  onChange?.(null);
@@ -290,7 +328,7 @@ export const SelectBox = forwardRef((props, ref) => {
290
328
  return (_jsx(Popover, { open: isOptionPanelOpen, targetDOMNode: targetDOMNode, minWidth: popoverContentProps?.minWidth, maxHeight: popoverWrapperProps?.maxHeight, allowedPlacements: popoverContentProps?.allowedPlacements, enableConstrainedContentWidth: enableConstrainedPopoverWidth, renderContent: () => (_jsx("div", { ref: optionPanelRef, id: listBoxId, className: cx(classes.optionPanel, 'mfui-SelectBox__optionPanel', popoverContentProps?.className), tabIndex: -1, onKeyDown: handleKeyDownMenu, children: renderPopoverContent ? (renderPopoverContent({ searchNode, optionsNode })) : (_jsxs(_Fragment, { children: [searchNode, optionsNode] })) })), renderTrigger: ({ setTriggerRef, togglePopover, isPopoverOpen, handleTriggerKeyDown, handleTriggerBlur }) => (_jsxs("div", { ref: setTriggerRef, ...triggerWrapperProps, className: cx(classes.triggerWrapper, 'mfui-SelectBox__triggerWrapper', triggerWrapperProps?.className), children: [_jsx(FocusIndicator, { children: _jsxs("button", { ref: triggerRef, id: id, type: "button", role: "combobox", disabled: disabled, "aria-label": triggerProps?.['aria-label'], "aria-controls": listBoxId, "aria-expanded": isPopoverOpen, "aria-haspopup": "listbox", "aria-invalid": invalid, className: cx(classes.trigger, 'mfui-SelectBox__trigger', triggerProps?.className), "data-placeholder": !!placeholder && !localSelectedOption, "data-selected": !!localSelectedOption, "data-mfui-has-clear-button": showClearButton, onClick: togglePopover, onKeyDown: (event) => {
291
329
  handleTypeAhead(event.nativeEvent);
292
330
  handleTriggerKeyDown(event);
293
- }, onBlur: handleTriggerBlur, children: [_jsx("span", { "data-mfui-content": "select-box-trigger-display-value", children: renderTriggerLabel() }), _jsx(DropdownIcon, {}), _jsx("input", { ref: ref, type: "hidden", value: localSelectedOption?.value ?? '', name: name, disabled: disabled })] }) }), showClearButton ? (_jsx("div", { className: cx(classes.clearButtonWrapper, 'mfui-SelectBox__clearButtonWrapper'), children: _jsx(ClearButton, { size: size === 'small' ? 'small' : 'default', "aria-label": clearButtonProps?.['aria-label'] ?? '値をクリアする', "data-mfui-content": "select-box-clear-button", onClick: (event) => {
331
+ }, onBlur: handleTriggerBlur, children: [_jsx("span", { "data-mfui-content": "select-box-trigger-display-value", children: renderTriggerLabel() }), _jsx(DropdownIcon, {}), _jsx("input", { ref: ref, type: "hidden", value: localSelectedOption?.value ?? '', name: name, disabled: disabled })] }) }), showClearButton ? (_jsx("div", { className: cx(classes.clearButtonWrapper, 'mfui-SelectBox__clearButtonWrapper'), children: _jsx(ClearButton, { size: size === 'small' ? 'small' : size === 'large' ? 'large' : 'default', "aria-label": clearButtonProps?.['aria-label'] ?? '値をクリアする', "data-mfui-content": "select-box-clear-button", onClick: (event) => {
294
332
  event.stopPropagation();
295
333
  handleClearValue();
296
334
  } }) })) : null] })), contentProps: { className: classes.popover }, enableAutoUnmount: enableAutoUnmount, onOpenStateChanged: toggleOptionPanel, onBlur: onBlur }));
@@ -3,8 +3,61 @@ import { type VirtualizerOptions } from '@tanstack/react-virtual';
3
3
  import { type SelectBoxSlotRecipeVariant } from '../../styled-system/recipes';
4
4
  import { type SearchBoxProps } from '../SearchBox';
5
5
  import { type PopoverProps } from '../Popover';
6
+ import { type InfiniteScrollDirection } from '../utilities/dom/useInfiniteScroll';
6
7
  type AllowedValueTypes = string | number | undefined;
7
8
  export type VirtualOptionTypes = Pick<VirtualizerOptions<HTMLElement, Element>, 'estimateSize' | 'overscan'>;
9
+ export type InfiniteScrollConfig = {
10
+ /**
11
+ * Enable infinite scroll functionality.
12
+ * When enabled, additional options can be loaded dynamically when scrolling.
13
+ *
14
+ * @default false
15
+ */
16
+ enabled?: boolean;
17
+ /**
18
+ * Callback executed when more options need to be loaded.
19
+ * Called when user scrolls near the top or bottom of the options list.
20
+ *
21
+ * @param direction - The direction of loading ('forward' for bottom, 'backward' for top)
22
+ */
23
+ onLoadMore?: (direction: InfiniteScrollDirection) => Promise<void>;
24
+ /**
25
+ * Whether there are more options available to load in the forward direction (bottom).
26
+ * Used to determine if infinite scroll should trigger when scrolling down.
27
+ *
28
+ * @default true
29
+ */
30
+ hasNextPage?: boolean;
31
+ /**
32
+ * Whether there are more options available to load in the backward direction (top).
33
+ * Used to determine if infinite scroll should trigger when scrolling up.
34
+ *
35
+ * @default true
36
+ */
37
+ hasPreviousPage?: boolean;
38
+ /**
39
+ * The scroll threshold in pixels for triggering infinite scroll.
40
+ * When the scroll position is within this distance from the top or bottom,
41
+ * the onLoadMore callback will be triggered.
42
+ *
43
+ * @default 100
44
+ */
45
+ threshold?: number;
46
+ /**
47
+ * The error message to display when loading fails.
48
+ * This message supports internationalization.
49
+ *
50
+ * @default "Failed to load data"
51
+ */
52
+ errorMessage?: string;
53
+ /**
54
+ * The text for the retry button when loading fails.
55
+ * This message supports internationalization.
56
+ *
57
+ * @default "Retry"
58
+ */
59
+ retryButtonText?: string;
60
+ };
8
61
  export type BasedAdditionalProps = Record<string, unknown>;
9
62
  export type SelectBoxOption<T extends AllowedValueTypes = string, AdditionalProps extends BasedAdditionalProps = BasedAdditionalProps> = ({
10
63
  /**
@@ -351,5 +404,31 @@ export type SelectBoxProps<T extends AllowedValueTypes = string, AdditionalProps
351
404
  * ```
352
405
  */
353
406
  virtualizationOptions?: VirtualOptionTypes;
407
+ /**
408
+ * Infinite scroll configuration.
409
+ * When provided, enables infinite scroll functionality for loading additional options dynamically.
410
+ *
411
+ * @example
412
+ * ```tsx
413
+ * <SelectBox
414
+ * infiniteScroll={{
415
+ * enabled: true,
416
+ * onLoadMore: async (direction) => {
417
+ * if (direction === 'forward') {
418
+ * const nextOptions = await loadNextPage();
419
+ * setOptions(prev => [...prev, ...nextOptions]);
420
+ * } else {
421
+ * const prevOptions = await loadPreviousPage();
422
+ * setOptions(prev => [...prevOptions, ...prev]);
423
+ * }
424
+ * },
425
+ * hasNextPage: hasMore,
426
+ * hasPreviousPage: hasPrevious,
427
+ * threshold: 50 // Trigger when within 50px of edges
428
+ * }}
429
+ * />
430
+ * ```
431
+ */
432
+ infiniteScroll?: InfiniteScrollConfig;
354
433
  };
355
- export {};
434
+ export { type InfiniteScrollDirection } from '../utilities/dom/useInfiniteScroll';
@@ -22,7 +22,7 @@ export function Tag({ label, onClick, href, customLinkComponent, disabled = fals
22
22
  return (_jsx(FocusIndicator, { children: _jsxs("span", { className: cx(classes.root, 'mfui-Tag__root', className), children: [_jsx(Typography, { variant: "condensedInput", children: label }), onClose ? closeButton : null] }) }));
23
23
  }
24
24
  const InternalTag = href ? (customLinkComponent ?? 'a') : 'button';
25
- const tagProps = href ? { href, target, rel } : { disabled, onClick };
25
+ const tagProps = href ? { href, target, rel } : { disabled, onClick, type: 'button' };
26
26
  const WrapperTag = onClose ? 'div' : Fragment;
27
27
  const wrapperProps = onClose ? { className: cx(classes.wrapper, 'mfui-Tag__wrapper', className) } : undefined;
28
28
  return (_jsxs(WrapperTag, { ...wrapperProps, children: [_jsx(FocusIndicator, { children: _jsx(InternalTag, { className: cx(classes.root, 'mfui-Tag__root'), ...tagProps, children: _jsx(Typography, { variant: "condensedInput", children: label }) }) }), onClose ? closeButton : null] }));
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The general-purpose ToggleSwitch component.
3
+ * This component provides a switch to toggle between ON and OFF states.
4
+ *
5
+ * This component extends the props of `<input type="checkbox">` element.
6
+ *
7
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox
8
+ */
9
+ export declare const ToggleSwitch: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,32 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { forwardRef, useState } from 'react';
4
+ import { cx } from '../../styled-system/css';
5
+ import { toggleSwitchSlotRecipe } from '../../styled-system/recipes';
6
+ import { FocusIndicator } from '../FocusIndicator/FocusIndicator';
7
+ /**
8
+ * The general-purpose ToggleSwitch component.
9
+ * This component provides a switch to toggle between ON and OFF states.
10
+ *
11
+ * This component extends the props of `<input type="checkbox">` element.
12
+ *
13
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox
14
+ */
15
+ export const ToggleSwitch = forwardRef(({ className, checked, defaultChecked, disabled, onChange, ...props }, ref) => {
16
+ const [localChecked, setLocalChecked] = useState(!!defaultChecked);
17
+ const isControlled = checked !== undefined;
18
+ const classes = toggleSwitchSlotRecipe();
19
+ const isChecked = isControlled ? checked : localChecked;
20
+ return (_jsx(FocusIndicator, { children: _jsxs("span", { className: cx(classes.root, 'mfui-ToggleSwitch__root', className), children: [_jsx("span", { className: cx(classes.handle, 'mfui-ToggleSwitch__handle'), "data-mfui-content": "toggle-handle" }), _jsx("input", { ref: ref, type: "checkbox", role: "switch", checked: isChecked, disabled: disabled, className: cx(classes.input, 'mfui-ToggleSwitch__input'), "data-mfui-content": "toggle-input", onChange: (event) => {
21
+ onChange?.(event);
22
+ // If the event is defaultPrevented in "onChange" prop via "e.preventDefault()", do not update local
23
+ // states.
24
+ if (event.defaultPrevented) {
25
+ return;
26
+ }
27
+ if (!isControlled) {
28
+ setLocalChecked(event.target.checked);
29
+ }
30
+ }, ...props })] }) }));
31
+ });
32
+ ToggleSwitch.displayName = 'ToggleSwitch';
@@ -0,0 +1,6 @@
1
+ import { type ComponentPropsWithoutRef } from 'react';
2
+ /**
3
+ * ToggleSwitch component props.
4
+ * Extends the standard HTML input checkbox element props.
5
+ */
6
+ export type ToggleSwitchProps = ComponentPropsWithoutRef<'input'>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './ToggleSwitch';
2
+ export * from './ToggleSwitch.types';
@@ -0,0 +1,2 @@
1
+ export * from './ToggleSwitch';
2
+ export * from './ToggleSwitch.types';
@@ -21,6 +21,7 @@ export * from './MainNavigation';
21
21
  export * from './SelectBox';
22
22
  export * from './SidePane';
23
23
  export * from './Toast';
24
+ export * from './ToggleSwitch';
24
25
  export * from './Pagination';
25
26
  export * from './Tag';
26
27
  export * from './ProgressIndicator';
package/dist/src/index.js CHANGED
@@ -21,6 +21,7 @@ export * from './MainNavigation';
21
21
  export * from './SelectBox';
22
22
  export * from './SidePane';
23
23
  export * from './Toast';
24
+ export * from './ToggleSwitch';
24
25
  export * from './Pagination';
25
26
  export * from './Tag';
26
27
  export * from './ProgressIndicator';
@@ -37,19 +37,45 @@ export const useFixedColumns = ({ enableRowSelection = false, columnIndex, leftF
37
37
  if (!cellRef.current)
38
38
  return;
39
39
  const cell = cellRef.current;
40
+ const row = cell.closest('tr');
40
41
  const table = cell.closest('table');
41
- if (!table)
42
+ if (!row || !table)
42
43
  return;
43
- const tableRect = table.getBoundingClientRect();
44
- const cellRect = cell.getBoundingClientRect();
45
- // Calculate distance from left edge
46
- const leftPosition = cellRect.left - tableRect.left;
47
- // Calculate distance from right edge
48
- const rightPosition = tableRect.right - cellRect.right;
49
- setCellRect({
50
- left: leftPosition,
51
- right: rightPosition,
44
+ const calculatePosition = () => {
45
+ const cells = [...row.querySelectorAll('th, td')];
46
+ const cellIndex = cells.indexOf(cell);
47
+ if (cellIndex === -1)
48
+ return;
49
+ // Calculate left position by summing widths of previous cells
50
+ let leftPosition = 0;
51
+ for (let i = 0; i < cellIndex; i++) {
52
+ const cellElement = cells[i];
53
+ if (cellElement) {
54
+ leftPosition += cellElement.offsetWidth;
55
+ }
56
+ }
57
+ // Calculate right position by summing widths of following cells
58
+ let rightPosition = 0;
59
+ for (let i = cellIndex + 1; i < cells.length; i++) {
60
+ const cellElement = cells[i];
61
+ if (cellElement) {
62
+ rightPosition += cellElement.offsetWidth;
63
+ }
64
+ }
65
+ setCellRect({
66
+ left: leftPosition,
67
+ right: rightPosition,
68
+ });
69
+ };
70
+ calculatePosition();
71
+ // Recalculate on table resize (e.g., when content changes after sorting)
72
+ const resizeObserver = new ResizeObserver(() => {
73
+ calculatePosition();
52
74
  });
75
+ resizeObserver.observe(table);
76
+ return () => {
77
+ resizeObserver.disconnect();
78
+ };
53
79
  }, []);
54
80
  useLayoutEffect(() => {
55
81
  if (isCheckboxColumn && leftFixedColumnIndex !== undefined) {
@@ -0,0 +1,22 @@
1
+ export type InfiniteScrollDirection = 'forward' | 'backward';
2
+ export type InfiniteScrollCallbacks = {
3
+ onLoadMore?: (direction: InfiniteScrollDirection) => Promise<void>;
4
+ hasNextPage?: boolean;
5
+ hasPreviousPage?: boolean;
6
+ };
7
+ export type InfiniteScrollError = {
8
+ direction: InfiniteScrollDirection;
9
+ error: Error;
10
+ };
11
+ export type UseInfiniteScrollOptions = {
12
+ enabled?: boolean;
13
+ threshold?: number;
14
+ };
15
+ export type UseInfiniteScrollReturn = {
16
+ isLoading: boolean;
17
+ error: InfiniteScrollError | null;
18
+ handleScroll: (event: React.UIEvent<HTMLElement>) => void;
19
+ retryLoad: () => void;
20
+ clearError: () => void;
21
+ };
22
+ export declare const useInfiniteScroll: (callbacks: InfiniteScrollCallbacks, options?: UseInfiniteScrollOptions) => UseInfiniteScrollReturn;
@@ -0,0 +1,65 @@
1
+ import { useCallback, useRef, useState } from 'react';
2
+ export const useInfiniteScroll = (callbacks, options = {}) => {
3
+ const { enabled = true, threshold = 100 } = options;
4
+ const { onLoadMore, hasNextPage = true, hasPreviousPage = true } = callbacks;
5
+ const [isLoading, setIsLoading] = useState(false);
6
+ const [error, setError] = useState(null);
7
+ const isLoadingRef = useRef(false);
8
+ const executeLoad = useCallback(async (direction, forceLoad = false) => {
9
+ if ((!enabled && !forceLoad) || !onLoadMore || isLoadingRef.current)
10
+ return;
11
+ if (direction === 'forward' && !hasNextPage)
12
+ return;
13
+ if (direction === 'backward' && !hasPreviousPage)
14
+ return;
15
+ try {
16
+ isLoadingRef.current = true;
17
+ setIsLoading(true);
18
+ setError(null);
19
+ await onLoadMore(direction);
20
+ }
21
+ catch (error_) {
22
+ const errorObject = error_ instanceof Error ? error_ : new Error('Unknown error');
23
+ setError({ direction, error: errorObject });
24
+ }
25
+ finally {
26
+ isLoadingRef.current = false;
27
+ setIsLoading(false);
28
+ }
29
+ }, [enabled, onLoadMore, hasNextPage, hasPreviousPage]);
30
+ const handleScroll = useCallback((event) => {
31
+ if (!enabled || isLoadingRef.current)
32
+ return;
33
+ const target = event.currentTarget;
34
+ const { scrollTop, scrollHeight, clientHeight } = target;
35
+ const nearTop = scrollTop <= threshold;
36
+ const nearBottom = scrollTop + clientHeight >= scrollHeight - threshold;
37
+ if (nearBottom && hasNextPage) {
38
+ executeLoad('forward').catch(() => {
39
+ // Error handling is done within executeLoad
40
+ });
41
+ }
42
+ else if (nearTop && hasPreviousPage) {
43
+ executeLoad('backward').catch(() => {
44
+ // Error handling is done within executeLoad
45
+ });
46
+ }
47
+ }, [enabled, threshold, hasNextPage, hasPreviousPage, executeLoad]);
48
+ const retryLoad = useCallback(() => {
49
+ if (error) {
50
+ executeLoad(error.direction, true).catch(() => {
51
+ // Error handling is done within executeLoad
52
+ });
53
+ }
54
+ }, [error, executeLoad]);
55
+ const clearError = useCallback(() => {
56
+ setError(null);
57
+ }, []);
58
+ return {
59
+ isLoading,
60
+ error,
61
+ handleScroll,
62
+ retryLoad,
63
+ clearError,
64
+ };
65
+ };
@@ -1,5 +1,5 @@
1
1
  import { withoutSpace } from '../helpers.js';
2
- const conditionsStr = "_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_complete,_incomplete,_dragging,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_grabbed,_underValue,_overValue,_atValue,_default,_optional,_open,_closed,_fullscreen,_loading,_hidden,_current,_currentPage,_currentStep,_today,_unavailable,_rangeStart,_rangeEnd,_now,_topmost,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_icon,_starting,_noscript,_invertedColors,_notDisabled,_notFocused,_focusable,_focusInputInside,_hasCheckboxInside,_hasDisabledCheckboxInside,_hasFocusedCheckboxInside,_hasFocusedCheckedCheckboxInside,_hasCheckedCheckboxInside,_hasRadioButtonInside,_hasFocusedRadioButtonInside,_hasFocusedCheckedRadioButtonInside,_hasDisabledRadioButtonInside,_hasCheckedRadioButtonInside,sm,smOnly,smDown,lg,lgOnly,lgDown,smToLg,base";
2
+ const conditionsStr = "_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_complete,_incomplete,_dragging,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_grabbed,_underValue,_overValue,_atValue,_default,_optional,_open,_closed,_fullscreen,_loading,_hidden,_current,_currentPage,_currentStep,_today,_unavailable,_rangeStart,_rangeEnd,_now,_topmost,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_icon,_starting,_noscript,_invertedColors,_notDisabled,_notFocused,_focusable,_focusInputInside,_hasCheckboxInside,_hasDisabledCheckboxInside,_hasFocusedCheckboxInside,_hasFocusedCheckedCheckboxInside,_hasCheckedCheckboxInside,_hasRadioButtonInside,_hasFocusedRadioButtonInside,_hasFocusedCheckedRadioButtonInside,_hasDisabledRadioButtonInside,_hasCheckedRadioButtonInside,_hasToggleSwitchInside,_hasFocusedToggleSwitchInside,_hasFocusedCheckedToggleSwitchInside,_hasDisabledToggleSwitchInside,_hasCheckedToggleSwitchInside,sm,smOnly,smDown,lg,lgOnly,lgDown,smToLg,base";
3
3
  const conditions = new Set(conditionsStr.split(','));
4
4
  const conditionRegex = /^@|&|&$/;
5
5
  export function isCondition(value) {
@@ -1,7 +1,7 @@
1
1
  import { splitProps } from '../helpers.js';
2
2
  import { memo } from '../helpers.js';
3
3
  // src/index.ts
4
- var userGeneratedStr = "css,pos,insetX,insetY,insetEnd,end,insetStart,start,flexDir,p,pl,pr,pt,pb,py,paddingY,paddingX,px,pe,paddingEnd,ps,paddingStart,ml,mr,mt,mb,m,my,marginY,mx,marginX,me,marginEnd,ms,marginStart,ringWidth,ringColor,ring,ringOffset,w,minW,maxW,h,minH,maxH,textShadowColor,bgPosition,bgPositionX,bgPositionY,bgAttachment,bgClip,bg,bgColor,bgOrigin,bgImage,bgRepeat,bgBlendMode,bgSize,bgGradient,bgLinear,bgRadial,bgConic,rounded,roundedTopLeft,roundedTopRight,roundedBottomRight,roundedBottomLeft,roundedTop,roundedRight,roundedBottom,roundedLeft,roundedStartStart,roundedStartEnd,roundedStart,roundedEndStart,roundedEndEnd,roundedEnd,borderX,borderXWidth,borderXColor,borderY,borderYWidth,borderYColor,borderStart,borderStartWidth,borderStartColor,borderEnd,borderEndWidth,borderEndColor,shadow,shadowColor,x,y,z,scrollMarginY,scrollMarginX,scrollPaddingY,scrollPaddingX,aspectRatio,boxDecorationBreak,zIndex,boxSizing,objectPosition,objectFit,overscrollBehavior,overscrollBehaviorX,overscrollBehaviorY,position,top,left,inset,insetInline,insetBlock,insetBlockEnd,insetBlockStart,insetInlineEnd,insetInlineStart,right,bottom,float,visibility,display,hideFrom,hideBelow,flexBasis,flex,flexDirection,flexGrow,flexShrink,gridTemplateColumns,gridTemplateRows,gridColumn,gridRow,gridColumnStart,gridColumnEnd,gridAutoFlow,gridAutoColumns,gridAutoRows,gap,gridGap,gridRowGap,gridColumnGap,rowGap,columnGap,justifyContent,alignContent,alignItems,alignSelf,padding,paddingLeft,paddingRight,paddingTop,paddingBottom,paddingBlock,paddingBlockEnd,paddingBlockStart,paddingInline,paddingInlineEnd,paddingInlineStart,marginLeft,marginRight,marginTop,marginBottom,margin,marginBlock,marginBlockEnd,marginBlockStart,marginInline,marginInlineEnd,marginInlineStart,spaceX,spaceY,outlineWidth,outlineColor,outline,outlineOffset,focusRing,focusVisibleRing,focusRingColor,focusRingOffset,focusRingWidth,focusRingStyle,divideX,divideY,divideColor,divideStyle,width,inlineSize,minWidth,minInlineSize,maxWidth,maxInlineSize,height,blockSize,minHeight,minBlockSize,maxHeight,maxBlockSize,boxSize,color,fontFamily,fontSize,fontSizeAdjust,fontPalette,fontKerning,fontFeatureSettings,fontWeight,fontSmoothing,fontVariant,fontVariantAlternates,fontVariantCaps,fontVariationSettings,fontVariantNumeric,letterSpacing,lineHeight,textAlign,textDecoration,textDecorationColor,textEmphasisColor,textDecorationStyle,textDecorationThickness,textUnderlineOffset,textTransform,textIndent,textShadow,WebkitTextFillColor,textOverflow,verticalAlign,wordBreak,textWrap,truncate,lineClamp,listStyleType,listStylePosition,listStyleImage,listStyle,backgroundPosition,backgroundPositionX,backgroundPositionY,backgroundAttachment,backgroundClip,background,backgroundColor,backgroundOrigin,backgroundImage,backgroundRepeat,backgroundBlendMode,backgroundSize,backgroundGradient,backgroundLinear,backgroundRadial,backgroundConic,textGradient,gradientFromPosition,gradientToPosition,gradientFrom,gradientTo,gradientVia,gradientViaPosition,borderRadius,borderTopLeftRadius,borderTopRightRadius,borderBottomRightRadius,borderBottomLeftRadius,borderTopRadius,borderRightRadius,borderBottomRadius,borderLeftRadius,borderStartStartRadius,borderStartEndRadius,borderStartRadius,borderEndStartRadius,borderEndEndRadius,borderEndRadius,border,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,borderBlockStartWidth,borderBlockEndWidth,borderColor,borderInline,borderInlineWidth,borderInlineColor,borderBlock,borderBlockWidth,borderBlockColor,borderLeft,borderLeftColor,borderInlineStart,borderInlineStartWidth,borderInlineStartColor,borderRight,borderRightColor,borderInlineEnd,borderInlineEndWidth,borderInlineEndColor,borderTop,borderTopColor,borderBottom,borderBottomColor,borderBlockEnd,borderBlockEndColor,borderBlockStart,borderBlockStartColor,opacity,boxShadow,boxShadowColor,mixBlendMode,filter,brightness,contrast,grayscale,hueRotate,invert,saturate,sepia,dropShadow,blur,backdropFilter,backdropBlur,backdropBrightness,backdropContrast,backdropGrayscale,backdropHueRotate,backdropInvert,backdropOpacity,backdropSaturate,backdropSepia,borderCollapse,borderSpacing,borderSpacingX,borderSpacingY,tableLayout,transitionTimingFunction,transitionDelay,transitionDuration,transitionProperty,transition,animation,animationName,animationTimingFunction,animationDuration,animationDelay,animationPlayState,animationComposition,animationFillMode,animationDirection,animationIterationCount,animationRange,animationState,animationRangeStart,animationRangeEnd,animationTimeline,transformOrigin,transformBox,transformStyle,transform,rotate,rotateX,rotateY,rotateZ,scale,scaleX,scaleY,translate,translateX,translateY,translateZ,accentColor,caretColor,scrollBehavior,scrollbar,scrollbarColor,scrollbarGutter,scrollbarWidth,scrollMargin,scrollMarginLeft,scrollMarginRight,scrollMarginTop,scrollMarginBottom,scrollMarginBlock,scrollMarginBlockEnd,scrollMarginBlockStart,scrollMarginInline,scrollMarginInlineEnd,scrollMarginInlineStart,scrollPadding,scrollPaddingBlock,scrollPaddingBlockStart,scrollPaddingBlockEnd,scrollPaddingInline,scrollPaddingInlineEnd,scrollPaddingInlineStart,scrollPaddingLeft,scrollPaddingRight,scrollPaddingTop,scrollPaddingBottom,scrollSnapAlign,scrollSnapStop,scrollSnapType,scrollSnapStrictness,scrollSnapMargin,scrollSnapMarginTop,scrollSnapMarginBottom,scrollSnapMarginLeft,scrollSnapMarginRight,scrollSnapCoordinate,scrollSnapDestination,scrollSnapPointsX,scrollSnapPointsY,scrollSnapTypeX,scrollSnapTypeY,scrollTimeline,scrollTimelineAxis,scrollTimelineName,touchAction,userSelect,overflow,overflowWrap,overflowX,overflowY,overflowAnchor,overflowBlock,overflowInline,overflowClipBox,overflowClipMargin,overscrollBehaviorBlock,overscrollBehaviorInline,fill,stroke,strokeWidth,strokeDasharray,strokeDashoffset,strokeLinecap,strokeLinejoin,strokeMiterlimit,strokeOpacity,srOnly,debug,appearance,backfaceVisibility,clipPath,hyphens,mask,maskImage,maskSize,textSizeAdjust,container,containerName,containerType,cursor,colorPalette,_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_complete,_incomplete,_dragging,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_grabbed,_underValue,_overValue,_atValue,_default,_optional,_open,_closed,_fullscreen,_loading,_hidden,_current,_currentPage,_currentStep,_today,_unavailable,_rangeStart,_rangeEnd,_now,_topmost,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_icon,_starting,_noscript,_invertedColors,_notDisabled,_notFocused,_focusable,_focusInputInside,_hasCheckboxInside,_hasDisabledCheckboxInside,_hasFocusedCheckboxInside,_hasFocusedCheckedCheckboxInside,_hasCheckedCheckboxInside,_hasRadioButtonInside,_hasFocusedRadioButtonInside,_hasFocusedCheckedRadioButtonInside,_hasDisabledRadioButtonInside,_hasCheckedRadioButtonInside,sm,smOnly,smDown,lg,lgOnly,lgDown,smToLg";
4
+ var userGeneratedStr = "css,pos,insetX,insetY,insetEnd,end,insetStart,start,flexDir,p,pl,pr,pt,pb,py,paddingY,paddingX,px,pe,paddingEnd,ps,paddingStart,ml,mr,mt,mb,m,my,marginY,mx,marginX,me,marginEnd,ms,marginStart,ringWidth,ringColor,ring,ringOffset,w,minW,maxW,h,minH,maxH,textShadowColor,bgPosition,bgPositionX,bgPositionY,bgAttachment,bgClip,bg,bgColor,bgOrigin,bgImage,bgRepeat,bgBlendMode,bgSize,bgGradient,bgLinear,bgRadial,bgConic,rounded,roundedTopLeft,roundedTopRight,roundedBottomRight,roundedBottomLeft,roundedTop,roundedRight,roundedBottom,roundedLeft,roundedStartStart,roundedStartEnd,roundedStart,roundedEndStart,roundedEndEnd,roundedEnd,borderX,borderXWidth,borderXColor,borderY,borderYWidth,borderYColor,borderStart,borderStartWidth,borderStartColor,borderEnd,borderEndWidth,borderEndColor,shadow,shadowColor,x,y,z,scrollMarginY,scrollMarginX,scrollPaddingY,scrollPaddingX,aspectRatio,boxDecorationBreak,zIndex,boxSizing,objectPosition,objectFit,overscrollBehavior,overscrollBehaviorX,overscrollBehaviorY,position,top,left,inset,insetInline,insetBlock,insetBlockEnd,insetBlockStart,insetInlineEnd,insetInlineStart,right,bottom,float,visibility,display,hideFrom,hideBelow,flexBasis,flex,flexDirection,flexGrow,flexShrink,gridTemplateColumns,gridTemplateRows,gridColumn,gridRow,gridColumnStart,gridColumnEnd,gridAutoFlow,gridAutoColumns,gridAutoRows,gap,gridGap,gridRowGap,gridColumnGap,rowGap,columnGap,justifyContent,alignContent,alignItems,alignSelf,padding,paddingLeft,paddingRight,paddingTop,paddingBottom,paddingBlock,paddingBlockEnd,paddingBlockStart,paddingInline,paddingInlineEnd,paddingInlineStart,marginLeft,marginRight,marginTop,marginBottom,margin,marginBlock,marginBlockEnd,marginBlockStart,marginInline,marginInlineEnd,marginInlineStart,spaceX,spaceY,outlineWidth,outlineColor,outline,outlineOffset,focusRing,focusVisibleRing,focusRingColor,focusRingOffset,focusRingWidth,focusRingStyle,divideX,divideY,divideColor,divideStyle,width,inlineSize,minWidth,minInlineSize,maxWidth,maxInlineSize,height,blockSize,minHeight,minBlockSize,maxHeight,maxBlockSize,boxSize,color,fontFamily,fontSize,fontSizeAdjust,fontPalette,fontKerning,fontFeatureSettings,fontWeight,fontSmoothing,fontVariant,fontVariantAlternates,fontVariantCaps,fontVariationSettings,fontVariantNumeric,letterSpacing,lineHeight,textAlign,textDecoration,textDecorationColor,textEmphasisColor,textDecorationStyle,textDecorationThickness,textUnderlineOffset,textTransform,textIndent,textShadow,WebkitTextFillColor,textOverflow,verticalAlign,wordBreak,textWrap,truncate,lineClamp,listStyleType,listStylePosition,listStyleImage,listStyle,backgroundPosition,backgroundPositionX,backgroundPositionY,backgroundAttachment,backgroundClip,background,backgroundColor,backgroundOrigin,backgroundImage,backgroundRepeat,backgroundBlendMode,backgroundSize,backgroundGradient,backgroundLinear,backgroundRadial,backgroundConic,textGradient,gradientFromPosition,gradientToPosition,gradientFrom,gradientTo,gradientVia,gradientViaPosition,borderRadius,borderTopLeftRadius,borderTopRightRadius,borderBottomRightRadius,borderBottomLeftRadius,borderTopRadius,borderRightRadius,borderBottomRadius,borderLeftRadius,borderStartStartRadius,borderStartEndRadius,borderStartRadius,borderEndStartRadius,borderEndEndRadius,borderEndRadius,border,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,borderBlockStartWidth,borderBlockEndWidth,borderColor,borderInline,borderInlineWidth,borderInlineColor,borderBlock,borderBlockWidth,borderBlockColor,borderLeft,borderLeftColor,borderInlineStart,borderInlineStartWidth,borderInlineStartColor,borderRight,borderRightColor,borderInlineEnd,borderInlineEndWidth,borderInlineEndColor,borderTop,borderTopColor,borderBottom,borderBottomColor,borderBlockEnd,borderBlockEndColor,borderBlockStart,borderBlockStartColor,opacity,boxShadow,boxShadowColor,mixBlendMode,filter,brightness,contrast,grayscale,hueRotate,invert,saturate,sepia,dropShadow,blur,backdropFilter,backdropBlur,backdropBrightness,backdropContrast,backdropGrayscale,backdropHueRotate,backdropInvert,backdropOpacity,backdropSaturate,backdropSepia,borderCollapse,borderSpacing,borderSpacingX,borderSpacingY,tableLayout,transitionTimingFunction,transitionDelay,transitionDuration,transitionProperty,transition,animation,animationName,animationTimingFunction,animationDuration,animationDelay,animationPlayState,animationComposition,animationFillMode,animationDirection,animationIterationCount,animationRange,animationState,animationRangeStart,animationRangeEnd,animationTimeline,transformOrigin,transformBox,transformStyle,transform,rotate,rotateX,rotateY,rotateZ,scale,scaleX,scaleY,translate,translateX,translateY,translateZ,accentColor,caretColor,scrollBehavior,scrollbar,scrollbarColor,scrollbarGutter,scrollbarWidth,scrollMargin,scrollMarginLeft,scrollMarginRight,scrollMarginTop,scrollMarginBottom,scrollMarginBlock,scrollMarginBlockEnd,scrollMarginBlockStart,scrollMarginInline,scrollMarginInlineEnd,scrollMarginInlineStart,scrollPadding,scrollPaddingBlock,scrollPaddingBlockStart,scrollPaddingBlockEnd,scrollPaddingInline,scrollPaddingInlineEnd,scrollPaddingInlineStart,scrollPaddingLeft,scrollPaddingRight,scrollPaddingTop,scrollPaddingBottom,scrollSnapAlign,scrollSnapStop,scrollSnapType,scrollSnapStrictness,scrollSnapMargin,scrollSnapMarginTop,scrollSnapMarginBottom,scrollSnapMarginLeft,scrollSnapMarginRight,scrollSnapCoordinate,scrollSnapDestination,scrollSnapPointsX,scrollSnapPointsY,scrollSnapTypeX,scrollSnapTypeY,scrollTimeline,scrollTimelineAxis,scrollTimelineName,touchAction,userSelect,overflow,overflowWrap,overflowX,overflowY,overflowAnchor,overflowBlock,overflowInline,overflowClipBox,overflowClipMargin,overscrollBehaviorBlock,overscrollBehaviorInline,fill,stroke,strokeWidth,strokeDasharray,strokeDashoffset,strokeLinecap,strokeLinejoin,strokeMiterlimit,strokeOpacity,srOnly,debug,appearance,backfaceVisibility,clipPath,hyphens,mask,maskImage,maskSize,textSizeAdjust,container,containerName,containerType,cursor,colorPalette,_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_complete,_incomplete,_dragging,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_grabbed,_underValue,_overValue,_atValue,_default,_optional,_open,_closed,_fullscreen,_loading,_hidden,_current,_currentPage,_currentStep,_today,_unavailable,_rangeStart,_rangeEnd,_now,_topmost,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_icon,_starting,_noscript,_invertedColors,_notDisabled,_notFocused,_focusable,_focusInputInside,_hasCheckboxInside,_hasDisabledCheckboxInside,_hasFocusedCheckboxInside,_hasFocusedCheckedCheckboxInside,_hasCheckedCheckboxInside,_hasRadioButtonInside,_hasFocusedRadioButtonInside,_hasFocusedCheckedRadioButtonInside,_hasDisabledRadioButtonInside,_hasCheckedRadioButtonInside,_hasToggleSwitchInside,_hasFocusedToggleSwitchInside,_hasFocusedCheckedToggleSwitchInside,_hasDisabledToggleSwitchInside,_hasCheckedToggleSwitchInside,sm,smOnly,smDown,lg,lgOnly,lgDown,smToLg";
5
5
  var userGenerated = userGeneratedStr.split(",");
6
6
  var cssPropertiesStr = "WebkitAppearance,WebkitBorderBefore,WebkitBorderBeforeColor,WebkitBorderBeforeStyle,WebkitBorderBeforeWidth,WebkitBoxReflect,WebkitLineClamp,WebkitMask,WebkitMaskAttachment,WebkitMaskClip,WebkitMaskComposite,WebkitMaskImage,WebkitMaskOrigin,WebkitMaskPosition,WebkitMaskPositionX,WebkitMaskPositionY,WebkitMaskRepeat,WebkitMaskRepeatX,WebkitMaskRepeatY,WebkitMaskSize,WebkitOverflowScrolling,WebkitTapHighlightColor,WebkitTextFillColor,WebkitTextStroke,WebkitTextStrokeColor,WebkitTextStrokeWidth,WebkitTouchCallout,WebkitUserModify,WebkitUserSelect,accentColor,alignContent,alignItems,alignSelf,alignTracks,all,anchorName,anchorScope,animation,animationComposition,animationDelay,animationDirection,animationDuration,animationFillMode,animationIterationCount,animationName,animationPlayState,animationRange,animationRangeEnd,animationRangeStart,animationTimeline,animationTimingFunction,appearance,aspectRatio,backdropFilter,backfaceVisibility,background,backgroundAttachment,backgroundBlendMode,backgroundClip,backgroundColor,backgroundImage,backgroundOrigin,backgroundPosition,backgroundPositionX,backgroundPositionY,backgroundRepeat,backgroundSize,blockSize,border,borderBlock,borderBlockColor,borderBlockEnd,borderBlockEndColor,borderBlockEndStyle,borderBlockEndWidth,borderBlockStart,borderBlockStartColor,borderBlockStartStyle,borderBlockStartWidth,borderBlockStyle,borderBlockWidth,borderBottom,borderBottomColor,borderBottomLeftRadius,borderBottomRightRadius,borderBottomStyle,borderBottomWidth,borderCollapse,borderColor,borderEndEndRadius,borderEndStartRadius,borderImage,borderImageOutset,borderImageRepeat,borderImageSlice,borderImageSource,borderImageWidth,borderInline,borderInlineColor,borderInlineEnd,borderInlineEndColor,borderInlineEndStyle,borderInlineEndWidth,borderInlineStart,borderInlineStartColor,borderInlineStartStyle,borderInlineStartWidth,borderInlineStyle,borderInlineWidth,borderLeft,borderLeftColor,borderLeftStyle,borderLeftWidth,borderRadius,borderRight,borderRightColor,borderRightStyle,borderRightWidth,borderSpacing,borderStartEndRadius,borderStartStartRadius,borderStyle,borderTop,borderTopColor,borderTopLeftRadius,borderTopRightRadius,borderTopStyle,borderTopWidth,borderWidth,bottom,boxAlign,boxDecorationBreak,boxDirection,boxFlex,boxFlexGroup,boxLines,boxOrdinalGroup,boxOrient,boxPack,boxShadow,boxSizing,breakAfter,breakBefore,breakInside,captionSide,caret,caretColor,caretShape,clear,clip,clipPath,clipRule,color,colorInterpolationFilters,colorScheme,columnCount,columnFill,columnGap,columnRule,columnRuleColor,columnRuleStyle,columnRuleWidth,columnSpan,columnWidth,columns,contain,containIntrinsicBlockSize,containIntrinsicHeight,containIntrinsicInlineSize,containIntrinsicSize,containIntrinsicWidth,container,containerName,containerType,content,contentVisibility,counterIncrement,counterReset,counterSet,cursor,cx,cy,d,direction,display,dominantBaseline,emptyCells,fieldSizing,fill,fillOpacity,fillRule,filter,flex,flexBasis,flexDirection,flexFlow,flexGrow,flexShrink,flexWrap,float,floodColor,floodOpacity,font,fontFamily,fontFeatureSettings,fontKerning,fontLanguageOverride,fontOpticalSizing,fontPalette,fontSize,fontSizeAdjust,fontSmooth,fontStretch,fontStyle,fontSynthesis,fontSynthesisPosition,fontSynthesisSmallCaps,fontSynthesisStyle,fontSynthesisWeight,fontVariant,fontVariantAlternates,fontVariantCaps,fontVariantEastAsian,fontVariantEmoji,fontVariantLigatures,fontVariantNumeric,fontVariantPosition,fontVariationSettings,fontWeight,forcedColorAdjust,gap,grid,gridArea,gridAutoColumns,gridAutoFlow,gridAutoRows,gridColumn,gridColumnEnd,gridColumnGap,gridColumnStart,gridGap,gridRow,gridRowEnd,gridRowGap,gridRowStart,gridTemplate,gridTemplateAreas,gridTemplateColumns,gridTemplateRows,hangingPunctuation,height,hyphenateCharacter,hyphenateLimitChars,hyphens,imageOrientation,imageRendering,imageResolution,imeMode,initialLetter,initialLetterAlign,inlineSize,inset,insetBlock,insetBlockEnd,insetBlockStart,insetInline,insetInlineEnd,insetInlineStart,interpolateSize,isolation,justifyContent,justifyItems,justifySelf,justifyTracks,left,letterSpacing,lightingColor,lineBreak,lineClamp,lineHeight,lineHeightStep,listStyle,listStyleImage,listStylePosition,listStyleType,margin,marginBlock,marginBlockEnd,marginBlockStart,marginBottom,marginInline,marginInlineEnd,marginInlineStart,marginLeft,marginRight,marginTop,marginTrim,marker,markerEnd,markerMid,markerStart,mask,maskBorder,maskBorderMode,maskBorderOutset,maskBorderRepeat,maskBorderSlice,maskBorderSource,maskBorderWidth,maskClip,maskComposite,maskImage,maskMode,maskOrigin,maskPosition,maskRepeat,maskSize,maskType,masonryAutoFlow,mathDepth,mathShift,mathStyle,maxBlockSize,maxHeight,maxInlineSize,maxLines,maxWidth,minBlockSize,minHeight,minInlineSize,minWidth,mixBlendMode,objectFit,objectPosition,offset,offsetAnchor,offsetDistance,offsetPath,offsetPosition,offsetRotate,opacity,order,orphans,outline,outlineColor,outlineOffset,outlineStyle,outlineWidth,overflow,overflowAnchor,overflowBlock,overflowClipBox,overflowClipMargin,overflowInline,overflowWrap,overflowX,overflowY,overlay,overscrollBehavior,overscrollBehaviorBlock,overscrollBehaviorInline,overscrollBehaviorX,overscrollBehaviorY,padding,paddingBlock,paddingBlockEnd,paddingBlockStart,paddingBottom,paddingInline,paddingInlineEnd,paddingInlineStart,paddingLeft,paddingRight,paddingTop,page,pageBreakAfter,pageBreakBefore,pageBreakInside,paintOrder,perspective,perspectiveOrigin,placeContent,placeItems,placeSelf,pointerEvents,position,positionAnchor,positionArea,positionTry,positionTryFallbacks,positionTryOrder,positionVisibility,printColorAdjust,quotes,r,resize,right,rotate,rowGap,rubyAlign,rubyMerge,rubyPosition,rx,ry,scale,scrollBehavior,scrollMargin,scrollMarginBlock,scrollMarginBlockEnd,scrollMarginBlockStart,scrollMarginBottom,scrollMarginInline,scrollMarginInlineEnd,scrollMarginInlineStart,scrollMarginLeft,scrollMarginRight,scrollMarginTop,scrollPadding,scrollPaddingBlock,scrollPaddingBlockEnd,scrollPaddingBlockStart,scrollPaddingBottom,scrollPaddingInline,scrollPaddingInlineEnd,scrollPaddingInlineStart,scrollPaddingLeft,scrollPaddingRight,scrollPaddingTop,scrollSnapAlign,scrollSnapCoordinate,scrollSnapDestination,scrollSnapPointsX,scrollSnapPointsY,scrollSnapStop,scrollSnapType,scrollSnapTypeX,scrollSnapTypeY,scrollTimeline,scrollTimelineAxis,scrollTimelineName,scrollbarColor,scrollbarGutter,scrollbarWidth,shapeImageThreshold,shapeMargin,shapeOutside,shapeRendering,stopColor,stopOpacity,stroke,strokeDasharray,strokeDashoffset,strokeLinecap,strokeLinejoin,strokeMiterlimit,strokeOpacity,strokeWidth,tabSize,tableLayout,textAlign,textAlignLast,textAnchor,textBox,textBoxEdge,textBoxTrim,textCombineUpright,textDecoration,textDecorationColor,textDecorationLine,textDecorationSkip,textDecorationSkipInk,textDecorationStyle,textDecorationThickness,textEmphasis,textEmphasisColor,textEmphasisPosition,textEmphasisStyle,textIndent,textJustify,textOrientation,textOverflow,textRendering,textShadow,textSizeAdjust,textSpacingTrim,textTransform,textUnderlineOffset,textUnderlinePosition,textWrap,textWrapMode,textWrapStyle,timelineScope,top,touchAction,transform,transformBox,transformOrigin,transformStyle,transition,transitionBehavior,transitionDelay,transitionDuration,transitionProperty,transitionTimingFunction,translate,unicodeBidi,userSelect,vectorEffect,verticalAlign,viewTimeline,viewTimelineAxis,viewTimelineInset,viewTimelineName,viewTransitionName,visibility,whiteSpace,whiteSpaceCollapse,widows,width,willChange,wordBreak,wordSpacing,wordWrap,writingMode,x,y,zIndex,zoom,alignmentBaseline,baselineShift,colorInterpolation,colorRendering,glyphOrientationVertical";
7
7
  var allCssProperties = cssPropertiesStr.split(",").concat(userGenerated);
@@ -13,7 +13,7 @@ type DisplayTableCellSlotRecipeVariantMap = {
13
13
  [key in keyof DisplayTableCellSlotRecipeVariant]: Array<DisplayTableCellSlotRecipeVariant[key]>
14
14
  }
15
15
 
16
- type DisplayTableCellSlotRecipeSlot = "root" | "content" | "depthSpacing"
16
+ type DisplayTableCellSlotRecipeSlot = "root" | "content" | "depthSpacing" | "skeletonCell"
17
17
 
18
18
  export type DisplayTableCellSlotRecipeVariantProps = {
19
19
  [key in keyof DisplayTableCellSlotRecipeVariant]?: ConditionalValue<DisplayTableCellSlotRecipeVariant[key]> | undefined
@@ -14,6 +14,10 @@ const displayTableCellSlotRecipeSlotNames = [
14
14
  [
15
15
  "depthSpacing",
16
16
  "DisplayTableCell__depthSpacing"
17
+ ],
18
+ [
19
+ "skeletonCell",
20
+ "DisplayTableCell__skeletonCell"
17
21
  ]
18
22
  ];
19
23
  const displayTableCellSlotRecipeSlotFns = /* @__PURE__ */ displayTableCellSlotRecipeSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, displayTableCellSlotRecipeDefaultVariants, getSlotCompoundVariant(displayTableCellSlotRecipeCompoundVariants, slotName))]);
@@ -87,4 +87,5 @@ export * from './month-range-picker-panel-slot-recipe';
87
87
  export * from './month-range-picker-navigation-slot-recipe';
88
88
  export * from './month-range-picker-content-slot-recipe';
89
89
  export * from './accordion-slot-recipe';
90
- export * from './split-view-slot-recipe';
90
+ export * from './split-view-slot-recipe';
91
+ export * from './toggle-switch-slot-recipe';
@@ -87,3 +87,4 @@ export * from './month-range-picker-navigation-slot-recipe.js';
87
87
  export * from './month-range-picker-content-slot-recipe.js';
88
88
  export * from './accordion-slot-recipe.js';
89
89
  export * from './split-view-slot-recipe.js';
90
+ export * from './toggle-switch-slot-recipe.js';
@@ -10,7 +10,7 @@ type MultipleSelectBoxSlotRecipeVariantMap = {
10
10
  [key in keyof MultipleSelectBoxSlotRecipeVariant]: Array<MultipleSelectBoxSlotRecipeVariant[key]>
11
11
  }
12
12
 
13
- type MultipleSelectBoxSlotRecipeSlot = "popover" | "menuHeader" | "optionPanel" | "listBox" | "listItem" | "skeletonItem" | "emptyMessage" | "menuFooter"
13
+ type MultipleSelectBoxSlotRecipeSlot = "popover" | "menuHeader" | "optionPanel" | "listBox" | "listItem" | "skeletonItem" | "emptyMessage" | "menuFooter" | "scrollWrapper" | "infiniteScrollError" | "infiniteScrollErrorMessage" | "infiniteScrollErrorButton" | "infiniteScrollErrorIcon" | "infiniteScrollLoading"
14
14
 
15
15
  export type MultipleSelectBoxSlotRecipeVariantProps = {
16
16
  [key in keyof MultipleSelectBoxSlotRecipeVariant]?: ConditionalValue<MultipleSelectBoxSlotRecipeVariant[key]> | undefined
@@ -34,6 +34,30 @@ const multipleSelectBoxSlotRecipeSlotNames = [
34
34
  [
35
35
  "menuFooter",
36
36
  "MultipleSelectBox__menuFooter"
37
+ ],
38
+ [
39
+ "scrollWrapper",
40
+ "MultipleSelectBox__scrollWrapper"
41
+ ],
42
+ [
43
+ "infiniteScrollError",
44
+ "MultipleSelectBox__infiniteScrollError"
45
+ ],
46
+ [
47
+ "infiniteScrollErrorMessage",
48
+ "MultipleSelectBox__infiniteScrollErrorMessage"
49
+ ],
50
+ [
51
+ "infiniteScrollErrorButton",
52
+ "MultipleSelectBox__infiniteScrollErrorButton"
53
+ ],
54
+ [
55
+ "infiniteScrollErrorIcon",
56
+ "MultipleSelectBox__infiniteScrollErrorIcon"
57
+ ],
58
+ [
59
+ "infiniteScrollLoading",
60
+ "MultipleSelectBox__infiniteScrollLoading"
37
61
  ]
38
62
  ];
39
63
  const multipleSelectBoxSlotRecipeSlotFns = /* @__PURE__ */ multipleSelectBoxSlotRecipeSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, multipleSelectBoxSlotRecipeDefaultVariants, getSlotCompoundVariant(multipleSelectBoxSlotRecipeCompoundVariants, slotName))]);