@wistia/ui 0.26.0 → 0.26.1-beta.4e0bff00.41b9be2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.26.0
3
+ * @license @wistia/ui v0.26.1-beta.4e0bff00.41b9be2
4
4
  *
5
5
  * Copyright (c) 2024-2026, Wistia, Inc. and its affiliates.
6
6
  *
@@ -8,7 +8,7 @@
8
8
  */
9
9
 
10
10
  import { Tooltip as Tooltip$1 } from "@base-ui/react/tooltip";
11
- import { Children, cloneElement, createContext, forwardRef, isValidElement, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useTransition } from "react";
11
+ import { Children, cloneElement, createContext, forwardRef, isValidElement, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState, useTransition } from "react";
12
12
  import { createGlobalStyle, css, keyframes, styled } from "styled-components";
13
13
  import { isArray, isBoolean, isEmptyString, isFunction, isNil, isNonEmptyArray, isNonEmptyString, isNotNil, isNotUndefined, isNumber, isRecord, isString, isUndefined } from "@wistia/type-guards";
14
14
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -1809,7 +1809,7 @@ const Action = ({ actionButton }) => {
1809
1809
  /**
1810
1810
  * A Toast is a short, non-intrusive notification message that briefly appears on the screen to provide feedback to the user.
1811
1811
  *
1812
- * This page is for screenshots only. For usage, see the [`useToast`](../?path=/docs/hooks-usetoast--docs) hook.
1812
+ * This page is for screenshots only. For usage, see the [`useToast`](/hooks/useToast) hook.
1813
1813
  */
1814
1814
  const Toast = ({ action, message, colorScheme = "inherit", icon, ...props }) => {
1815
1815
  return /* @__PURE__ */ jsxs(StyledToast, {
@@ -1956,6 +1956,22 @@ const solidButtonVariant = css`
1956
1956
  --button-color-text: var(--wui-color-text-on-fill);
1957
1957
  --button-color-icon: var(--wui-color-icon-on-fill);
1958
1958
  `;
1959
+ const disabledButtonVariant = css`
1960
+ --button-color-bg: var(--button-color-bg-override, var(--wui-color-bg-surface-disabled));
1961
+ --button-color-bg-hover: var(--button-color-bg-override, var(--wui-color-bg-surface-disabled));
1962
+ --button-color-bg-active: var(--button-color-bg-override, var(--wui-color-bg-surface-disabled));
1963
+ --button-color-text: var(--wui-color-text-disabled);
1964
+ --button-color-icon: var(--wui-color-icon-disabled);
1965
+ --button-color-border: var(--wui-color-border-disabled);
1966
+ `;
1967
+ const pressedButtonVariant = css`
1968
+ --button-color-bg: var(--wui-color-bg-surface-selected);
1969
+ --button-color-bg-hover: var(--wui-color-bg-surface-selected-hover);
1970
+ --button-color-bg-active: var(--wui-color-bg-surface-selected-active);
1971
+ --button-color-text: var(--wui-color-text-selected);
1972
+ --button-color-icon: var(--wui-color-icon-selected);
1973
+ --button-color-border: var(--wui-color-border-selected);
1974
+ `;
1959
1975
  const buttonBaseStyles = css`
1960
1976
  border-radius: var(--wui-border-radius-rounded);
1961
1977
  font-family: var(--button-typography-family);
@@ -2009,25 +2025,11 @@ const buttonBaseStyles = css`
2009
2025
  }
2010
2026
 
2011
2027
  &[aria-disabled='true'] {
2012
- ${css`
2013
- --button-color-bg: var(--button-color-bg-override, var(--wui-color-bg-surface-disabled));
2014
- --button-color-bg-hover: var(--button-color-bg-override, var(--wui-color-bg-surface-disabled));
2015
- --button-color-bg-active: var(--button-color-bg-override, var(--wui-color-bg-surface-disabled));
2016
- --button-color-text: var(--wui-color-text-disabled);
2017
- --button-color-icon: var(--wui-color-icon-disabled);
2018
- --button-color-border: var(--wui-color-border-disabled);
2019
- `};
2028
+ ${disabledButtonVariant};
2020
2029
  }
2021
2030
 
2022
2031
  &[aria-pressed='true'] {
2023
- ${css`
2024
- --button-color-bg: var(--wui-color-bg-surface-selected);
2025
- --button-color-bg-hover: var(--wui-color-bg-surface-selected-hover);
2026
- --button-color-bg-active: var(--wui-color-bg-surface-selected-active);
2027
- --button-color-text: var(--wui-color-text-selected);
2028
- --button-color-icon: var(--wui-color-icon-selected);
2029
- --button-color-border: var(--wui-color-border-selected);
2030
- `};
2032
+ ${pressedButtonVariant};
2031
2033
  }
2032
2034
  `;
2033
2035
  const buttonVariantsStyles = {
@@ -5694,7 +5696,7 @@ const StyledLabel$3 = styled.span`
5694
5696
  text-align: left;
5695
5697
  `;
5696
5698
  /**
5697
- * Action Button component is used as one of a group of main actions on the page. It composes [Button]().
5699
+ * Action Button component is used as one of a group of main actions on the page. It composes [Button](/components/Button).
5698
5700
  */
5699
5701
  const ActionButton = forwardRef(({ icon, colorScheme = "standard", disabled = false, forceState, hoverColorScheme, variant = "default", children, ...props }, ref) => {
5700
5702
  const resolvedHoverColorScheme = hoverColorScheme ?? (variant === "gated" ? "purple" : "inherit");
@@ -6513,8 +6515,8 @@ const StyledButton$1 = styled(Button)`
6513
6515
  line-height: 1;
6514
6516
  `;
6515
6517
  /**
6516
- * IconButton behaves like a [Button](?path=/docs/components-button--docs),
6517
- * but only accepts an [Icon](?path=/docs/components-icon--docs) as a child.
6518
+ * IconButton behaves like a [Button](/components/Button),
6519
+ * but only accepts an [Icon](/components/Icon) as a child.
6518
6520
  */
6519
6521
  const IconButton = forwardRef(({ children, label, size = "md", ...props }, ref) => {
6520
6522
  const responsiveSize = useResponsiveProp(size);
@@ -6632,7 +6634,7 @@ const StyledBreadcrumbs = styled.nav`
6632
6634
  const BUFFER_WIDTH = 10;
6633
6635
  /**
6634
6636
  * Used to display a screens's location within a hierarchical structure. Each `Breadcrumb` is a composed version of
6635
- * [Button](?path=/docs/components-button--docs). See it's documentation for additional functionality.
6637
+ * [Button](/components/Button). See it's documentation for additional functionality.
6636
6638
  */
6637
6639
  const Breadcrumbs = ({ children, ...props }) => {
6638
6640
  const { isXsAndDown } = useMq();
@@ -6719,7 +6721,7 @@ const prominenceMap = {
6719
6721
  };
6720
6722
  /**
6721
6723
  * A flexible container component that groups related content with consistent spacing and styling.
6722
- * Cards can be used to visually distinguish content sections. Extends the [Box component.](https://wistia.github.io/vhs/storybook-ui/?path=/docs/components-box--docs)
6724
+ * Cards can be used to visually distinguish content sections. Extends the [Box component.](/components/Box)
6723
6725
  */
6724
6726
  const Card = ({ children, border = false, borderRadius = "border-radius-04", colorScheme = "inherit", direction = "column", gap = "space-03", height, paddingSize = "space-04", prominence = "secondary", width, ...props }) => /* @__PURE__ */ jsx(StyledCard$1, {
6725
6727
  $backgroundColor: prominenceMap[prominence].backgroundColor,
@@ -7978,7 +7980,7 @@ const VISUAL_OFFSET = 6;
7978
7980
  const ARROW_EXTENSION = 6;
7979
7981
  /**
7980
7982
  * Tooltips are a way to provide additional information or context to a user when they hover or focus an element.
7981
- * For elements that are not interactive, consider using a [Popover]() instead.
7983
+ * For elements that are not interactive, consider using a [Popover](/components/Popover) instead.
7982
7984
  *
7983
7985
  */
7984
7986
  const Tooltip = ({ delay = 500, direction = "top", content, children, forceOpen, hideArrow = false, container = null }) => {
@@ -8727,7 +8729,7 @@ const StyledInputContainer = styled.div`
8727
8729
  }
8728
8730
  `;
8729
8731
  /**
8730
- * Capture user input with a text field. Should be used within a [Form]() and [FormField]().
8732
+ * Capture user input with a text field. Should be used within a [Form](/components/Form) and [FormField](/components/FormField).
8731
8733
  */
8732
8734
  const Input = forwardRef(({ fullWidth = true, fullHeight = false, monospace = false, type = "text", autoSelect = false, leftIcon, rightIcon, ...props }, externalRef) => {
8733
8735
  const internalRef = useRef(null);
@@ -9826,7 +9828,7 @@ const ContextMenuPopup = styled(Menu$1.Popup)`
9826
9828
  outline: none;
9827
9829
  `;
9828
9830
  /**
9829
- * The ContextMenu is an extended implementation of the [Menu]() component that allows for right-click context menus.
9831
+ * The ContextMenu is an extended implementation of the [Menu](/components/Menu) component that allows for right-click context menus.
9830
9832
  * It can be used in two ways:
9831
9833
  * 1. By providing a `triggerRef`, which will render the menu when the referenced element is right-clicked.
9832
9834
  * 2. By providing a `position` prop, which will render the menu at the specified coordinates.
@@ -10217,7 +10219,7 @@ DataListItem.displayName = "DataListItem_UI";
10217
10219
  //#endregion
10218
10220
  //#region src/components/DataList/DataListItemLabel.tsx
10219
10221
  /**
10220
- * The label of the `DataListItem`. Extends the [Text]() component.
10222
+ * The label of the `DataListItem`. Extends the [Text](/components/Text) component.
10221
10223
  */
10222
10224
  const DataListItemLabel = (props) => {
10223
10225
  return /* @__PURE__ */ jsx(Text, {
@@ -10230,7 +10232,7 @@ DataListItemLabel.displayName = "DataListItemLabel_UI";
10230
10232
  //#endregion
10231
10233
  //#region src/components/DataList/DataListItemValue.tsx
10232
10234
  /**
10233
- * The value of the `DataListItem`. Extends the [Text]() component.
10235
+ * The value of the `DataListItem`. Extends the [Text](/components/Text) component.
10234
10236
  */
10235
10237
  const DataListItemValue = (props) => {
10236
10238
  return /* @__PURE__ */ jsx(Text, {
@@ -11444,6 +11446,711 @@ const InputClickToCopy = forwardRef(({ value, onCopy, disabled = false, ...props
11444
11446
  });
11445
11447
  InputClickToCopy.displayName = "InputClickToCopy_UI";
11446
11448
  //#endregion
11449
+ //#region src/components/InputDuration/constants.ts
11450
+ const SECONDS_PER_MINUTE = 60;
11451
+ const MINUTES_PER_HOUR = 60;
11452
+ const MAX_MINUTES_UNIT_VALUE = SECONDS_PER_MINUTE - 1;
11453
+ const SECONDS_PER_TEN_MINUTES = SECONDS_PER_MINUTE * 10;
11454
+ const SECONDS_PER_HOUR = SECONDS_PER_MINUTE * MINUTES_PER_HOUR;
11455
+ const TEN_HOURS = SECONDS_PER_HOUR * 10;
11456
+ const ONE_HUNDREDTH_OF_A_SECOND = .01;
11457
+ const MAX_TIME = TEN_HOURS - ONE_HUNDREDTH_OF_A_SECOND;
11458
+ const NUMBER_STRING_SET = new Set([
11459
+ "0",
11460
+ "1",
11461
+ "2",
11462
+ "3",
11463
+ "4",
11464
+ "5",
11465
+ "6",
11466
+ "7",
11467
+ "8",
11468
+ "9"
11469
+ ]);
11470
+ //#endregion
11471
+ //#region src/components/InputDuration/durationFormatting.ts
11472
+ const hoursFormatter = new Intl.NumberFormat("en-US", {
11473
+ maximumFractionDigits: 0,
11474
+ useGrouping: false
11475
+ });
11476
+ const minutesFormatter = new Intl.NumberFormat("en-US", {
11477
+ maximumFractionDigits: 0,
11478
+ minimumIntegerDigits: 1
11479
+ });
11480
+ const tensOfMinutesFormatter = new Intl.NumberFormat("en-US", {
11481
+ maximumFractionDigits: 0,
11482
+ minimumIntegerDigits: 2
11483
+ });
11484
+ const getSecondsFormatter = (decimalUnitLength) => {
11485
+ return new Intl.NumberFormat("en-US", {
11486
+ maximumFractionDigits: decimalUnitLength,
11487
+ minimumFractionDigits: decimalUnitLength,
11488
+ minimumIntegerDigits: 2
11489
+ });
11490
+ };
11491
+ const isValidHour = (number) => Number.isInteger(number) && number >= 0;
11492
+ const isValidMinute = (number) => Number.isInteger(number) && number >= 0 && number <= MAX_MINUTES_UNIT_VALUE;
11493
+ const isValidSecond = (number) => Number.isFinite(number) && number >= 0 && number < SECONDS_PER_MINUTE;
11494
+ const durationValueToSeconds = (formattedTimeString) => {
11495
+ const segments = formattedTimeString.split(":");
11496
+ if (segments.length <= 3) {
11497
+ const [seconds = 0, minutes = 0, hours = 0] = segments.reverse().map(Number);
11498
+ if (isValidSecond(seconds) && isValidMinute(minutes) && isValidHour(hours)) return hours * SECONDS_PER_HOUR + minutes * SECONDS_PER_MINUTE + seconds;
11499
+ }
11500
+ throw new SyntaxError(`Invalid time (${formattedTimeString})`);
11501
+ };
11502
+ const getFormattedHours = ({ hours, maxUnit }) => {
11503
+ if (maxUnit !== "hours") return null;
11504
+ return hoursFormatter.format(hours);
11505
+ };
11506
+ const getFormattedMinutes = ({ minutes, maxUnit }) => {
11507
+ if (maxUnit === "seconds") return null;
11508
+ if (maxUnit === "minutes") return minutesFormatter.format(minutes);
11509
+ return tensOfMinutesFormatter.format(minutes);
11510
+ };
11511
+ const getFormattedSeconds = ({ seconds, decimalUnitLength }) => {
11512
+ return getSecondsFormatter(decimalUnitLength).format(seconds);
11513
+ };
11514
+ const convertSecondsToHMSUnits = (durationInSeconds) => {
11515
+ const wholeSeconds = Math.trunc(durationInSeconds);
11516
+ const fractionalSeconds = durationInSeconds - wholeSeconds;
11517
+ const { hours, minutes, seconds } = buildTimeDuration(wholeSeconds * milisecondsInSecond);
11518
+ return {
11519
+ hours,
11520
+ minutes,
11521
+ seconds: seconds + fractionalSeconds
11522
+ };
11523
+ };
11524
+ const secondsToDurationValue = ({ seconds: durationInSeconds, maxUnit, decimalUnitLength }) => {
11525
+ const { hours, minutes, seconds } = convertSecondsToHMSUnits(durationInSeconds);
11526
+ return [
11527
+ getFormattedHours({
11528
+ hours,
11529
+ maxUnit
11530
+ }),
11531
+ getFormattedMinutes({
11532
+ minutes,
11533
+ maxUnit
11534
+ }),
11535
+ getFormattedSeconds({
11536
+ seconds,
11537
+ decimalUnitLength
11538
+ })
11539
+ ].filter(Boolean).join(":");
11540
+ };
11541
+ const getMaxUnit = (seconds) => {
11542
+ if (seconds >= SECONDS_PER_HOUR) return "hours";
11543
+ if (seconds >= SECONDS_PER_TEN_MINUTES) return "tens-of-minutes";
11544
+ if (seconds >= SECONDS_PER_MINUTE) return "minutes";
11545
+ return "seconds";
11546
+ };
11547
+ const clampSeconds = ({ maxSeconds, minSeconds, seconds }) => {
11548
+ return Math.min(Math.max(seconds, minSeconds), maxSeconds);
11549
+ };
11550
+ const roundSeconds = (seconds, decimalUnitLength) => {
11551
+ const multiplier = decimalUnitLength === 0 ? 1 : 100;
11552
+ return Math.round(seconds * multiplier) / multiplier;
11553
+ };
11554
+ const getDurationBounds = ({ decimalUnitLength, maxSeconds, minSeconds }) => {
11555
+ const roundedMaxSeconds = roundSeconds(maxSeconds, decimalUnitLength);
11556
+ const roundedMinSeconds = roundSeconds(minSeconds, decimalUnitLength);
11557
+ if (roundedMaxSeconds < roundedMinSeconds) return {
11558
+ maxSeconds: roundedMaxSeconds,
11559
+ minSeconds: roundedMaxSeconds
11560
+ };
11561
+ return {
11562
+ maxSeconds: roundedMaxSeconds,
11563
+ minSeconds: roundedMinSeconds
11564
+ };
11565
+ };
11566
+ //#endregion
11567
+ //#region src/components/InputDuration/durationSelection.ts
11568
+ const getEmptySelectionRanges = () => ({
11569
+ hours: {
11570
+ start: null,
11571
+ end: null
11572
+ },
11573
+ "tens-of-minutes": {
11574
+ start: null,
11575
+ end: null
11576
+ },
11577
+ minutes: {
11578
+ start: null,
11579
+ end: null
11580
+ },
11581
+ seconds: {
11582
+ start: null,
11583
+ end: null
11584
+ },
11585
+ "hundredths-of-seconds": {
11586
+ start: null,
11587
+ end: null
11588
+ }
11589
+ });
11590
+ const getSegmentRange = ({ segment, offset }) => {
11591
+ return {
11592
+ nextOffset: offset + segment.length + 1,
11593
+ range: {
11594
+ start: offset,
11595
+ end: offset + segment.length
11596
+ }
11597
+ };
11598
+ };
11599
+ const getSecondsRanges = ({ segment, offset }) => {
11600
+ const decimalSeparatorIndex = segment.indexOf(".");
11601
+ const ranges = {
11602
+ seconds: {
11603
+ start: offset,
11604
+ end: offset + (decimalSeparatorIndex === -1 ? segment.length : decimalSeparatorIndex)
11605
+ },
11606
+ "hundredths-of-seconds": {
11607
+ start: null,
11608
+ end: null
11609
+ }
11610
+ };
11611
+ if (decimalSeparatorIndex !== -1 && decimalSeparatorIndex < segment.length - 1) ranges["hundredths-of-seconds"] = {
11612
+ start: offset + decimalSeparatorIndex + 1,
11613
+ end: offset + segment.length
11614
+ };
11615
+ return ranges;
11616
+ };
11617
+ const getSelectionRanges = ({ inputValue, maxUnit }) => {
11618
+ const segments = inputValue.split(":");
11619
+ let offset = 0;
11620
+ if (maxUnit === "hours") {
11621
+ const [hours = "", minutes = "", seconds = ""] = segments;
11622
+ const hoursResult = getSegmentRange({
11623
+ segment: hours,
11624
+ offset
11625
+ });
11626
+ offset = hoursResult.nextOffset;
11627
+ const minutesResult = getSegmentRange({
11628
+ segment: minutes,
11629
+ offset
11630
+ });
11631
+ offset = minutesResult.nextOffset;
11632
+ return {
11633
+ ...getEmptySelectionRanges(),
11634
+ hours: hoursResult.range,
11635
+ "tens-of-minutes": minutesResult.range,
11636
+ ...getSecondsRanges({
11637
+ segment: seconds,
11638
+ offset
11639
+ })
11640
+ };
11641
+ }
11642
+ if (maxUnit === "tens-of-minutes") {
11643
+ const [minutes = "", seconds = ""] = segments;
11644
+ const minutesResult = getSegmentRange({
11645
+ segment: minutes,
11646
+ offset
11647
+ });
11648
+ offset = minutesResult.nextOffset;
11649
+ return {
11650
+ ...getEmptySelectionRanges(),
11651
+ "tens-of-minutes": minutesResult.range,
11652
+ ...getSecondsRanges({
11653
+ segment: seconds,
11654
+ offset
11655
+ })
11656
+ };
11657
+ }
11658
+ if (maxUnit === "minutes") {
11659
+ const [minutes = "", seconds = ""] = segments;
11660
+ const minutesResult = getSegmentRange({
11661
+ segment: minutes,
11662
+ offset
11663
+ });
11664
+ offset = minutesResult.nextOffset;
11665
+ return {
11666
+ ...getEmptySelectionRanges(),
11667
+ minutes: minutesResult.range,
11668
+ ...getSecondsRanges({
11669
+ segment: seconds,
11670
+ offset
11671
+ })
11672
+ };
11673
+ }
11674
+ const [seconds = ""] = segments;
11675
+ return {
11676
+ ...getEmptySelectionRanges(),
11677
+ ...getSecondsRanges({
11678
+ segment: seconds,
11679
+ offset
11680
+ })
11681
+ };
11682
+ };
11683
+ //#endregion
11684
+ //#region src/components/InputDuration/durationUnits.ts
11685
+ const DURATION_UNITS = new Set([
11686
+ "hours",
11687
+ "hundredths-of-seconds",
11688
+ "minutes",
11689
+ "seconds",
11690
+ "tens-of-minutes"
11691
+ ]);
11692
+ const isDurationUnit = (unit) => {
11693
+ return isNotNil(unit) && DURATION_UNITS.has(unit);
11694
+ };
11695
+ //#endregion
11696
+ //#region src/components/InputDuration/useInputDuration.ts
11697
+ const useInputDuration = ({ decimalUnitLength, maxSeconds, minSeconds, onChangeValueInSeconds, valueInSeconds }) => {
11698
+ const [inputSelection, setInputSelection] = useState(null);
11699
+ const inputRef = useRef(null);
11700
+ const anyKeyIsDownRef = useRef(false);
11701
+ const selectedUnitRef = useRef(null);
11702
+ const secondDigitMightBeTypedNext = useRef(false);
11703
+ const { maxSeconds: roundedMaxSeconds, minSeconds: roundedMinSeconds } = useMemo(() => getDurationBounds({
11704
+ decimalUnitLength,
11705
+ maxSeconds,
11706
+ minSeconds
11707
+ }), [
11708
+ decimalUnitLength,
11709
+ maxSeconds,
11710
+ minSeconds
11711
+ ]);
11712
+ const maxUnit = useMemo(() => getMaxUnit(roundedMaxSeconds), [roundedMaxSeconds]);
11713
+ const boundedValueInSeconds = useMemo(() => clampSeconds({
11714
+ maxSeconds: roundedMaxSeconds,
11715
+ minSeconds: roundedMinSeconds,
11716
+ seconds: valueInSeconds
11717
+ }), [
11718
+ roundedMaxSeconds,
11719
+ roundedMinSeconds,
11720
+ valueInSeconds
11721
+ ]);
11722
+ const inputValue = useMemo(() => secondsToDurationValue({
11723
+ decimalUnitLength,
11724
+ maxUnit,
11725
+ seconds: boundedValueInSeconds
11726
+ }), [
11727
+ boundedValueInSeconds,
11728
+ decimalUnitLength,
11729
+ maxUnit
11730
+ ]);
11731
+ const selectionRanges = useMemo(() => getSelectionRanges({
11732
+ inputValue,
11733
+ maxUnit
11734
+ }), [inputValue, maxUnit]);
11735
+ const decimalStep = decimalUnitLength === 0 ? 0 : ONE_HUNDREDTH_OF_A_SECOND;
11736
+ const maybeSetInputValueAndTriggerOnChange = useCallback((candidateInputValue) => {
11737
+ const seconds = durationValueToSeconds(candidateInputValue);
11738
+ if (seconds < roundedMinSeconds || seconds > roundedMaxSeconds) return;
11739
+ onChangeValueInSeconds(seconds);
11740
+ }, [
11741
+ onChangeValueInSeconds,
11742
+ roundedMaxSeconds,
11743
+ roundedMinSeconds
11744
+ ]);
11745
+ const selectUnit = useCallback((unit) => {
11746
+ selectedUnitRef.current = unit;
11747
+ if (unit == null) {
11748
+ setInputSelection(null);
11749
+ return;
11750
+ }
11751
+ const { start, end } = selectionRanges[unit];
11752
+ if (start == null || end == null) {
11753
+ setInputSelection(null);
11754
+ return;
11755
+ }
11756
+ inputRef.current?.setSelectionRange(start, end);
11757
+ setInputSelection({
11758
+ start,
11759
+ end
11760
+ });
11761
+ }, [selectionRanges]);
11762
+ const getFirstSelectableUnit = useCallback(() => {
11763
+ const result = Object.entries(selectionRanges).find(([, { start, end }]) => {
11764
+ return start !== null && end !== null;
11765
+ })?.[0] ?? null;
11766
+ if (!isDurationUnit(result)) return null;
11767
+ return result;
11768
+ }, [selectionRanges]);
11769
+ const selectFirstUnit = useCallback(() => {
11770
+ selectUnit(getFirstSelectableUnit());
11771
+ }, [getFirstSelectableUnit, selectUnit]);
11772
+ const getUnitForSelectionIndices = useCallback(({ selectionStart, selectionEnd }) => {
11773
+ const result = Object.entries(selectionRanges).find(([, { start, end }]) => {
11774
+ if (start === null || end === null) return false;
11775
+ return selectionStart >= start && selectionEnd <= end;
11776
+ })?.[0] ?? null;
11777
+ if (!isDurationUnit(result)) return null;
11778
+ return result;
11779
+ }, [selectionRanges]);
11780
+ const selectedUnit = useMemo(() => {
11781
+ if (inputSelection == null) return null;
11782
+ const { start: selectionStart, end: selectionEnd } = inputSelection;
11783
+ const foundUnit = getUnitForSelectionIndices({
11784
+ selectionStart,
11785
+ selectionEnd
11786
+ });
11787
+ if (!isDurationUnit(foundUnit)) return null;
11788
+ return foundUnit;
11789
+ }, [getUnitForSelectionIndices, inputSelection]);
11790
+ const selectUnitToRight = useCallback(() => {
11791
+ if (inputSelection == null) return;
11792
+ const unitToSelect = getUnitForSelectionIndices({
11793
+ selectionEnd: inputSelection.end + 1,
11794
+ selectionStart: inputSelection.end + 1
11795
+ });
11796
+ if (unitToSelect == null) return;
11797
+ selectedUnitRef.current = unitToSelect;
11798
+ requestAnimationFrame(() => {
11799
+ selectUnit(unitToSelect);
11800
+ });
11801
+ }, [
11802
+ getUnitForSelectionIndices,
11803
+ inputSelection,
11804
+ selectUnit
11805
+ ]);
11806
+ const selectUnitToLeft = useCallback(() => {
11807
+ if (inputSelection == null) return;
11808
+ const unitToSelect = getUnitForSelectionIndices({
11809
+ selectionEnd: inputSelection.start - 1,
11810
+ selectionStart: inputSelection.start - 1
11811
+ });
11812
+ if (unitToSelect == null) return;
11813
+ selectUnit(unitToSelect);
11814
+ }, [
11815
+ getUnitForSelectionIndices,
11816
+ inputSelection,
11817
+ selectUnit
11818
+ ]);
11819
+ const incrementBySeconds = useCallback((secondsToIncrementBy) => {
11820
+ const newValue = durationValueToSeconds(inputValue) + secondsToIncrementBy;
11821
+ if (newValue > roundedMaxSeconds) return;
11822
+ maybeSetInputValueAndTriggerOnChange(secondsToDurationValue({
11823
+ decimalUnitLength,
11824
+ maxUnit,
11825
+ seconds: newValue
11826
+ }));
11827
+ }, [
11828
+ decimalUnitLength,
11829
+ inputValue,
11830
+ maxUnit,
11831
+ maybeSetInputValueAndTriggerOnChange,
11832
+ roundedMaxSeconds
11833
+ ]);
11834
+ const decrementBySeconds = useCallback((secondsToDecrementBy) => {
11835
+ const newValue = durationValueToSeconds(inputValue) - secondsToDecrementBy;
11836
+ if (newValue < roundedMinSeconds) return;
11837
+ maybeSetInputValueAndTriggerOnChange(secondsToDurationValue({
11838
+ decimalUnitLength,
11839
+ maxUnit,
11840
+ seconds: newValue
11841
+ }));
11842
+ }, [
11843
+ decimalUnitLength,
11844
+ inputValue,
11845
+ maxUnit,
11846
+ maybeSetInputValueAndTriggerOnChange,
11847
+ roundedMinSeconds
11848
+ ]);
11849
+ const incrementSelectedUnit = useCallback(() => {
11850
+ if (selectedUnit == null) return;
11851
+ if (selectedUnit === "hours") {
11852
+ incrementBySeconds(SECONDS_PER_HOUR);
11853
+ return;
11854
+ }
11855
+ if (selectedUnit === "minutes" || selectedUnit === "tens-of-minutes") {
11856
+ incrementBySeconds(SECONDS_PER_MINUTE);
11857
+ return;
11858
+ }
11859
+ if (selectedUnit === "seconds") {
11860
+ incrementBySeconds(1);
11861
+ return;
11862
+ }
11863
+ incrementBySeconds(decimalStep);
11864
+ }, [
11865
+ decimalStep,
11866
+ incrementBySeconds,
11867
+ selectedUnit
11868
+ ]);
11869
+ const decrementSelectedUnit = useCallback(() => {
11870
+ if (selectedUnit == null) return;
11871
+ if (selectedUnit === "hours") {
11872
+ decrementBySeconds(SECONDS_PER_HOUR);
11873
+ return;
11874
+ }
11875
+ if (selectedUnit === "minutes" || selectedUnit === "tens-of-minutes") {
11876
+ decrementBySeconds(SECONDS_PER_MINUTE);
11877
+ return;
11878
+ }
11879
+ if (selectedUnit === "seconds") {
11880
+ decrementBySeconds(1);
11881
+ return;
11882
+ }
11883
+ decrementBySeconds(decimalStep);
11884
+ }, [
11885
+ decimalStep,
11886
+ decrementBySeconds,
11887
+ selectedUnit
11888
+ ]);
11889
+ const setSelectedUnitToZero = useCallback(() => {
11890
+ if (selectedUnit == null || inputSelection == null) return;
11891
+ const textToLeftOfSelection = inputValue.slice(0, inputSelection.start);
11892
+ const textToRightOfSelection = inputValue.slice(inputSelection.end);
11893
+ if (selectedUnit === "hours") {
11894
+ maybeSetInputValueAndTriggerOnChange(`0${textToRightOfSelection}`);
11895
+ selectUnitToRight();
11896
+ return;
11897
+ }
11898
+ if (selectedUnit === "tens-of-minutes") {
11899
+ maybeSetInputValueAndTriggerOnChange(`${textToLeftOfSelection}00${textToRightOfSelection}`);
11900
+ selectUnitToRight();
11901
+ return;
11902
+ }
11903
+ if (selectedUnit === "minutes") {
11904
+ maybeSetInputValueAndTriggerOnChange(`0${textToRightOfSelection}`);
11905
+ selectUnitToRight();
11906
+ return;
11907
+ }
11908
+ if (selectedUnit === "seconds") {
11909
+ maybeSetInputValueAndTriggerOnChange(`${textToLeftOfSelection}00${textToRightOfSelection}`);
11910
+ selectUnitToRight();
11911
+ return;
11912
+ }
11913
+ maybeSetInputValueAndTriggerOnChange(`${textToLeftOfSelection}${"0".repeat(decimalUnitLength)}`);
11914
+ selectUnitToRight();
11915
+ }, [
11916
+ decimalUnitLength,
11917
+ inputSelection,
11918
+ inputValue,
11919
+ maybeSetInputValueAndTriggerOnChange,
11920
+ selectUnitToRight,
11921
+ selectedUnit
11922
+ ]);
11923
+ const onInputSelect = useCallback((event) => {
11924
+ if (anyKeyIsDownRef.current) return;
11925
+ const { selectionStart, selectionEnd } = event.currentTarget;
11926
+ if (selectionStart === null || selectionEnd === null) return;
11927
+ selectUnit(getUnitForSelectionIndices({
11928
+ selectionStart,
11929
+ selectionEnd
11930
+ }));
11931
+ }, [getUnitForSelectionIndices, selectUnit]);
11932
+ const onFocus = useCallback(() => {
11933
+ const selectFirstUnitIfAllTextIsSelected = () => {
11934
+ const input = inputRef.current;
11935
+ if (input == null) return;
11936
+ if (input.selectionStart === 0 && input.selectionEnd === input.value.length) selectFirstUnit();
11937
+ };
11938
+ selectFirstUnitIfAllTextIsSelected();
11939
+ requestAnimationFrame(selectFirstUnitIfAllTextIsSelected);
11940
+ }, [selectFirstUnit]);
11941
+ const restoreSelectionToSelectedUnit = useCallback(() => {
11942
+ selectUnit(selectedUnitRef.current);
11943
+ }, [selectUnit]);
11944
+ useLayoutEffect(() => {
11945
+ if (inputRef.current == null || document.activeElement !== inputRef.current) return;
11946
+ selectUnit(selectedUnitRef.current);
11947
+ }, [inputValue, selectUnit]);
11948
+ const prepareForPossibleSecondDigit = useCallback(() => {
11949
+ secondDigitMightBeTypedNext.current = true;
11950
+ restoreSelectionToSelectedUnit();
11951
+ }, [restoreSelectionToSelectedUnit]);
11952
+ const onTypeNumber = useCallback((number) => {
11953
+ if (inputSelection == null) return;
11954
+ const selectedText = inputValue.slice(inputSelection.start, inputSelection.end);
11955
+ const textToLeftOfSelection = inputValue.slice(0, inputSelection.start);
11956
+ const textToRightOfSelection = inputValue.slice(inputSelection.end);
11957
+ if (selectedUnit === "hours") {
11958
+ maybeSetInputValueAndTriggerOnChange(`${number.toString()}${textToRightOfSelection}`);
11959
+ selectUnitToRight();
11960
+ return;
11961
+ }
11962
+ if (selectedUnit === "tens-of-minutes" && number >= SECONDS_PER_MINUTE / 10 && !secondDigitMightBeTypedNext.current) {
11963
+ maybeSetInputValueAndTriggerOnChange(`${textToLeftOfSelection}0${number.toString()}${textToRightOfSelection}`);
11964
+ secondDigitMightBeTypedNext.current = false;
11965
+ selectUnitToRight();
11966
+ return;
11967
+ }
11968
+ if (selectedUnit === "tens-of-minutes" && !secondDigitMightBeTypedNext.current) {
11969
+ maybeSetInputValueAndTriggerOnChange(`${textToLeftOfSelection}${number.toString()}0${textToRightOfSelection}`);
11970
+ prepareForPossibleSecondDigit();
11971
+ return;
11972
+ }
11973
+ if (selectedUnit === "tens-of-minutes" && secondDigitMightBeTypedNext.current) {
11974
+ maybeSetInputValueAndTriggerOnChange(`${textToLeftOfSelection}${selectedText[0]}${number.toString()}${textToRightOfSelection}`);
11975
+ secondDigitMightBeTypedNext.current = false;
11976
+ selectUnitToRight();
11977
+ return;
11978
+ }
11979
+ if (selectedUnit === "minutes") {
11980
+ maybeSetInputValueAndTriggerOnChange(`${number.toString()}${textToRightOfSelection}`);
11981
+ selectUnitToRight();
11982
+ return;
11983
+ }
11984
+ if (selectedUnit === "seconds" && number >= SECONDS_PER_MINUTE / 10 && !secondDigitMightBeTypedNext.current) {
11985
+ maybeSetInputValueAndTriggerOnChange(`${textToLeftOfSelection}0${number.toString()}${textToRightOfSelection}`);
11986
+ secondDigitMightBeTypedNext.current = false;
11987
+ selectUnitToRight();
11988
+ return;
11989
+ }
11990
+ if (selectedUnit === "seconds" && !secondDigitMightBeTypedNext.current) {
11991
+ maybeSetInputValueAndTriggerOnChange(`${textToLeftOfSelection}${number.toString()}0${textToRightOfSelection}`);
11992
+ prepareForPossibleSecondDigit();
11993
+ return;
11994
+ }
11995
+ if (selectedUnit === "seconds" && secondDigitMightBeTypedNext.current) {
11996
+ maybeSetInputValueAndTriggerOnChange(`${textToLeftOfSelection}${selectedText[0]}${number.toString()}${textToRightOfSelection}`);
11997
+ secondDigitMightBeTypedNext.current = false;
11998
+ selectUnitToRight();
11999
+ return;
12000
+ }
12001
+ if (selectedUnit === "hundredths-of-seconds" && !secondDigitMightBeTypedNext.current) {
12002
+ maybeSetInputValueAndTriggerOnChange(`${textToLeftOfSelection}${number.toString()}0`);
12003
+ prepareForPossibleSecondDigit();
12004
+ return;
12005
+ }
12006
+ if (selectedUnit === "hundredths-of-seconds" && secondDigitMightBeTypedNext.current) {
12007
+ maybeSetInputValueAndTriggerOnChange(`${textToLeftOfSelection}${selectedText[0]}${number.toString()}`);
12008
+ secondDigitMightBeTypedNext.current = false;
12009
+ restoreSelectionToSelectedUnit();
12010
+ }
12011
+ }, [
12012
+ inputSelection,
12013
+ inputValue,
12014
+ maybeSetInputValueAndTriggerOnChange,
12015
+ prepareForPossibleSecondDigit,
12016
+ restoreSelectionToSelectedUnit,
12017
+ selectUnitToRight,
12018
+ selectedUnit
12019
+ ]);
12020
+ return {
12021
+ inputRef,
12022
+ inputValue,
12023
+ onFocus,
12024
+ onInputSelect,
12025
+ onKeyDown: useCallback((event) => {
12026
+ anyKeyIsDownRef.current = true;
12027
+ if (inputRef.current == null || inputSelection == null) return;
12028
+ const { start: selectionStart, end: selectionEnd } = inputSelection;
12029
+ const { key } = event;
12030
+ if (key === "ArrowRight") {
12031
+ event.preventDefault();
12032
+ secondDigitMightBeTypedNext.current = false;
12033
+ selectUnitToRight();
12034
+ return;
12035
+ }
12036
+ if (key === "ArrowLeft") {
12037
+ event.preventDefault();
12038
+ secondDigitMightBeTypedNext.current = false;
12039
+ selectUnitToLeft();
12040
+ return;
12041
+ }
12042
+ if (key === "ArrowUp") {
12043
+ event.preventDefault();
12044
+ secondDigitMightBeTypedNext.current = false;
12045
+ incrementSelectedUnit();
12046
+ restoreSelectionToSelectedUnit();
12047
+ return;
12048
+ }
12049
+ if (key === "ArrowDown") {
12050
+ event.preventDefault();
12051
+ secondDigitMightBeTypedNext.current = false;
12052
+ decrementSelectedUnit();
12053
+ restoreSelectionToSelectedUnit();
12054
+ return;
12055
+ }
12056
+ if (key === "Tab" && !event.shiftKey && selectionEnd < inputRef.current.value.length) {
12057
+ event.preventDefault();
12058
+ secondDigitMightBeTypedNext.current = false;
12059
+ selectUnitToRight();
12060
+ return;
12061
+ }
12062
+ if (key === "Tab" && event.shiftKey && selectionStart > 0) {
12063
+ event.preventDefault();
12064
+ secondDigitMightBeTypedNext.current = false;
12065
+ selectUnitToLeft();
12066
+ return;
12067
+ }
12068
+ if (key === ":") {
12069
+ event.preventDefault();
12070
+ secondDigitMightBeTypedNext.current = false;
12071
+ selectUnitToRight();
12072
+ return;
12073
+ }
12074
+ if (key === "." && decimalUnitLength > 0) {
12075
+ event.preventDefault();
12076
+ secondDigitMightBeTypedNext.current = false;
12077
+ selectUnit("hundredths-of-seconds");
12078
+ return;
12079
+ }
12080
+ if (NUMBER_STRING_SET.has(key)) {
12081
+ event.preventDefault();
12082
+ onTypeNumber(Number(key));
12083
+ return;
12084
+ }
12085
+ if (key === "Backspace") {
12086
+ event.preventDefault();
12087
+ setSelectedUnitToZero();
12088
+ restoreSelectionToSelectedUnit();
12089
+ }
12090
+ }, [
12091
+ decimalUnitLength,
12092
+ decrementSelectedUnit,
12093
+ incrementSelectedUnit,
12094
+ inputSelection,
12095
+ onTypeNumber,
12096
+ restoreSelectionToSelectedUnit,
12097
+ selectUnit,
12098
+ selectUnitToLeft,
12099
+ selectUnitToRight,
12100
+ setSelectedUnitToZero
12101
+ ]),
12102
+ onKeyUp: useCallback(() => {
12103
+ anyKeyIsDownRef.current = false;
12104
+ }, [])
12105
+ };
12106
+ };
12107
+ //#endregion
12108
+ //#region src/components/InputDuration/InputDuration.tsx
12109
+ const EXTRA_INPUT_WIDTH_CH = 4;
12110
+ const getInputWidth = (inputValue) => {
12111
+ return `calc(${inputValue.length + EXTRA_INPUT_WIDTH_CH}ch + var(--wui-input-horizontal-padding) + var(--wui-input-horizontal-padding))`;
12112
+ };
12113
+ /**
12114
+ * InputDuration lets users edit a duration value using a keyboard-friendly time input.
12115
+ */
12116
+ const InputDuration = forwardRef(({ decimalUnitLength = 2, disabled = false, fullWidth = false, maxSeconds = MAX_TIME, minSeconds = 0, onChangeValueInSeconds, valueInSeconds, onFocus, style, ...props }, externalRef) => {
12117
+ const { inputRef, inputValue, onFocus: onInputFocus, onInputSelect, onKeyDown, onKeyUp } = useInputDuration({
12118
+ decimalUnitLength,
12119
+ maxSeconds,
12120
+ minSeconds,
12121
+ onChangeValueInSeconds,
12122
+ valueInSeconds
12123
+ });
12124
+ const inputWidth = fullWidth ? void 0 : getInputWidth(inputValue);
12125
+ useImperativeHandle(externalRef, () => inputRef.current);
12126
+ const handleFocus = (event) => {
12127
+ onInputFocus();
12128
+ onFocus?.(event);
12129
+ };
12130
+ return /* @__PURE__ */ jsx(Input, {
12131
+ ...props,
12132
+ ref: inputRef,
12133
+ disabled,
12134
+ fullWidth,
12135
+ inputMode: "numeric",
12136
+ monospace: true,
12137
+ onChange: () => {},
12138
+ onFocus: handleFocus,
12139
+ onKeyDown,
12140
+ onKeyUp,
12141
+ onSelect: onInputSelect,
12142
+ style: {
12143
+ width: inputWidth,
12144
+ textAlign: "right",
12145
+ caretColor: "transparent",
12146
+ ...style
12147
+ },
12148
+ type: "text",
12149
+ value: inputValue
12150
+ });
12151
+ });
12152
+ InputDuration.displayName = "InputDuration_UI";
12153
+ //#endregion
11447
12154
  //#region src/components/InputPassword/InputPassword.tsx
11448
12155
  const StyledIconButton = styled(IconButton)`
11449
12156
  /* override size for icon button since prop gets changed by Input */
@@ -14038,6 +14745,194 @@ const SelectOptionGroup = ({ children, label, ...props }) => {
14038
14745
  });
14039
14746
  };
14040
14747
  //#endregion
14748
+ //#region src/components/Sidebar/Sidebar.tsx
14749
+ const StyledSidebar = styled.div`
14750
+ --wui-sidebar-padding-block: var(--wui-space-05);
14751
+ --wui-sidebar-padding-inline: var(--wui-space-03);
14752
+ --wui-sidebar-item-gap: var(--wui-space-02);
14753
+ --wui-sidebar-item-inset: var(--wui-space-03);
14754
+ --wui-sidebar-group-gap: var(--wui-space-05);
14755
+ --wui-sidebar-content-top-padding: var(--wui-space-06);
14756
+ --wui-sidebar-content-bottom-padding: var(--wui-space-06);
14757
+
14758
+ &:has([data-wui-sidebar-header]) {
14759
+ --wui-sidebar-content-top-padding: calc(
14760
+ var(--wui-sidebar-group-gap) - var(--wui-sidebar-padding-block)
14761
+ );
14762
+ }
14763
+
14764
+ &:has([data-wui-sidebar-footer]) {
14765
+ --wui-sidebar-content-bottom-padding: calc(
14766
+ var(--wui-sidebar-group-gap) - var(--wui-sidebar-padding-block)
14767
+ );
14768
+ }
14769
+
14770
+ display: flex;
14771
+ flex-direction: column;
14772
+ width: 260px;
14773
+ background: var(--wui-color-bg-surface);
14774
+ overflow: hidden;
14775
+ border-right: 1px solid var(--wui-color-border);
14776
+ `;
14777
+ const Sidebar = forwardRef(({ children, ...props }, ref) => {
14778
+ return /* @__PURE__ */ jsx(StyledSidebar, {
14779
+ ref,
14780
+ ...props,
14781
+ children
14782
+ });
14783
+ });
14784
+ Sidebar.displayName = "Sidebar_UI";
14785
+ //#endregion
14786
+ //#region src/components/Sidebar/SidebarHeader.tsx
14787
+ const StyledSidebarHeader = styled.div`
14788
+ display: flex;
14789
+ flex-direction: column;
14790
+ width: 100%;
14791
+ padding-block: var(--wui-sidebar-padding-block);
14792
+ padding-inline: var(--wui-sidebar-padding-inline);
14793
+ `;
14794
+ const SidebarHeader = ({ children }) => {
14795
+ return /* @__PURE__ */ jsx(StyledSidebarHeader, {
14796
+ "data-wui-sidebar-header": true,
14797
+ children
14798
+ });
14799
+ };
14800
+ SidebarHeader.displayName = "SidebarHeader_UI";
14801
+ //#endregion
14802
+ //#region src/components/Sidebar/SidebarFooter.tsx
14803
+ const StyledSidebarFooter = styled.div`
14804
+ display: flex;
14805
+ flex-direction: column;
14806
+ width: 100%;
14807
+ padding-block: var(--wui-sidebar-padding-block);
14808
+ padding-inline: var(--wui-sidebar-padding-inline);
14809
+ `;
14810
+ const SidebarFooter = ({ children }) => {
14811
+ return /* @__PURE__ */ jsx(StyledSidebarFooter, {
14812
+ "data-wui-sidebar-footer": true,
14813
+ children
14814
+ });
14815
+ };
14816
+ SidebarFooter.displayName = "SidebarFooter_UI";
14817
+ //#endregion
14818
+ //#region src/components/Sidebar/SidebarTitle.tsx
14819
+ const StyledSidebarTitle = styled(Heading)`
14820
+ padding-left: var(--wui-sidebar-item-inset);
14821
+ `;
14822
+ const SidebarTitle = ({ children }) => {
14823
+ return /* @__PURE__ */ jsx(StyledSidebarTitle, {
14824
+ variant: "heading3",
14825
+ children
14826
+ });
14827
+ };
14828
+ SidebarTitle.displayName = "SidebarTitle_UI";
14829
+ //#endregion
14830
+ //#region src/components/Sidebar/SidebarContent.tsx
14831
+ const StyledSidebarContent = styled(ScrollArea)`
14832
+ display: flex;
14833
+ flex-direction: column;
14834
+ flex: 1 1 auto;
14835
+ min-height: 0;
14836
+ gap: var(--wui-sidebar-group-gap);
14837
+ padding-top: var(--wui-sidebar-content-top-padding);
14838
+ padding-bottom: var(--wui-sidebar-content-bottom-padding);
14839
+ padding-inline: var(--wui-sidebar-padding-inline);
14840
+ `;
14841
+ const SidebarContent = ({ children }) => {
14842
+ return /* @__PURE__ */ jsx(StyledSidebarContent, {
14843
+ "data-wui-sidebar-content": true,
14844
+ children
14845
+ });
14846
+ };
14847
+ SidebarContent.displayName = "SidebarContent_UI";
14848
+ //#endregion
14849
+ //#region src/components/Sidebar/SidebarGroup.tsx
14850
+ const StyledSidebarGroup = styled.div`
14851
+ display: flex;
14852
+ flex-direction: column;
14853
+ gap: var(--wui-sidebar-item-gap);
14854
+ `;
14855
+ const SidebarGroup = ({ children }) => {
14856
+ return /* @__PURE__ */ jsx(StyledSidebarGroup, {
14857
+ "data-wui-sidebar-group": true,
14858
+ children
14859
+ });
14860
+ };
14861
+ SidebarGroup.displayName = "SidebarGroup_UI";
14862
+ //#endregion
14863
+ //#region src/components/Sidebar/SidebarGroupLabel.tsx
14864
+ const StyledSidebarGroupLabel = styled.div`
14865
+ display: flex;
14866
+ align-items: center;
14867
+ min-height: 24px;
14868
+ padding-inline: var(--wui-sidebar-item-inset);
14869
+ width: 100%;
14870
+ justify-content: space-between;
14871
+ gap: var(--wui-space-02);
14872
+ `;
14873
+ const SidebarGroupLabel = ({ children, rightSlot, leftSlot }) => {
14874
+ return /* @__PURE__ */ jsxs(StyledSidebarGroupLabel, {
14875
+ "data-wui-sidebar-group-label": true,
14876
+ children: [
14877
+ leftSlot,
14878
+ /* @__PURE__ */ jsx(Text, {
14879
+ variant: "label3",
14880
+ prominence: "secondary",
14881
+ style: { flex: 1 },
14882
+ children: /* @__PURE__ */ jsx("b", { children })
14883
+ }),
14884
+ rightSlot
14885
+ ]
14886
+ });
14887
+ };
14888
+ SidebarGroupLabel.displayName = "SidebarGroupLabel_UI";
14889
+ //#endregion
14890
+ //#region src/components/Sidebar/SidebarButton.tsx
14891
+ const StyledSidebarButton = styled(Button)`
14892
+ --button-label-gap: var(--wui-space-02);
14893
+ --button-typography-size: var(--wui-typography-label-2-size);
14894
+ --button-typography-line-height: var(--wui-typography-label-2-line-height);
14895
+ --button-typography-weight: var(--wui-typography-body-2-weight);
14896
+ --button-label-padding-horizontal: var(--wui-space-00);
14897
+
14898
+ padding-inline: var(--wui-sidebar-item-inset);
14899
+ text-align: left;
14900
+
14901
+ &[aria-current] {
14902
+ ${pressedButtonVariant};
14903
+ }
14904
+ `;
14905
+ const SidebarButton = forwardRef(({ selected = false, ...props }, ref) => {
14906
+ return /* @__PURE__ */ jsx(StyledSidebarButton, {
14907
+ ref,
14908
+ "aria-current": selected ? "page" : void 0,
14909
+ variant: "ghost",
14910
+ "data-wui-sidebar-button": true,
14911
+ ...props
14912
+ });
14913
+ });
14914
+ SidebarButton.displayName = "SidebarButton_UI";
14915
+ //#endregion
14916
+ //#region src/components/Sidebar/SidebarSearchInput.tsx
14917
+ const StyledSidebarSearchInputContainer = styled.div`
14918
+ padding-inline: var(--wui-space-01);
14919
+ `;
14920
+ const SidebarSearchInput = forwardRef(({ id, label = "Search navigation", ...props }, ref) => {
14921
+ const generatedId = useId();
14922
+ const inputId = id ?? generatedId;
14923
+ return /* @__PURE__ */ jsxs(StyledSidebarSearchInputContainer, { children: [/* @__PURE__ */ jsx(Label, {
14924
+ htmlFor: inputId,
14925
+ screenReaderOnly: true,
14926
+ children: label
14927
+ }), /* @__PURE__ */ jsx(Input, {
14928
+ ref,
14929
+ id: inputId,
14930
+ type: "search",
14931
+ ...props
14932
+ })] });
14933
+ });
14934
+ SidebarSearchInput.displayName = "SidebarSearchInput_UI";
14935
+ //#endregion
14041
14936
  //#region src/components/Slider/Slider.tsx
14042
14937
  const SliderContainer = styled.div`
14043
14938
  width: 100%;
@@ -14157,7 +15052,7 @@ const StyledSplitButton = styled.span`
14157
15052
  }
14158
15053
  `;
14159
15054
  /**
14160
- * A SplitButton is an extension of [Button]() that adds a menu to the right hand side of the button.
15055
+ * A SplitButton is an extension of [Button](/components/Button) that adds a menu to the right hand side of the button.
14161
15056
  */
14162
15057
  const SplitButton = ({ children, menuLabel = "Select an option", menuIcon = /* @__PURE__ */ jsx(Icon, { type: "caret-down" }), menuItems, disabled = false, colorScheme = "inherit", variant = "solid", secondaryAction, size = "md", unstyled = false, menuProps = {}, ...props }) => {
14163
15058
  return /* @__PURE__ */ jsxs(StyledSplitButton, {
@@ -15029,6 +15924,6 @@ const WistiaLogo = ({ description, height = 100, hoverColor, href, iconOnly = fa
15029
15924
  };
15030
15925
  WistiaLogo.displayName = "WistiaLogo_UI";
15031
15926
  //#endregion
15032
- export { ActionButton, Avatar, Badge, Banner, Box, Breadcrumb, Breadcrumbs, Button, ButtonGroup, Card, Center, Checkbox, CheckboxGroup, CheckboxMenuItem, ClickRegion, Collapsible, CollapsibleContent, CollapsibleTrigger, CollapsibleTriggerIcon, ColorGrid, ColorGridOption, ColorList, ColorListGroup, ColorListOption, ColorPicker, ColorPickerPopoverContent, ColorPickerSection, ColorPickerTrigger, ColorSchemeWrapper, Combobox, ComboboxOption, ContextMenu, ContrastControls, CustomizableThemeWrapper, DataCard, DataCardHoverArrow, DataCardTrend, DataCards, DataList, DataListItem, DataListItemLabel, DataListItemValue, Divider, EditableHeading, EditableText, EditableTextCancelButton, EditableTextContext, EditableTextDisplay, EditableTextInput, EditableTextLabel, EditableTextRoot, EditableTextSubmitButton, EditableTextTrigger, Ellipsis, FeatureCard, FeatureCardImage, FileAmountLimitValidator, FileSizeValidator, FileTypeValidator, FilterMenu, FilterMenuItem, Form, FormErrorSummary, FormField, FormGroup, Grid, Heading, HexColorInput, HueSlider, Icon, IconButton, Image, ImageDimensionsValidator, Input, InputClickToCopy, InputPassword, KeyboardShortcut, Label, Link, List, ListItem, Mark, Markdown, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Meter, Modal, ModalCallout, ModalCallouts, PersistentFileAmountLimitValidator, Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverCloseButton, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger, PreviewCard, ProgressBar, Radio, RadioCard, RadioCardImage, RadioGroup, RadioMenuItem, SaturationAndValuePicker, ScreenReaderOnly, ScrollArea, SegmentedControl, SegmentedControlItem, Select, SelectOption, SelectOptionGroup, Slider, SplitButton, Stack, SubMenu, Switch, Table, TableBody, TableCell, TableFoot, TableHead, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, Text, Thumbnail, ThumbnailBadge, ThumbnailCollage, Tooltip, UIProvider, ValueNameOrHexCode, ValueSwatch, WistiaLogo, buildTimeDuration, calculateContrast, coerceToBoolean, colorSchemeOptions, copyToClipboard, dateOnlyISOString, dateOnlyString, dateOnlyStringForSentence, dateOnlyStringNumeric, dateTime, dateTimeRounded, dateTimeString, dateTimeStringForSentence, dateTimeToDate, dateTimeToISO, dateToDateTime, dateUTCOffset, dayOfWeekString, iconSizeMap, isKeyboardKey, mediaDurationString, mergeRefs, millisecondsToDurationISOString, monthDayStringNumeric, mq, parseDateString, sessionDurationString, timeAgoString, timeOnlyString, useActiveMq, useAriaLive, useBoolean, useClipboard, useElementObserver, useFilePicker, useFocusTrap, useForceUpdate, useFormState, useImperativeFilePicker, useIsHovered, useKey, useKeyPress, useLocalStorage, useLockBodyScroll, useMq, useOnClickOutside, usePreviousValue, useToast, useWindowSize, validateWithYup };
15927
+ export { ActionButton, Avatar, Badge, Banner, Box, Breadcrumb, Breadcrumbs, Button, ButtonGroup, Card, Center, Checkbox, CheckboxGroup, CheckboxMenuItem, ClickRegion, Collapsible, CollapsibleContent, CollapsibleTrigger, CollapsibleTriggerIcon, ColorGrid, ColorGridOption, ColorList, ColorListGroup, ColorListOption, ColorPicker, ColorPickerPopoverContent, ColorPickerSection, ColorPickerTrigger, ColorSchemeWrapper, Combobox, ComboboxOption, ContextMenu, ContrastControls, CustomizableThemeWrapper, DataCard, DataCardHoverArrow, DataCardTrend, DataCards, DataList, DataListItem, DataListItemLabel, DataListItemValue, Divider, EditableHeading, EditableText, EditableTextCancelButton, EditableTextContext, EditableTextDisplay, EditableTextInput, EditableTextLabel, EditableTextRoot, EditableTextSubmitButton, EditableTextTrigger, Ellipsis, FeatureCard, FeatureCardImage, FileAmountLimitValidator, FileSizeValidator, FileTypeValidator, FilterMenu, FilterMenuItem, Form, FormErrorSummary, FormField, FormGroup, Grid, Heading, HexColorInput, HueSlider, Icon, IconButton, Image, ImageDimensionsValidator, Input, InputClickToCopy, InputDuration, InputPassword, KeyboardShortcut, Label, Link, List, ListItem, Mark, Markdown, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Meter, Modal, ModalCallout, ModalCallouts, PersistentFileAmountLimitValidator, Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverCloseButton, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger, PreviewCard, ProgressBar, Radio, RadioCard, RadioCardImage, RadioGroup, RadioMenuItem, SaturationAndValuePicker, ScreenReaderOnly, ScrollArea, SegmentedControl, SegmentedControlItem, Select, SelectOption, SelectOptionGroup, Sidebar, SidebarButton, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupLabel, SidebarHeader, SidebarSearchInput, SidebarTitle, Slider, SplitButton, Stack, SubMenu, Switch, Table, TableBody, TableCell, TableFoot, TableHead, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, Text, Thumbnail, ThumbnailBadge, ThumbnailCollage, Tooltip, UIProvider, ValueNameOrHexCode, ValueSwatch, WistiaLogo, buildTimeDuration, calculateContrast, coerceToBoolean, colorSchemeOptions, copyToClipboard, dateOnlyISOString, dateOnlyString, dateOnlyStringForSentence, dateOnlyStringNumeric, dateTime, dateTimeRounded, dateTimeString, dateTimeStringForSentence, dateTimeToDate, dateTimeToISO, dateToDateTime, dateUTCOffset, dayOfWeekString, iconSizeMap, isKeyboardKey, mediaDurationString, mergeRefs, millisecondsToDurationISOString, monthDayStringNumeric, mq, parseDateString, sessionDurationString, timeAgoString, timeOnlyString, useActiveMq, useAriaLive, useBoolean, useClipboard, useElementObserver, useFilePicker, useFocusTrap, useForceUpdate, useFormState, useImperativeFilePicker, useIsHovered, useKey, useKeyPress, useLocalStorage, useLockBodyScroll, useMq, useOnClickOutside, usePreviousValue, useToast, useWindowSize, validateWithYup };
15033
15928
 
15034
15929
  //# sourceMappingURL=index.js.map