@cambly/syntax-core 4.1.0 → 4.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.
package/dist/index.mjs CHANGED
@@ -141,7 +141,7 @@ var margin_module_default = { "marginBottom-12": "_marginBottom-12_1whn1_2", "ma
141
141
  var padding_module_default = { "paddingX0": "_paddingX0_1aqye_2", "paddingX1": "_paddingX1_1aqye_7", "paddingX2": "_paddingX2_1aqye_12", "paddingX3": "_paddingX3_1aqye_17", "paddingX4": "_paddingX4_1aqye_22", "paddingX5": "_paddingX5_1aqye_27", "paddingX6": "_paddingX6_1aqye_32", "paddingX7": "_paddingX7_1aqye_37", "paddingX8": "_paddingX8_1aqye_42", "paddingX9": "_paddingX9_1aqye_47", "paddingX10": "_paddingX10_1aqye_52", "paddingX11": "_paddingX11_1aqye_57", "paddingX12": "_paddingX12_1aqye_62", "paddingY0": "_paddingY0_1aqye_67", "paddingY1": "_paddingY1_1aqye_72", "paddingY2": "_paddingY2_1aqye_77", "paddingY3": "_paddingY3_1aqye_82", "paddingY4": "_paddingY4_1aqye_87", "paddingY5": "_paddingY5_1aqye_92", "paddingY6": "_paddingY6_1aqye_97", "paddingY7": "_paddingY7_1aqye_102", "paddingY8": "_paddingY8_1aqye_107", "paddingY9": "_paddingY9_1aqye_112", "paddingY10": "_paddingY10_1aqye_117", "paddingY11": "_paddingY11_1aqye_122", "paddingY12": "_paddingY12_1aqye_127", "paddingX0Small": "_paddingX0Small_1aqye_134", "paddingX1Small": "_paddingX1Small_1aqye_139", "paddingX2Small": "_paddingX2Small_1aqye_144", "paddingX3Small": "_paddingX3Small_1aqye_149", "paddingX4Small": "_paddingX4Small_1aqye_154", "paddingX5Small": "_paddingX5Small_1aqye_159", "paddingX6Small": "_paddingX6Small_1aqye_164", "paddingX7Small": "_paddingX7Small_1aqye_169", "paddingX8Small": "_paddingX8Small_1aqye_174", "paddingX9Small": "_paddingX9Small_1aqye_179", "paddingX10Small": "_paddingX10Small_1aqye_184", "paddingX11Small": "_paddingX11Small_1aqye_189", "paddingX12Small": "_paddingX12Small_1aqye_194", "paddingY0Small": "_paddingY0Small_1aqye_199", "paddingY1Small": "_paddingY1Small_1aqye_204", "paddingY2Small": "_paddingY2Small_1aqye_209", "paddingY3Small": "_paddingY3Small_1aqye_214", "paddingY4Small": "_paddingY4Small_1aqye_219", "paddingY5Small": "_paddingY5Small_1aqye_224", "paddingY6Small": "_paddingY6Small_1aqye_229", "paddingY7Small": "_paddingY7Small_1aqye_234", "paddingY8Small": "_paddingY8Small_1aqye_239", "paddingY9Small": "_paddingY9Small_1aqye_244", "paddingY10Small": "_paddingY10Small_1aqye_249", "paddingY11Small": "_paddingY11Small_1aqye_254", "paddingY12Small": "_paddingY12Small_1aqye_259", "paddingX0Large": "_paddingX0Large_1aqye_267", "paddingX1Large": "_paddingX1Large_1aqye_272", "paddingX2Large": "_paddingX2Large_1aqye_277", "paddingX3Large": "_paddingX3Large_1aqye_282", "paddingX4Large": "_paddingX4Large_1aqye_287", "paddingX5Large": "_paddingX5Large_1aqye_292", "paddingX6Large": "_paddingX6Large_1aqye_297", "paddingX7Large": "_paddingX7Large_1aqye_302", "paddingX8Large": "_paddingX8Large_1aqye_307", "paddingX9Large": "_paddingX9Large_1aqye_312", "paddingX10Large": "_paddingX10Large_1aqye_317", "paddingX11Large": "_paddingX11Large_1aqye_322", "paddingX12Large": "_paddingX12Large_1aqye_327", "paddingY0Large": "_paddingY0Large_1aqye_332", "paddingY1Large": "_paddingY1Large_1aqye_337", "paddingY2Large": "_paddingY2Large_1aqye_342", "paddingY3Large": "_paddingY3Large_1aqye_347", "paddingY4Large": "_paddingY4Large_1aqye_352", "paddingY5Large": "_paddingY5Large_1aqye_357", "paddingY6Large": "_paddingY6Large_1aqye_362", "paddingY7Large": "_paddingY7Large_1aqye_367", "paddingY8Large": "_paddingY8Large_1aqye_372", "paddingY9Large": "_paddingY9Large_1aqye_377", "paddingY10Large": "_paddingY10Large_1aqye_382", "paddingY11Large": "_paddingY11Large_1aqye_387", "paddingY12Large": "_paddingY12Large_1aqye_392" };
142
142
 
143
143
  // css-module:../colors/colors.module.css#css-module
144
- var colors_module_default = { "inheritColor": "_inheritColor_j1pwm_2", "destructive700Color": "_destructive700Color_j1pwm_6", "gray700Color": "_gray700Color_j1pwm_10", "gray900Color": "_gray900Color_j1pwm_14", "primary700Color": "_primary700Color_j1pwm_18", "whiteColor": "_whiteColor_j1pwm_22", "blackBackgroundColor": "_blackBackgroundColor_j1pwm_27", "destructive100BackgroundColor": "_destructive100BackgroundColor_j1pwm_31", "destructive200BackgroundColor": "_destructive200BackgroundColor_j1pwm_35", "destructive300BackgroundColor": "_destructive300BackgroundColor_j1pwm_39", "destructive700BackgroundColor": "_destructive700BackgroundColor_j1pwm_43", "destructive800BackgroundColor": "_destructive800BackgroundColor_j1pwm_47", "destructive900BackgroundColor": "_destructive900BackgroundColor_j1pwm_51", "gray10BackgroundColor": "_gray10BackgroundColor_j1pwm_55", "gray30BackgroundColor": "_gray30BackgroundColor_j1pwm_59", "gray80BackgroundColor": "_gray80BackgroundColor_j1pwm_63", "gray100BackgroundColor": "_gray100BackgroundColor_j1pwm_67", "gray200BackgroundColor": "_gray200BackgroundColor_j1pwm_71", "gray300BackgroundColor": "_gray300BackgroundColor_j1pwm_75", "gray700BackgroundColor": "_gray700BackgroundColor_j1pwm_79", "gray800BackgroundColor": "_gray800BackgroundColor_j1pwm_83", "gray900BackgroundColor": "_gray900BackgroundColor_j1pwm_87", "orange100BackgroundColor": "_orange100BackgroundColor_j1pwm_91", "orange200BackgroundColor": "_orange200BackgroundColor_j1pwm_95", "orange300BackgroundColor": "_orange300BackgroundColor_j1pwm_99", "orange700BackgroundColor": "_orange700BackgroundColor_j1pwm_103", "orange800BackgroundColor": "_orange800BackgroundColor_j1pwm_107", "orange900BackgroundColor": "_orange900BackgroundColor_j1pwm_111", "primary100BackgroundColor": "_primary100BackgroundColor_j1pwm_115", "primary200BackgroundColor": "_primary200BackgroundColor_j1pwm_119", "primary300BackgroundColor": "_primary300BackgroundColor_j1pwm_123", "primary700BackgroundColor": "_primary700BackgroundColor_j1pwm_127", "primary800BackgroundColor": "_primary800BackgroundColor_j1pwm_131", "primary900BackgroundColor": "_primary900BackgroundColor_j1pwm_135", "success100BackgroundColor": "_success100BackgroundColor_j1pwm_139", "success200BackgroundColor": "_success200BackgroundColor_j1pwm_143", "success300BackgroundColor": "_success300BackgroundColor_j1pwm_147", "success700BackgroundColor": "_success700BackgroundColor_j1pwm_151", "success800BackgroundColor": "_success800BackgroundColor_j1pwm_155", "success900BackgroundColor": "_success900BackgroundColor_j1pwm_159", "purple100BackgroundColor": "_purple100BackgroundColor_j1pwm_163", "purple200BackgroundColor": "_purple200BackgroundColor_j1pwm_167", "purple300BackgroundColor": "_purple300BackgroundColor_j1pwm_171", "purple700BackgroundColor": "_purple700BackgroundColor_j1pwm_175", "purple800BackgroundColor": "_purple800BackgroundColor_j1pwm_179", "purple900BackgroundColor": "_purple900BackgroundColor_j1pwm_183", "whiteBackgroundColor": "_whiteBackgroundColor_j1pwm_187", "yellow100BackgroundColor": "_yellow100BackgroundColor_j1pwm_191", "yellow200BackgroundColor": "_yellow200BackgroundColor_j1pwm_195", "yellow300BackgroundColor": "_yellow300BackgroundColor_j1pwm_199", "yellow700BackgroundColor": "_yellow700BackgroundColor_j1pwm_203", "yellow800BackgroundColor": "_yellow800BackgroundColor_j1pwm_207", "yellow900BackgroundColor": "_yellow900BackgroundColor_j1pwm_211" };
144
+ var colors_module_default = { "inheritColor": "_inheritColor_11wj3_2", "destructive700Color": "_destructive700Color_11wj3_6", "gray700Color": "_gray700Color_11wj3_10", "gray900Color": "_gray900Color_11wj3_14", "primary700Color": "_primary700Color_11wj3_18", "whiteColor": "_whiteColor_11wj3_22", "blackBackgroundColor": "_blackBackgroundColor_11wj3_27", "destructive100BackgroundColor": "_destructive100BackgroundColor_11wj3_31", "destructive200BackgroundColor": "_destructive200BackgroundColor_11wj3_35", "destructive300BackgroundColor": "_destructive300BackgroundColor_11wj3_39", "destructive700BackgroundColor": "_destructive700BackgroundColor_11wj3_43", "destructive800BackgroundColor": "_destructive800BackgroundColor_11wj3_47", "destructive900BackgroundColor": "_destructive900BackgroundColor_11wj3_51", "gray10BackgroundColor": "_gray10BackgroundColor_11wj3_55", "gray30BackgroundColor": "_gray30BackgroundColor_11wj3_59", "gray60BackgroundColor": "_gray60BackgroundColor_11wj3_63", "gray80BackgroundColor": "_gray80BackgroundColor_11wj3_67", "gray100BackgroundColor": "_gray100BackgroundColor_11wj3_71", "gray200BackgroundColor": "_gray200BackgroundColor_11wj3_75", "gray300BackgroundColor": "_gray300BackgroundColor_11wj3_79", "gray700BackgroundColor": "_gray700BackgroundColor_11wj3_83", "gray800BackgroundColor": "_gray800BackgroundColor_11wj3_87", "gray900BackgroundColor": "_gray900BackgroundColor_11wj3_91", "orange100BackgroundColor": "_orange100BackgroundColor_11wj3_95", "orange200BackgroundColor": "_orange200BackgroundColor_11wj3_99", "orange300BackgroundColor": "_orange300BackgroundColor_11wj3_103", "orange700BackgroundColor": "_orange700BackgroundColor_11wj3_107", "orange800BackgroundColor": "_orange800BackgroundColor_11wj3_111", "orange900BackgroundColor": "_orange900BackgroundColor_11wj3_115", "primary100BackgroundColor": "_primary100BackgroundColor_11wj3_119", "primary200BackgroundColor": "_primary200BackgroundColor_11wj3_123", "primary300BackgroundColor": "_primary300BackgroundColor_11wj3_127", "primary700BackgroundColor": "_primary700BackgroundColor_11wj3_131", "primary800BackgroundColor": "_primary800BackgroundColor_11wj3_135", "primary900BackgroundColor": "_primary900BackgroundColor_11wj3_139", "success100BackgroundColor": "_success100BackgroundColor_11wj3_143", "success200BackgroundColor": "_success200BackgroundColor_11wj3_147", "success300BackgroundColor": "_success300BackgroundColor_11wj3_151", "success700BackgroundColor": "_success700BackgroundColor_11wj3_155", "success800BackgroundColor": "_success800BackgroundColor_11wj3_159", "success900BackgroundColor": "_success900BackgroundColor_11wj3_163", "purple100BackgroundColor": "_purple100BackgroundColor_11wj3_167", "purple200BackgroundColor": "_purple200BackgroundColor_11wj3_171", "purple300BackgroundColor": "_purple300BackgroundColor_11wj3_175", "purple700BackgroundColor": "_purple700BackgroundColor_11wj3_179", "purple800BackgroundColor": "_purple800BackgroundColor_11wj3_183", "purple900BackgroundColor": "_purple900BackgroundColor_11wj3_187", "whiteBackgroundColor": "_whiteBackgroundColor_11wj3_191", "yellow100BackgroundColor": "_yellow100BackgroundColor_11wj3_195", "yellow200BackgroundColor": "_yellow200BackgroundColor_11wj3_199", "yellow300BackgroundColor": "_yellow300BackgroundColor_11wj3_203", "yellow700BackgroundColor": "_yellow700BackgroundColor_11wj3_207", "yellow800BackgroundColor": "_yellow800BackgroundColor_11wj3_211", "yellow900BackgroundColor": "_yellow900BackgroundColor_11wj3_215" };
145
145
 
146
146
  // src/Box/Box.tsx
147
147
  import { jsx as jsx2 } from "react/jsx-runtime";
@@ -336,7 +336,7 @@ function Box(props) {
336
336
  var import_classnames3 = __toESM(require_classnames());
337
337
 
338
338
  // css-module:./colors.module.css#css-module
339
- var colors_module_default2 = { "inheritColor": "_inheritColor_j1pwm_2", "destructive700Color": "_destructive700Color_j1pwm_6", "gray700Color": "_gray700Color_j1pwm_10", "gray900Color": "_gray900Color_j1pwm_14", "primary700Color": "_primary700Color_j1pwm_18", "whiteColor": "_whiteColor_j1pwm_22", "blackBackgroundColor": "_blackBackgroundColor_j1pwm_27", "destructive100BackgroundColor": "_destructive100BackgroundColor_j1pwm_31", "destructive200BackgroundColor": "_destructive200BackgroundColor_j1pwm_35", "destructive300BackgroundColor": "_destructive300BackgroundColor_j1pwm_39", "destructive700BackgroundColor": "_destructive700BackgroundColor_j1pwm_43", "destructive800BackgroundColor": "_destructive800BackgroundColor_j1pwm_47", "destructive900BackgroundColor": "_destructive900BackgroundColor_j1pwm_51", "gray10BackgroundColor": "_gray10BackgroundColor_j1pwm_55", "gray30BackgroundColor": "_gray30BackgroundColor_j1pwm_59", "gray80BackgroundColor": "_gray80BackgroundColor_j1pwm_63", "gray100BackgroundColor": "_gray100BackgroundColor_j1pwm_67", "gray200BackgroundColor": "_gray200BackgroundColor_j1pwm_71", "gray300BackgroundColor": "_gray300BackgroundColor_j1pwm_75", "gray700BackgroundColor": "_gray700BackgroundColor_j1pwm_79", "gray800BackgroundColor": "_gray800BackgroundColor_j1pwm_83", "gray900BackgroundColor": "_gray900BackgroundColor_j1pwm_87", "orange100BackgroundColor": "_orange100BackgroundColor_j1pwm_91", "orange200BackgroundColor": "_orange200BackgroundColor_j1pwm_95", "orange300BackgroundColor": "_orange300BackgroundColor_j1pwm_99", "orange700BackgroundColor": "_orange700BackgroundColor_j1pwm_103", "orange800BackgroundColor": "_orange800BackgroundColor_j1pwm_107", "orange900BackgroundColor": "_orange900BackgroundColor_j1pwm_111", "primary100BackgroundColor": "_primary100BackgroundColor_j1pwm_115", "primary200BackgroundColor": "_primary200BackgroundColor_j1pwm_119", "primary300BackgroundColor": "_primary300BackgroundColor_j1pwm_123", "primary700BackgroundColor": "_primary700BackgroundColor_j1pwm_127", "primary800BackgroundColor": "_primary800BackgroundColor_j1pwm_131", "primary900BackgroundColor": "_primary900BackgroundColor_j1pwm_135", "success100BackgroundColor": "_success100BackgroundColor_j1pwm_139", "success200BackgroundColor": "_success200BackgroundColor_j1pwm_143", "success300BackgroundColor": "_success300BackgroundColor_j1pwm_147", "success700BackgroundColor": "_success700BackgroundColor_j1pwm_151", "success800BackgroundColor": "_success800BackgroundColor_j1pwm_155", "success900BackgroundColor": "_success900BackgroundColor_j1pwm_159", "purple100BackgroundColor": "_purple100BackgroundColor_j1pwm_163", "purple200BackgroundColor": "_purple200BackgroundColor_j1pwm_167", "purple300BackgroundColor": "_purple300BackgroundColor_j1pwm_171", "purple700BackgroundColor": "_purple700BackgroundColor_j1pwm_175", "purple800BackgroundColor": "_purple800BackgroundColor_j1pwm_179", "purple900BackgroundColor": "_purple900BackgroundColor_j1pwm_183", "whiteBackgroundColor": "_whiteBackgroundColor_j1pwm_187", "yellow100BackgroundColor": "_yellow100BackgroundColor_j1pwm_191", "yellow200BackgroundColor": "_yellow200BackgroundColor_j1pwm_195", "yellow300BackgroundColor": "_yellow300BackgroundColor_j1pwm_199", "yellow700BackgroundColor": "_yellow700BackgroundColor_j1pwm_203", "yellow800BackgroundColor": "_yellow800BackgroundColor_j1pwm_207", "yellow900BackgroundColor": "_yellow900BackgroundColor_j1pwm_211" };
339
+ var colors_module_default2 = { "inheritColor": "_inheritColor_11wj3_2", "destructive700Color": "_destructive700Color_11wj3_6", "gray700Color": "_gray700Color_11wj3_10", "gray900Color": "_gray900Color_11wj3_14", "primary700Color": "_primary700Color_11wj3_18", "whiteColor": "_whiteColor_11wj3_22", "blackBackgroundColor": "_blackBackgroundColor_11wj3_27", "destructive100BackgroundColor": "_destructive100BackgroundColor_11wj3_31", "destructive200BackgroundColor": "_destructive200BackgroundColor_11wj3_35", "destructive300BackgroundColor": "_destructive300BackgroundColor_11wj3_39", "destructive700BackgroundColor": "_destructive700BackgroundColor_11wj3_43", "destructive800BackgroundColor": "_destructive800BackgroundColor_11wj3_47", "destructive900BackgroundColor": "_destructive900BackgroundColor_11wj3_51", "gray10BackgroundColor": "_gray10BackgroundColor_11wj3_55", "gray30BackgroundColor": "_gray30BackgroundColor_11wj3_59", "gray60BackgroundColor": "_gray60BackgroundColor_11wj3_63", "gray80BackgroundColor": "_gray80BackgroundColor_11wj3_67", "gray100BackgroundColor": "_gray100BackgroundColor_11wj3_71", "gray200BackgroundColor": "_gray200BackgroundColor_11wj3_75", "gray300BackgroundColor": "_gray300BackgroundColor_11wj3_79", "gray700BackgroundColor": "_gray700BackgroundColor_11wj3_83", "gray800BackgroundColor": "_gray800BackgroundColor_11wj3_87", "gray900BackgroundColor": "_gray900BackgroundColor_11wj3_91", "orange100BackgroundColor": "_orange100BackgroundColor_11wj3_95", "orange200BackgroundColor": "_orange200BackgroundColor_11wj3_99", "orange300BackgroundColor": "_orange300BackgroundColor_11wj3_103", "orange700BackgroundColor": "_orange700BackgroundColor_11wj3_107", "orange800BackgroundColor": "_orange800BackgroundColor_11wj3_111", "orange900BackgroundColor": "_orange900BackgroundColor_11wj3_115", "primary100BackgroundColor": "_primary100BackgroundColor_11wj3_119", "primary200BackgroundColor": "_primary200BackgroundColor_11wj3_123", "primary300BackgroundColor": "_primary300BackgroundColor_11wj3_127", "primary700BackgroundColor": "_primary700BackgroundColor_11wj3_131", "primary800BackgroundColor": "_primary800BackgroundColor_11wj3_135", "primary900BackgroundColor": "_primary900BackgroundColor_11wj3_139", "success100BackgroundColor": "_success100BackgroundColor_11wj3_143", "success200BackgroundColor": "_success200BackgroundColor_11wj3_147", "success300BackgroundColor": "_success300BackgroundColor_11wj3_151", "success700BackgroundColor": "_success700BackgroundColor_11wj3_155", "success800BackgroundColor": "_success800BackgroundColor_11wj3_159", "success900BackgroundColor": "_success900BackgroundColor_11wj3_163", "purple100BackgroundColor": "_purple100BackgroundColor_11wj3_167", "purple200BackgroundColor": "_purple200BackgroundColor_11wj3_171", "purple300BackgroundColor": "_purple300BackgroundColor_11wj3_175", "purple700BackgroundColor": "_purple700BackgroundColor_11wj3_179", "purple800BackgroundColor": "_purple800BackgroundColor_11wj3_183", "purple900BackgroundColor": "_purple900BackgroundColor_11wj3_187", "whiteBackgroundColor": "_whiteBackgroundColor_11wj3_191", "yellow100BackgroundColor": "_yellow100BackgroundColor_11wj3_195", "yellow200BackgroundColor": "_yellow200BackgroundColor_11wj3_199", "yellow300BackgroundColor": "_yellow300BackgroundColor_11wj3_203", "yellow700BackgroundColor": "_yellow700BackgroundColor_11wj3_207", "yellow800BackgroundColor": "_yellow800BackgroundColor_11wj3_211", "yellow900BackgroundColor": "_yellow900BackgroundColor_11wj3_215" };
340
340
 
341
341
  // src/colors/backgroundColor.ts
342
342
  function backgroundColor(color) {
@@ -619,10 +619,97 @@ var IconButton_default = IconButton;
619
619
 
620
620
  // src/Checkbox/Checkbox.tsx
621
621
  var import_classnames7 = __toESM(require_classnames());
622
- import { useState } from "react";
622
+ import { useState as useState2 } from "react";
623
+
624
+ // src/useFocusVisible.tsx
625
+ import { useState, useEffect } from "react";
626
+ var hasSetupGlobalListeners = false;
627
+ var currentModality = null;
628
+ var changeHandlers = /* @__PURE__ */ new Set();
629
+ var hasEventBeforeFocus = false;
630
+ var isMac = typeof window !== "undefined" && window.navigator != null ? /^Mac/.test(window.navigator.platform) : false;
631
+ function isValidKey(e) {
632
+ return !(e.metaKey || !isMac && e.altKey || e.ctrlKey);
633
+ }
634
+ function triggerChangeHandlers(modality, e) {
635
+ changeHandlers.forEach((handler) => {
636
+ handler(modality, e);
637
+ });
638
+ }
639
+ function handleKeyboardEvent(e) {
640
+ hasEventBeforeFocus = true;
641
+ if (isValidKey(e)) {
642
+ currentModality = "keyboard";
643
+ triggerChangeHandlers("keyboard", e);
644
+ }
645
+ }
646
+ function handlePointerEvent(e) {
647
+ currentModality = "pointer";
648
+ if (e.type === "mousedown" || e.type === "pointerdown") {
649
+ hasEventBeforeFocus = true;
650
+ triggerChangeHandlers("pointer", e);
651
+ }
652
+ }
653
+ function handleFocusEvent(e) {
654
+ if (e.target === window || e.target === document) {
655
+ return;
656
+ }
657
+ if (!hasEventBeforeFocus) {
658
+ currentModality = "keyboard";
659
+ triggerChangeHandlers("keyboard", e);
660
+ }
661
+ hasEventBeforeFocus = false;
662
+ }
663
+ function handleWindowBlur() {
664
+ hasEventBeforeFocus = false;
665
+ }
666
+ function isFocusVisible() {
667
+ return currentModality !== "pointer";
668
+ }
669
+ function setupGlobalFocusEvents() {
670
+ if (typeof window === "undefined" || hasSetupGlobalListeners) {
671
+ return;
672
+ }
673
+ const { focus } = HTMLElement.prototype;
674
+ HTMLElement.prototype.focus = function focusElement(...args) {
675
+ hasEventBeforeFocus = true;
676
+ focus.apply(this, args);
677
+ };
678
+ document.addEventListener("keydown", handleKeyboardEvent, true);
679
+ document.addEventListener("keyup", handleKeyboardEvent, true);
680
+ window.addEventListener("focus", handleFocusEvent, true);
681
+ window.addEventListener("blur", handleWindowBlur, false);
682
+ if (typeof PointerEvent !== "undefined") {
683
+ document.addEventListener("pointerdown", handlePointerEvent, true);
684
+ document.addEventListener("pointermove", handlePointerEvent, true);
685
+ document.addEventListener("pointerup", handlePointerEvent, true);
686
+ } else {
687
+ document.addEventListener("mousedown", handlePointerEvent, true);
688
+ document.addEventListener("mousemove", handlePointerEvent, true);
689
+ document.addEventListener("mouseup", handlePointerEvent, true);
690
+ }
691
+ hasSetupGlobalListeners = true;
692
+ }
693
+ function useFocusVisible() {
694
+ setupGlobalFocusEvents();
695
+ const [isFocusVisibleState, setFocusVisible] = useState(isFocusVisible());
696
+ useEffect(() => {
697
+ const handler = () => {
698
+ setFocusVisible(isFocusVisible());
699
+ };
700
+ changeHandlers.add(handler);
701
+ return () => {
702
+ changeHandlers.delete(handler);
703
+ };
704
+ }, []);
705
+ return { isFocusVisible: isFocusVisibleState };
706
+ }
623
707
 
624
708
  // css-module:./Checkbox.module.css#css-module
625
- var Checkbox_module_default = { "mainContainer": "_mainContainer_p0un4_1", "checkboxContainer": "_checkboxContainer_p0un4_8", "inputOverlay": "_inputOverlay_p0un4_13", "focusedCheckbox": "_focusedCheckbox_p0un4_21", "checkbox": "_checkbox_p0un4_8", "uncheckedBox": "_uncheckedBox_p0un4_35", "uncheckedBorder": "_uncheckedBorder_p0un4_39", "uncheckedErrorBorder": "_uncheckedErrorBorder_p0un4_43", "checkedBox": "_checkedBox_p0un4_47", "checkedNonError": "_checkedNonError_p0un4_51", "checkedError": "_checkedError_p0un4_55", "sm": "_sm_p0un4_59", "md": "_md_p0un4_65" };
709
+ var Checkbox_module_default = { "mainContainer": "_mainContainer_1jq7b_1", "checkboxContainer": "_checkboxContainer_1jq7b_8", "inputOverlay": "_inputOverlay_1jq7b_13", "checkbox": "_checkbox_1jq7b_8", "uncheckedBox": "_uncheckedBox_1jq7b_30", "uncheckedBorder": "_uncheckedBorder_1jq7b_34", "uncheckedErrorBorder": "_uncheckedErrorBorder_1jq7b_38", "checkedBox": "_checkedBox_1jq7b_42", "checkedNonError": "_checkedNonError_1jq7b_46", "checkedError": "_checkedError_1jq7b_50", "sm": "_sm_1jq7b_54", "md": "_md_1jq7b_60" };
710
+
711
+ // css-module:../Focus.module.css#css-module
712
+ var Focus_module_default = { "accessibilityOutlineFocus": "_accessibilityOutlineFocus_1h8bq_1" };
626
713
 
627
714
  // src/Checkbox/Checkbox.tsx
628
715
  import { jsx as jsx10, jsxs as jsxs2 } from "react/jsx-runtime";
@@ -642,17 +729,18 @@ var Checkbox = ({
642
729
  error = false,
643
730
  onChange
644
731
  }) => {
645
- const [isFocused, setIsFocused] = useState(false);
732
+ const [isFocused, setIsFocused] = useState2(false);
733
+ const { isFocusVisible: isFocusVisible2 } = useFocusVisible();
646
734
  const checkboxStyling = (0, import_classnames7.default)(Checkbox_module_default.checkbox, Checkbox_module_default[size]);
647
735
  const uncheckedStyling = (0, import_classnames7.default)(checkboxStyling, Checkbox_module_default.uncheckedBox, {
648
736
  [Checkbox_module_default.uncheckedBorder]: !error,
649
737
  [Checkbox_module_default.uncheckedErrorBorder]: error,
650
- [Checkbox_module_default.focusedCheckbox]: isFocused
738
+ [Focus_module_default.accessibilityOutlineFocus]: isFocused && isFocusVisible2
651
739
  });
652
740
  const checkedStyling = (0, import_classnames7.default)(checkboxStyling, Checkbox_module_default.checkedBox, {
653
741
  [Checkbox_module_default.checkedNonError]: !error,
654
742
  [Checkbox_module_default.checkedError]: error,
655
- [Checkbox_module_default.focusedCheckbox]: isFocused
743
+ [Focus_module_default.accessibilityOutlineFocus]: isFocused && isFocusVisible2
656
744
  });
657
745
  return /* @__PURE__ */ jsxs2("label", { className: (0, import_classnames7.default)(Checkbox_module_default.mainContainer), children: [
658
746
  /* @__PURE__ */ jsxs2("div", { className: Checkbox_module_default.checkboxContainer, children: [
@@ -707,91 +795,7 @@ var import_classnames8 = __toESM(require_classnames());
707
795
  import { useState as useState3 } from "react";
708
796
 
709
797
  // css-module:./RadioButton.module.css#css-module
710
- var RadioButton_module_default = { "radioBaseContainer": "_radioBaseContainer_x6och_1", "smBase": "_smBase_x6och_8", "mdBase": "_mdBase_x6och_13", "radioStyleOverride": "_radioStyleOverride_x6och_18", "smOverride": "_smOverride_x6och_23", "mdOverride": "_mdOverride_x6och_28", "background": "_background_x6och_33", "sm": "_sm_x6och_8", "md": "_md_x6och_13", "neutralBorder": "_neutralBorder_x6och_50", "smCheckedBorder": "_smCheckedBorder_x6och_54", "mdCheckedBorder": "_mdCheckedBorder_x6och_58", "errorBorderColor": "_errorBorderColor_x6och_62", "borderColor": "_borderColor_x6och_66", "focusedRadioButton": "_focusedRadioButton_x6och_70" };
711
-
712
- // src/useFocusVisible.tsx
713
- import { useState as useState2, useEffect } from "react";
714
- var hasSetupGlobalListeners = false;
715
- var currentModality = null;
716
- var changeHandlers = /* @__PURE__ */ new Set();
717
- var hasEventBeforeFocus = false;
718
- var isMac = typeof window !== "undefined" && window.navigator != null ? /^Mac/.test(window.navigator.platform) : false;
719
- function isValidKey(e) {
720
- return !(e.metaKey || !isMac && e.altKey || e.ctrlKey);
721
- }
722
- function triggerChangeHandlers(modality, e) {
723
- changeHandlers.forEach((handler) => {
724
- handler(modality, e);
725
- });
726
- }
727
- function handleKeyboardEvent(e) {
728
- hasEventBeforeFocus = true;
729
- if (isValidKey(e)) {
730
- currentModality = "keyboard";
731
- triggerChangeHandlers("keyboard", e);
732
- }
733
- }
734
- function handlePointerEvent(e) {
735
- currentModality = "pointer";
736
- if (e.type === "mousedown" || e.type === "pointerdown") {
737
- hasEventBeforeFocus = true;
738
- triggerChangeHandlers("pointer", e);
739
- }
740
- }
741
- function handleFocusEvent(e) {
742
- if (e.target === window || e.target === document) {
743
- return;
744
- }
745
- if (!hasEventBeforeFocus) {
746
- currentModality = "keyboard";
747
- triggerChangeHandlers("keyboard", e);
748
- }
749
- hasEventBeforeFocus = false;
750
- }
751
- function handleWindowBlur() {
752
- hasEventBeforeFocus = false;
753
- }
754
- function isFocusVisible() {
755
- return currentModality !== "pointer";
756
- }
757
- function setupGlobalFocusEvents() {
758
- if (typeof window === "undefined" || hasSetupGlobalListeners) {
759
- return;
760
- }
761
- const { focus } = HTMLElement.prototype;
762
- HTMLElement.prototype.focus = function focusElement(...args) {
763
- hasEventBeforeFocus = true;
764
- focus.apply(this, args);
765
- };
766
- document.addEventListener("keydown", handleKeyboardEvent, true);
767
- document.addEventListener("keyup", handleKeyboardEvent, true);
768
- window.addEventListener("focus", handleFocusEvent, true);
769
- window.addEventListener("blur", handleWindowBlur, false);
770
- if (typeof PointerEvent !== "undefined") {
771
- document.addEventListener("pointerdown", handlePointerEvent, true);
772
- document.addEventListener("pointermove", handlePointerEvent, true);
773
- document.addEventListener("pointerup", handlePointerEvent, true);
774
- } else {
775
- document.addEventListener("mousedown", handlePointerEvent, true);
776
- document.addEventListener("mousemove", handlePointerEvent, true);
777
- document.addEventListener("mouseup", handlePointerEvent, true);
778
- }
779
- hasSetupGlobalListeners = true;
780
- }
781
- function useFocusVisible() {
782
- setupGlobalFocusEvents();
783
- const [isFocusVisibleState, setFocusVisible] = useState2(isFocusVisible());
784
- useEffect(() => {
785
- const handler = () => {
786
- setFocusVisible(isFocusVisible());
787
- };
788
- changeHandlers.add(handler);
789
- return () => {
790
- changeHandlers.delete(handler);
791
- };
792
- }, []);
793
- return { isFocusVisible: isFocusVisibleState };
794
- }
798
+ var RadioButton_module_default = { "radioBaseContainer": "_radioBaseContainer_144ms_1", "smBase": "_smBase_144ms_8", "mdBase": "_mdBase_144ms_13", "radioStyleOverride": "_radioStyleOverride_144ms_18", "smOverride": "_smOverride_144ms_23", "mdOverride": "_mdOverride_144ms_28", "background": "_background_144ms_33", "sm": "_sm_144ms_8", "md": "_md_144ms_13", "neutralBorder": "_neutralBorder_144ms_50", "smCheckedBorder": "_smCheckedBorder_144ms_54", "mdCheckedBorder": "_mdCheckedBorder_144ms_58", "errorBorderColor": "_errorBorderColor_144ms_62", "borderColor": "_borderColor_144ms_66" };
795
799
 
796
800
  // src/RadioButton/RadioButton.tsx
797
801
  import { jsx as jsx12, jsxs as jsxs3 } from "react/jsx-runtime";
@@ -810,7 +814,7 @@ var RadioButton = ({
810
814
  const sharedStyles = (0, import_classnames8.default)(RadioButton_module_default.background, RadioButton_module_default[size], {
811
815
  [RadioButton_module_default.errorBorderColor]: error,
812
816
  [RadioButton_module_default.borderColor]: !error,
813
- [RadioButton_module_default.focusedRadioButton]: isFocused && isFocusVisible2
817
+ [Focus_module_default.accessibilityOutlineFocus]: isFocused && isFocusVisible2
814
818
  });
815
819
  return /* @__PURE__ */ jsxs3(
816
820
  "label",
@@ -866,14 +870,14 @@ var RadioButton_default = RadioButton;
866
870
 
867
871
  // src/SelectList/SelectList.tsx
868
872
  var import_classnames9 = __toESM(require_classnames());
869
- import { useId } from "react";
873
+ import { useId, useState as useState4 } from "react";
870
874
 
871
875
  // ../syntax-design-tokens/dist/js/index.js
872
876
  var ColorBaseDestructive700 = "#d32a4b";
873
877
  var ColorBaseGray800 = "#353535";
874
878
 
875
879
  // css-module:./SelectList.module.css#css-module
876
- var SelectList_module_default = { "selectContainer": "_selectContainer_1y5p4_1", "opacityOverlay": "_opacityOverlay_1y5p4_7", "outerTextContainer": "_outerTextContainer_1y5p4_11", "selectWrapper": "_selectWrapper_1y5p4_16", "selectBox": "_selectBox_1y5p4_21", "unselected": "_unselected_1y5p4_40", "selected": "_selected_1y5p4_44", "arrowIcon": "_arrowIcon_1y5p4_48", "sm": "_sm_1y5p4_62", "md": "_md_1y5p4_67", "lg": "_lg_1y5p4_72", "selectError": "_selectError_1y5p4_77" };
880
+ var SelectList_module_default = { "selectContainer": "_selectContainer_1e7f9_1", "opacityOverlay": "_opacityOverlay_1e7f9_7", "outerTextContainer": "_outerTextContainer_1e7f9_11", "selectWrapper": "_selectWrapper_1e7f9_16", "selectBox": "_selectBox_1e7f9_21", "seletBoxMouseFocusStyling": "_seletBoxMouseFocusStyling_1e7f9_35", "unselected": "_unselected_1e7f9_40", "selected": "_selected_1e7f9_44", "arrowIcon": "_arrowIcon_1e7f9_48", "sm": "_sm_1e7f9_62", "md": "_md_1e7f9_67", "lg": "_lg_1e7f9_72", "selectError": "_selectError_1e7f9_77" };
877
881
 
878
882
  // src/SelectList/SelectOption.tsx
879
883
  import { jsx as jsx13 } from "react/jsx-runtime";
@@ -911,6 +915,8 @@ var SelectList = ({
911
915
  size = "md"
912
916
  }) => {
913
917
  const id = useId();
918
+ const { isFocusVisible: isFocusVisible2 } = useFocusVisible();
919
+ const [isFocused, setIsFocused] = useState4(false);
914
920
  return /* @__PURE__ */ jsxs4(
915
921
  "div",
916
922
  {
@@ -929,10 +935,16 @@ var SelectList = ({
929
935
  className: (0, import_classnames9.default)(SelectList_module_default.selectBox, SelectList_module_default[size], {
930
936
  [SelectList_module_default.unselected]: !selectedValue && !errorText,
931
937
  [SelectList_module_default.selected]: selectedValue && !errorText,
932
- [SelectList_module_default.selectError]: errorText
938
+ [SelectList_module_default.selectError]: errorText,
939
+ [Focus_module_default.accessibilityOutlineFocus]: isFocused && isFocusVisible2,
940
+ // for focus keyboard
941
+ [SelectList_module_default.seletBoxMouseFocusStyling]: isFocused && !isFocusVisible2
942
+ // for focus mouse
933
943
  }),
934
944
  onChange,
935
945
  value: placeholderText && !selectedValue ? placeholderText : selectedValue,
946
+ onFocus: () => setIsFocused(true),
947
+ onBlur: () => setIsFocused(false),
936
948
  children: [
937
949
  placeholderText && /* @__PURE__ */ jsx14("option", { disabled: true, value: placeholderText, children: placeholderText }),
938
950
  children