@exem-ui/react 0.3.4-next.20260727012122 → 0.3.4-next.20260728024650

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
@@ -1,5 +1,5 @@
1
- import { ConditionalTooltip, overlayListVariants, commonInputVariants, ScrollArea } from './chunk-NZR3A6CI.mjs';
2
- export { ColorPalette, ColorPaletteColors, DEFAULT_COLOR, ScrollArea, ScrollBar, Segment, Select, Tabs, Tooltip, colorPaletteColorClasses, getColorPaletteColor, isInPalette } from './chunk-NZR3A6CI.mjs';
1
+ import { ConditionalTooltip, overlayListVariants, commonInputVariants, textFieldVariants, ScrollArea } from './chunk-G65KBUWQ.mjs';
2
+ export { ColorPalette, ColorPaletteColors, Combobox, ComboboxContent, ComboboxDescription, ComboboxEmpty, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSearch, ComboboxTrigger, ComboboxValue, DEFAULT_COLOR, ScrollArea, ScrollBar, Segment, Select, Tabs, Tooltip, colorPaletteColorClasses, getColorPaletteColor, isInPalette } from './chunk-G65KBUWQ.mjs';
3
3
  import { X, MoreHorizontal, iconSizes, Minus, Check, Person, Warning, Info, Error as Error$1, ChevronLeft, ChevronRight } from './chunk-GWP7YKJP.mjs';
4
4
  import { cva, cn } from '@exem-ui/core/utils';
5
5
  import * as React from 'react';
@@ -1347,118 +1347,6 @@ var useTextFieldContext = () => {
1347
1347
  }
1348
1348
  return context;
1349
1349
  };
1350
- var textFieldVariants = {
1351
- container: commonInputVariants.container,
1352
- label: commonInputVariants.label,
1353
- wrapper: cva(
1354
- "flex w-full flex-row items-center rounded-medium border transition-colors focus-within:border-border-focused focus-within:outline-none",
1355
- {
1356
- variants: {
1357
- variant: {
1358
- fill: "border-transparent bg-elevation-elevation-2",
1359
- line: "border-border-primary",
1360
- lineBackground: "border-border-primary bg-background-primary"
1361
- },
1362
- size: {
1363
- xsmall: "h-6 gap-0 px-1",
1364
- small: "h-7 gap-0.5 px-1.5",
1365
- medium: "h-8 gap-0.5 px-2",
1366
- large: "h-10 gap-1 px-2.5"
1367
- },
1368
- state: {
1369
- default: "text-text-primary",
1370
- error: "text-text-primary",
1371
- disabled: "cursor-not-allowed text-text-disabled"
1372
- }
1373
- },
1374
- compoundVariants: [
1375
- { variant: "fill", state: "error", class: "border-border-critical" },
1376
- {
1377
- variant: "fill",
1378
- state: "disabled",
1379
- class: "bg-elevation-elevation-2 border-transparent"
1380
- },
1381
- { variant: "line", state: "error", class: "border-border-critical" },
1382
- { variant: "line", state: "disabled", class: "border-border-primary" },
1383
- { variant: "lineBackground", state: "error", class: "border-border-critical" },
1384
- { variant: "lineBackground", state: "disabled", class: "border-border-primary" }
1385
- ],
1386
- defaultVariants: { variant: "fill", size: "medium", state: "default" }
1387
- }
1388
- ),
1389
- input: cva(
1390
- "w-full border-none bg-transparent p-0 focus:outline-none focus:ring-0 disabled:cursor-not-allowed",
1391
- {
1392
- variants: {
1393
- size: {
1394
- xsmall: "text-body-3 placeholder:text-body-3",
1395
- small: "text-body-2 placeholder:text-body-2",
1396
- medium: "text-body-2 placeholder:text-body-2",
1397
- large: "text-body-1 placeholder:text-body-1"
1398
- },
1399
- state: {
1400
- default: "text-text-primary placeholder:text-text-tertiary",
1401
- error: "text-text-primary placeholder:text-text-tertiary",
1402
- disabled: "text-text-disabled placeholder:text-text-disabled"
1403
- }
1404
- },
1405
- defaultVariants: { size: "medium", state: "default" }
1406
- }
1407
- ),
1408
- description: cva("mt-0.5 font-regular text-text-tertiary", {
1409
- variants: {
1410
- size: {
1411
- xsmall: "text-caption",
1412
- small: "text-body-3",
1413
- medium: "text-body-3",
1414
- large: "text-body-2"
1415
- },
1416
- error: {
1417
- true: "text-text-critical",
1418
- false: ""
1419
- },
1420
- disabled: {
1421
- true: "text-text-disabled",
1422
- false: ""
1423
- }
1424
- },
1425
- compoundVariants: [
1426
- {
1427
- disabled: true,
1428
- error: true,
1429
- class: "text-text-disabled"
1430
- // disabled가 error보다 우선
1431
- }
1432
- ],
1433
- defaultVariants: { size: "medium", error: false, disabled: false }
1434
- }),
1435
- subText: cva("ml-1 shrink-0 font-regular", {
1436
- variants: {
1437
- size: {
1438
- xsmall: "text-body-3",
1439
- small: "text-body-2",
1440
- medium: "text-body-2",
1441
- large: "text-body-1"
1442
- },
1443
- disabled: {
1444
- true: "text-text-disabled",
1445
- false: "text-text-tertiary"
1446
- }
1447
- },
1448
- defaultVariants: { size: "medium", disabled: false }
1449
- }),
1450
- icon: cva("shrink-0 text-icon-tertiary", {
1451
- variants: {
1452
- size: {
1453
- xsmall: "size-4",
1454
- small: "size-4",
1455
- medium: "size-4",
1456
- large: "size-5"
1457
- }
1458
- },
1459
- defaultVariants: { size: "medium" }
1460
- })
1461
- };
1462
1350
  var TextField = forwardRef(
1463
1351
  ({
1464
1352
  children,
@@ -1556,6 +1444,44 @@ TextField.displayName = "TextField";
1556
1444
  TextField.Label.displayName = "TextField.Label";
1557
1445
  TextField.Input.displayName = "TextField.Input";
1558
1446
  TextField.Description.displayName = "TextField.Description";
1447
+
1448
+ // src/hooks/useOverlayDismissGuard.ts
1449
+ var isBaseUiPopupOpen = () => Boolean(
1450
+ document.querySelector('[data-base-ui-portal] [data-slot="combobox-content"][data-open]')
1451
+ );
1452
+ var isTargetInsideBaseUiPopup = (target) => target instanceof Element && Boolean(target.closest("[data-base-ui-portal]"));
1453
+ var shouldPreventDismissForSelect = (target) => {
1454
+ const isSelectOpen = Boolean(
1455
+ document.querySelector('[data-radix-select-content][data-state="open"]')
1456
+ );
1457
+ if (isSelectOpen) {
1458
+ return true;
1459
+ }
1460
+ if (!(target instanceof Element)) {
1461
+ return false;
1462
+ }
1463
+ return Boolean(
1464
+ target.closest("[data-radix-select-content]") || target.closest("[data-radix-select-viewport]")
1465
+ );
1466
+ };
1467
+ function useOverlayDismissGuard({
1468
+ onInteractOutside,
1469
+ onEscapeKeyDown
1470
+ }) {
1471
+ const handleInteractOutside = (event) => {
1472
+ if (shouldPreventDismissForSelect(event.target) || isTargetInsideBaseUiPopup(event.target)) {
1473
+ event.preventDefault();
1474
+ }
1475
+ onInteractOutside?.(event);
1476
+ };
1477
+ const handleEscapeKeyDown = (event) => {
1478
+ if (isBaseUiPopupOpen()) {
1479
+ event.preventDefault();
1480
+ }
1481
+ onEscapeKeyDown?.(event);
1482
+ };
1483
+ return { onEscapeKeyDown: handleEscapeKeyDown, onInteractOutside: handleInteractOutside };
1484
+ }
1559
1485
  var MODAL_PADDING = {
1560
1486
  body: "px-4 pb-4",
1561
1487
  footer: "px-4 py-3"
@@ -1593,28 +1519,9 @@ Modal.Overlay = forwardRef(
1593
1519
  )
1594
1520
  );
1595
1521
  Modal.Content = forwardRef(
1596
- ({ className, children, size = "default", onInteractOutside, onFocusOutside, ...props }, ref) => {
1522
+ ({ className, children, size = "default", onInteractOutside, onEscapeKeyDown, ...props }, ref) => {
1597
1523
  const isFullSize = size === "fullsize";
1598
- const shouldPreventDismissForSelect = (target) => {
1599
- const isSelectOpen = Boolean(
1600
- document.querySelector('[data-radix-select-content][data-state="open"]')
1601
- );
1602
- if (isSelectOpen) {
1603
- return true;
1604
- }
1605
- if (!(target instanceof Element)) {
1606
- return false;
1607
- }
1608
- return Boolean(
1609
- target.closest("[data-radix-select-content]") || target.closest("[data-radix-select-viewport]")
1610
- );
1611
- };
1612
- const handleInteractOutside = (event) => {
1613
- if (shouldPreventDismissForSelect(event.target)) {
1614
- event.preventDefault();
1615
- }
1616
- onInteractOutside?.(event);
1617
- };
1524
+ const dismissGuard = useOverlayDismissGuard({ onEscapeKeyDown, onInteractOutside });
1618
1525
  return /* @__PURE__ */ jsx(ModalContext.Provider, { value: { size }, children: /* @__PURE__ */ jsxs(Modal.Portal, { children: [
1619
1526
  /* @__PURE__ */ jsx(Modal.Overlay, {}),
1620
1527
  /* @__PURE__ */ jsx(
@@ -1632,7 +1539,7 @@ Modal.Content = forwardRef(
1632
1539
  className
1633
1540
  ),
1634
1541
  ...props,
1635
- onInteractOutside: handleInteractOutside,
1542
+ ...dismissGuard,
1636
1543
  children
1637
1544
  }
1638
1545
  )
@@ -1912,29 +1819,18 @@ Sheet.Overlay = forwardRef(
1912
1819
  )
1913
1820
  );
1914
1821
  Sheet.Content = forwardRef(
1915
- ({ className, children, side = "right", resizable = false, onInteractOutside, ...props }, ref) => {
1822
+ ({
1823
+ className,
1824
+ children,
1825
+ side = "right",
1826
+ resizable = false,
1827
+ onInteractOutside,
1828
+ onEscapeKeyDown,
1829
+ ...props
1830
+ }, ref) => {
1916
1831
  const resizeOptions = typeof resizable === "object" ? resizable : { use: resizable };
1917
1832
  const isResizable = resizeOptions.use ?? true;
1918
- const shouldPreventDismissForSelect = (target) => {
1919
- const isSelectOpen = Boolean(
1920
- document.querySelector('[data-radix-select-content][data-state="open"]')
1921
- );
1922
- if (isSelectOpen) {
1923
- return true;
1924
- }
1925
- if (!(target instanceof Element)) {
1926
- return false;
1927
- }
1928
- return Boolean(
1929
- target.closest("[data-radix-select-content]") || target.closest("[data-radix-select-viewport]")
1930
- );
1931
- };
1932
- const handleInteractOutside = (event) => {
1933
- if (shouldPreventDismissForSelect(event.target)) {
1934
- event.preventDefault();
1935
- }
1936
- onInteractOutside?.(event);
1937
- };
1833
+ const dismissGuard = useOverlayDismissGuard({ onEscapeKeyDown, onInteractOutside });
1938
1834
  return /* @__PURE__ */ jsx(SheetContext.Provider, { value: { side }, children: /* @__PURE__ */ jsxs(Sheet.Portal, { children: [
1939
1835
  /* @__PURE__ */ jsx(Sheet.Overlay, {}),
1940
1836
  /* @__PURE__ */ jsx(
@@ -1948,7 +1844,7 @@ Sheet.Content = forwardRef(
1948
1844
  className
1949
1845
  ),
1950
1846
  ...props,
1951
- onInteractOutside: handleInteractOutside,
1847
+ ...dismissGuard,
1952
1848
  children: isResizable ? /* @__PURE__ */ jsx(SheetResizableBox, { side, options: resizeOptions, children }) : children
1953
1849
  }
1954
1850
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exem-ui/react",
3
- "version": "0.3.4-next.20260727012122",
3
+ "version": "0.3.4-next.20260728024650",
4
4
  "description": "Exem Design System - React Components",
5
5
  "author": "Exem Design Team",
6
6
  "license": "Apache-2.0",
@@ -74,6 +74,7 @@
74
74
  "@atlaskit/pragmatic-drag-and-drop": "^1.7.7",
75
75
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
76
76
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.11",
77
+ "@base-ui/react": "^1.6.0",
77
78
  "@dnd-kit/core": "^6.3.1",
78
79
  "@dnd-kit/sortable": "^10.0.0",
79
80
  "@dnd-kit/utilities": "^3.2.2",
@@ -99,7 +100,7 @@
99
100
  "tailwind-merge": "^3.3.1",
100
101
  "tailwind-scrollbar-hide": "^4.0.0",
101
102
  "tiny-invariant": "^1.3.3",
102
- "@exem-ui/core": "0.3.3-next.20260727012122"
103
+ "@exem-ui/core": "0.3.3-next.20260728024650"
103
104
  },
104
105
  "devDependencies": {
105
106
  "@eslint/js": "^9.15.0",
@@ -135,7 +136,7 @@
135
136
  "tsup": "^8.5.0",
136
137
  "typescript": "^5.8.2",
137
138
  "typescript-eslint": "^8.16.0",
138
- "@exem-ui/tailwindcss3": "0.3.2-next.20260727012122"
139
+ "@exem-ui/tailwindcss3": "0.3.2-next.20260728024650"
139
140
  },
140
141
  "scripts": {
141
142
  "generate": "node scripts/generate-icons.js",
@@ -141,6 +141,12 @@ declare namespace ColorPaletteSwatch {
141
141
  var displayName: string;
142
142
  }
143
143
 
144
+ type Size = 'xsmall' | 'small' | 'medium' | 'large';
145
+ type Variant = 'fill' | 'line' | 'lineBackground';
146
+ type Icon = React.ReactElement<{
147
+ className?: string;
148
+ }>;
149
+
144
150
  type SegmentSize = 'small' | 'medium' | 'large';
145
151
  type SegmentListProps = React__default.ComponentPropsWithoutRef<typeof TabsPrimitive.List>;
146
152
  type SegmentItemProps = React__default.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger> & {
@@ -188,12 +194,6 @@ type SegmentComponent = {
188
194
  */
189
195
  declare const Segment: SegmentComponent;
190
196
 
191
- type Size = 'xsmall' | 'small' | 'medium' | 'large';
192
- type Variant = 'fill' | 'line' | 'lineBackground';
193
- type Icon = React.ReactElement<{
194
- className?: string;
195
- }>;
196
-
197
197
  /**
198
198
  * SelectGroup에서 사용 가능한 variant.
199
199
  * lineBackground는 그룹 디자인에 정의되어 있지 않으므로 제외한다.
@@ -141,6 +141,12 @@ declare namespace ColorPaletteSwatch {
141
141
  var displayName: string;
142
142
  }
143
143
 
144
+ type Size = 'xsmall' | 'small' | 'medium' | 'large';
145
+ type Variant = 'fill' | 'line' | 'lineBackground';
146
+ type Icon = React.ReactElement<{
147
+ className?: string;
148
+ }>;
149
+
144
150
  type SegmentSize = 'small' | 'medium' | 'large';
145
151
  type SegmentListProps = React__default.ComponentPropsWithoutRef<typeof TabsPrimitive.List>;
146
152
  type SegmentItemProps = React__default.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger> & {
@@ -188,12 +194,6 @@ type SegmentComponent = {
188
194
  */
189
195
  declare const Segment: SegmentComponent;
190
196
 
191
- type Size = 'xsmall' | 'small' | 'medium' | 'large';
192
- type Variant = 'fill' | 'line' | 'lineBackground';
193
- type Icon = React.ReactElement<{
194
- className?: string;
195
- }>;
196
-
197
197
  /**
198
198
  * SelectGroup에서 사용 가능한 variant.
199
199
  * lineBackground는 그룹 디자인에 정의되어 있지 않으므로 제외한다.