@x-plat/design-system 0.13.0 → 0.14.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/{breakpoints-DsXkJgdl.d.cts → breakpoints-CKkNxA-y.d.cts} +1 -1
- package/dist/{breakpoints-DsXkJgdl.d.ts → breakpoints-CKkNxA-y.d.ts} +1 -1
- package/dist/components/Badge/index.d.cts +1 -1
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/ToggleChip/index.cjs +69 -0
- package/dist/components/ToggleChip/index.css +102 -0
- package/dist/components/ToggleChip/index.d.cts +37 -0
- package/dist/components/ToggleChip/index.d.ts +37 -0
- package/dist/components/ToggleChip/index.js +42 -0
- package/dist/components/index.cjs +62 -36
- package/dist/components/index.css +37 -0
- package/dist/components/index.d.cts +2 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +52 -27
- package/dist/index.cjs +81 -55
- package/dist/index.css +37 -0
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +69 -44
- package/dist/layout/Grid/Item/index.d.cts +1 -1
- package/dist/layout/Grid/Item/index.d.ts +1 -1
- package/dist/layout/Grid/index.d.cts +1 -1
- package/dist/layout/Grid/index.d.ts +1 -1
- package/dist/layout/index.d.cts +1 -1
- package/dist/layout/index.d.ts +1 -1
- package/dist/tokens/index.d.cts +1 -1
- package/dist/tokens/index.d.ts +1 -1
- package/guidelines/Guidelines.md +1 -1
- package/guidelines/MIGRATION.md +27 -0
- package/guidelines/components/chip-tag.md +75 -2
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -27,7 +27,7 @@ export { Input, PasswordInput } from './components/Input/index.cjs';
|
|
|
27
27
|
export { Link } from './components/Link/index.cjs';
|
|
28
28
|
export { LinkButton } from './components/LinkButton/index.cjs';
|
|
29
29
|
export { Modal } from './components/Modal/index.cjs';
|
|
30
|
-
export {
|
|
30
|
+
export { Badge, Badge as NotificationBadge } from './components/NotificationBadge/index.cjs';
|
|
31
31
|
export { Pagination } from './components/Pagination/index.cjs';
|
|
32
32
|
export { PopOver } from './components/PopOver/index.cjs';
|
|
33
33
|
export { Progress } from './components/Progress/index.cjs';
|
|
@@ -45,17 +45,18 @@ export { Tag } from './components/Tag/index.cjs';
|
|
|
45
45
|
export { TextArea } from './components/TextArea/index.cjs';
|
|
46
46
|
export { TimePicker } from './components/TimePicker/index.cjs';
|
|
47
47
|
export { ToastProvider, useToast } from './components/Toast/index.cjs';
|
|
48
|
+
export { ToggleChip } from './components/ToggleChip/index.cjs';
|
|
48
49
|
export { Tooltip } from './components/Tooltip/index.cjs';
|
|
49
50
|
export { Video, VideoProps } from './components/Video/index.cjs';
|
|
50
51
|
export { FullGrid } from './layout/Grid/FullGrid/index.cjs';
|
|
51
52
|
export { FullScreen } from './layout/Grid/FullScreen/index.cjs';
|
|
52
53
|
export { GridItem } from './layout/Grid/Item/index.cjs';
|
|
53
|
-
export { B as BREAKPOINT_KEYS_ORDERED, a as BreakpointKey,
|
|
54
|
+
export { B as BREAKPOINT_KEYS_ORDERED, a as BreakpointKey, G as GridColumnConfig, b as GridSpanFor, c as breakpoints, g as gridColumns } from './breakpoints-CKkNxA-y.cjs';
|
|
54
55
|
export { Header } from './layout/Header/index.cjs';
|
|
55
56
|
export { Layout } from './layout/Layout/index.cjs';
|
|
56
57
|
export { SideBar, SideBarContext, useSideBarContext } from './layout/SideBar/index.cjs';
|
|
57
58
|
export { TokenVar, cssVar, semantic } from '@x-plat/tokens-core';
|
|
58
|
-
export { ActivityIcon, AirplayIcon, AlertCircleIcon, AlertOctagonIcon, AlertTriangleIcon, AlignCenterIcon, AlignJustifyIcon, AlignLeftIcon, AlignRightIcon, AnchorIcon, ApertureIcon, ArchiveIcon, ArrowDownCircleIcon, ArrowDownIcon, ArrowDownLeftIcon, ArrowDownRightIcon, ArrowLeftCircleIcon, ArrowLeftIcon, ArrowRightCircleIcon, ArrowRightIcon, ArrowUpCircleIcon, ArrowUpIcon, ArrowUpLeftIcon, ArrowUpRightIcon, AtSignIcon, AwardIcon, BarChart2Icon, BarChartIcon, BatteryChargingIcon, BatteryIcon, BellIcon, BellOffIcon, BluetoothIcon, BoldIcon, BookIcon, BookOpenIcon, BookmarkIcon, BoxIcon, BriefcaseIcon, CalendarIcon, CalenderIcon, CallActiveIcon, CallForwardedIcon,
|
|
59
|
+
export { ActivityIcon, AirplayIcon, AlertCircleIcon, AlertOctagonIcon, AlertTriangleIcon, AlignCenterIcon, AlignJustifyIcon, AlignLeftIcon, AlignRightIcon, AnchorIcon, ApertureIcon, ArchiveIcon, ArrowDownCircleIcon, ArrowDownIcon, ArrowDownLeftIcon, ArrowDownRightIcon, ArrowLeftCircleIcon, ArrowLeftIcon, ArrowRightCircleIcon, ArrowRightIcon, ArrowUpCircleIcon, ArrowUpIcon, ArrowUpLeftIcon, ArrowUpRightIcon, AtSignIcon, AwardIcon, BarChart2Icon, BarChartIcon, BatteryChargingIcon, BatteryIcon, BellIcon, BellOffIcon, BluetoothIcon, BoldIcon, BookIcon, BookOpenIcon, BookmarkIcon, BoxIcon, BriefcaseIcon, CalendarIcon, CalenderIcon, CallActiveIcon, CallForwardedIcon, CallIcon, CallIncomingIcon, CallMissedIcon, CallOffIcon, CallOutgoingIcon, CameraIcon, CameraOffIcon, CastIcon, CheckCircleIcon, CheckIcon, CheckSquareIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsDownIcon, ChevronsLeftIcon, ChevronsRightIcon, ChevronsUpIcon, ChromeIcon, CircleIcon, ClipboardIcon, ClockIcon, CloseEyeIcon, CloudDrizzleIcon, CloudIcon, CloudLightningIcon, CloudOffIcon, CloudRainIcon, CloudSnowIcon, CodeIcon, CodepenIcon, CodesandboxIcon, CoffeeIcon, ColorProps, ColorToken, ColumnsIcon, CommandIcon, CompassIcon, CopyIcon, CornerDownLeftIcon, CornerDownRightIcon, CornerLeftDownIcon, CornerLeftUpIcon, CornerRightDownIcon, CornerRightUpIcon, CornerUpLeftIcon, CornerUpRightIcon, CpuIcon, CreditCardIcon, CropIcon, CrosshairIcon, DatabaseIcon, CallIcon as DefaultCall, DeleteIcon, DiscIcon, DivideCircleIcon, DivideIcon, DivideSquareIcon, DollarSignIcon, DownloadCloudIcon, DownloadIcon, DribbbleIcon, DropletIcon, Edit2Icon, Edit3Icon, EditIcon, ErrorIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FacebookIcon, FastForwardIcon, FeatherIcon, FigmaIcon, FileIcon, FileMinusIcon, FilePlusIcon, FileTextIcon, FilmIcon, FilterIcon, FlagIcon, FolderIcon, FolderMinusIcon, FolderPlusIcon, FramerIcon, FrownIcon, GierIcon, GiftIcon, GitBranchIcon, GitCommitIcon, GitMergeIcon, GitPullRequestIcon, GithubIcon, GitlabIcon, GlobeIcon, GridIcon, HardDriveIcon, HashIcon, HeadphonesIcon, HeartIcon, HelpCircleIcon, HexagonIcon, HomeIcon, ImageIcon, InboxIcon, InfoIcon, InstagramIcon, ItalicIcon, KeyIcon, LayersIcon, LayoutIcon, LifeBuoyIcon, Link2Icon, LinkIcon, LinkedinIcon, ListIcon, LoaderIcon, LockIcon, LogInIcon, LogOutIcon, MailIcon, MapIcon, MapPinIcon, Maximize2Icon, MaximizeIcon, MehIcon, MenuIcon, MessageCircleIcon, MessageSquareIcon, MicIcon, MicOffIcon, Minimize2Icon, MinimizeIcon, MinusCircleIcon, MinusIcon, MinusSquareIcon, MonitorIcon, MoonIcon, MoreHorizontalIcon, MoreVerticalIcon, MousePointerIcon, MoveIcon, MusicIcon, Navigation2Icon, NavigationIcon, OctagonIcon, OpenEyeIcon, PackageIcon, PaperclipIcon, PauseCircleIcon, PauseIcon, PenToolIcon, PercentIcon, PieChartIcon, PlayCircleIcon, PlayIcon, PlusCircleIcon, PlusIcon, PlusSquareIcon, PocketIcon, PowerIcon, PrinterIcon, ProfileIcon, RadioIcon, RefreshCcwIcon, RefreshCwIcon, RepeatIcon, RewindIcon, RotateCcwIcon, RotateCwIcon, RssIcon, SaveIcon, ScissorsIcon, SearchIcon, SemanticColorToken, SendIcon, ServerIcon, SettingsIcon, Share2Icon, ShareIcon, ShieldIcon, ShieldOffIcon, ShoppingBagIcon, ShoppingCartIcon, ShuffleIcon, SidebarIcon, SkipBackIcon, SkipForwardIcon, SlackIcon, SlashIcon, SlidersIcon, SmartphoneIcon, SmileIcon, SpeakerIcon, SquareIcon, StarIcon, StopCircleIcon, SuccessIcon, SunIcon, SunriseIcon, SunsetIcon, TableIcon, TabletIcon, TagIcon, TargetIcon, TerminalIcon, ThermometerIcon, ThumbsDownIcon, ThumbsUpIcon, ToggleLeftIcon, ToggleRightIcon, ToolIcon, Trash2Icon, TrashIcon, TrelloIcon, TrendingDownIcon, TrendingUpIcon, TriangleIcon, TruckIcon, TvIcon, TwitchIcon, TwitterIcon, TypeIcon, UmbrellaIcon, UnderlineIcon, UnlockIcon, UploadCloudIcon, UploadIcon, UserCheckIcon, UserIcon, UserMinusIcon, UserPlusIcon, UserXIcon, UsersIcon, VideoIcon, VideoOffIcon, VoicemailIcon, Volume1Icon, Volume2Icon, VolumeIcon, VolumeXIcon, WatchIcon, WifiIcon, WifiOffIcon, WindIcon, XCircleIcon, XIcon, XOctagonIcon, XSquareIcon, YoutubeIcon, ZapIcon, ZapOffIcon, ZoomInIcon, ZoomOutIcon } from './tokens/index.cjs';
|
|
59
60
|
import 'react';
|
|
60
61
|
import './attributes-DJIWir_0.cjs';
|
|
61
62
|
import './validation-Dqo1zqhT.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export { Input, PasswordInput } from './components/Input/index.js';
|
|
|
27
27
|
export { Link } from './components/Link/index.js';
|
|
28
28
|
export { LinkButton } from './components/LinkButton/index.js';
|
|
29
29
|
export { Modal } from './components/Modal/index.js';
|
|
30
|
-
export {
|
|
30
|
+
export { Badge, Badge as NotificationBadge } from './components/NotificationBadge/index.js';
|
|
31
31
|
export { Pagination } from './components/Pagination/index.js';
|
|
32
32
|
export { PopOver } from './components/PopOver/index.js';
|
|
33
33
|
export { Progress } from './components/Progress/index.js';
|
|
@@ -45,17 +45,18 @@ export { Tag } from './components/Tag/index.js';
|
|
|
45
45
|
export { TextArea } from './components/TextArea/index.js';
|
|
46
46
|
export { TimePicker } from './components/TimePicker/index.js';
|
|
47
47
|
export { ToastProvider, useToast } from './components/Toast/index.js';
|
|
48
|
+
export { ToggleChip } from './components/ToggleChip/index.js';
|
|
48
49
|
export { Tooltip } from './components/Tooltip/index.js';
|
|
49
50
|
export { Video, VideoProps } from './components/Video/index.js';
|
|
50
51
|
export { FullGrid } from './layout/Grid/FullGrid/index.js';
|
|
51
52
|
export { FullScreen } from './layout/Grid/FullScreen/index.js';
|
|
52
53
|
export { GridItem } from './layout/Grid/Item/index.js';
|
|
53
|
-
export { B as BREAKPOINT_KEYS_ORDERED, a as BreakpointKey,
|
|
54
|
+
export { B as BREAKPOINT_KEYS_ORDERED, a as BreakpointKey, G as GridColumnConfig, b as GridSpanFor, c as breakpoints, g as gridColumns } from './breakpoints-CKkNxA-y.js';
|
|
54
55
|
export { Header } from './layout/Header/index.js';
|
|
55
56
|
export { Layout } from './layout/Layout/index.js';
|
|
56
57
|
export { SideBar, SideBarContext, useSideBarContext } from './layout/SideBar/index.js';
|
|
57
58
|
export { TokenVar, cssVar, semantic } from '@x-plat/tokens-core';
|
|
58
|
-
export { ActivityIcon, AirplayIcon, AlertCircleIcon, AlertOctagonIcon, AlertTriangleIcon, AlignCenterIcon, AlignJustifyIcon, AlignLeftIcon, AlignRightIcon, AnchorIcon, ApertureIcon, ArchiveIcon, ArrowDownCircleIcon, ArrowDownIcon, ArrowDownLeftIcon, ArrowDownRightIcon, ArrowLeftCircleIcon, ArrowLeftIcon, ArrowRightCircleIcon, ArrowRightIcon, ArrowUpCircleIcon, ArrowUpIcon, ArrowUpLeftIcon, ArrowUpRightIcon, AtSignIcon, AwardIcon, BarChart2Icon, BarChartIcon, BatteryChargingIcon, BatteryIcon, BellIcon, BellOffIcon, BluetoothIcon, BoldIcon, BookIcon, BookOpenIcon, BookmarkIcon, BoxIcon, BriefcaseIcon, CalendarIcon, CalenderIcon, CallActiveIcon, CallForwardedIcon,
|
|
59
|
+
export { ActivityIcon, AirplayIcon, AlertCircleIcon, AlertOctagonIcon, AlertTriangleIcon, AlignCenterIcon, AlignJustifyIcon, AlignLeftIcon, AlignRightIcon, AnchorIcon, ApertureIcon, ArchiveIcon, ArrowDownCircleIcon, ArrowDownIcon, ArrowDownLeftIcon, ArrowDownRightIcon, ArrowLeftCircleIcon, ArrowLeftIcon, ArrowRightCircleIcon, ArrowRightIcon, ArrowUpCircleIcon, ArrowUpIcon, ArrowUpLeftIcon, ArrowUpRightIcon, AtSignIcon, AwardIcon, BarChart2Icon, BarChartIcon, BatteryChargingIcon, BatteryIcon, BellIcon, BellOffIcon, BluetoothIcon, BoldIcon, BookIcon, BookOpenIcon, BookmarkIcon, BoxIcon, BriefcaseIcon, CalendarIcon, CalenderIcon, CallActiveIcon, CallForwardedIcon, CallIcon, CallIncomingIcon, CallMissedIcon, CallOffIcon, CallOutgoingIcon, CameraIcon, CameraOffIcon, CastIcon, CheckCircleIcon, CheckIcon, CheckSquareIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsDownIcon, ChevronsLeftIcon, ChevronsRightIcon, ChevronsUpIcon, ChromeIcon, CircleIcon, ClipboardIcon, ClockIcon, CloseEyeIcon, CloudDrizzleIcon, CloudIcon, CloudLightningIcon, CloudOffIcon, CloudRainIcon, CloudSnowIcon, CodeIcon, CodepenIcon, CodesandboxIcon, CoffeeIcon, ColorProps, ColorToken, ColumnsIcon, CommandIcon, CompassIcon, CopyIcon, CornerDownLeftIcon, CornerDownRightIcon, CornerLeftDownIcon, CornerLeftUpIcon, CornerRightDownIcon, CornerRightUpIcon, CornerUpLeftIcon, CornerUpRightIcon, CpuIcon, CreditCardIcon, CropIcon, CrosshairIcon, DatabaseIcon, CallIcon as DefaultCall, DeleteIcon, DiscIcon, DivideCircleIcon, DivideIcon, DivideSquareIcon, DollarSignIcon, DownloadCloudIcon, DownloadIcon, DribbbleIcon, DropletIcon, Edit2Icon, Edit3Icon, EditIcon, ErrorIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FacebookIcon, FastForwardIcon, FeatherIcon, FigmaIcon, FileIcon, FileMinusIcon, FilePlusIcon, FileTextIcon, FilmIcon, FilterIcon, FlagIcon, FolderIcon, FolderMinusIcon, FolderPlusIcon, FramerIcon, FrownIcon, GierIcon, GiftIcon, GitBranchIcon, GitCommitIcon, GitMergeIcon, GitPullRequestIcon, GithubIcon, GitlabIcon, GlobeIcon, GridIcon, HardDriveIcon, HashIcon, HeadphonesIcon, HeartIcon, HelpCircleIcon, HexagonIcon, HomeIcon, ImageIcon, InboxIcon, InfoIcon, InstagramIcon, ItalicIcon, KeyIcon, LayersIcon, LayoutIcon, LifeBuoyIcon, Link2Icon, LinkIcon, LinkedinIcon, ListIcon, LoaderIcon, LockIcon, LogInIcon, LogOutIcon, MailIcon, MapIcon, MapPinIcon, Maximize2Icon, MaximizeIcon, MehIcon, MenuIcon, MessageCircleIcon, MessageSquareIcon, MicIcon, MicOffIcon, Minimize2Icon, MinimizeIcon, MinusCircleIcon, MinusIcon, MinusSquareIcon, MonitorIcon, MoonIcon, MoreHorizontalIcon, MoreVerticalIcon, MousePointerIcon, MoveIcon, MusicIcon, Navigation2Icon, NavigationIcon, OctagonIcon, OpenEyeIcon, PackageIcon, PaperclipIcon, PauseCircleIcon, PauseIcon, PenToolIcon, PercentIcon, PieChartIcon, PlayCircleIcon, PlayIcon, PlusCircleIcon, PlusIcon, PlusSquareIcon, PocketIcon, PowerIcon, PrinterIcon, ProfileIcon, RadioIcon, RefreshCcwIcon, RefreshCwIcon, RepeatIcon, RewindIcon, RotateCcwIcon, RotateCwIcon, RssIcon, SaveIcon, ScissorsIcon, SearchIcon, SemanticColorToken, SendIcon, ServerIcon, SettingsIcon, Share2Icon, ShareIcon, ShieldIcon, ShieldOffIcon, ShoppingBagIcon, ShoppingCartIcon, ShuffleIcon, SidebarIcon, SkipBackIcon, SkipForwardIcon, SlackIcon, SlashIcon, SlidersIcon, SmartphoneIcon, SmileIcon, SpeakerIcon, SquareIcon, StarIcon, StopCircleIcon, SuccessIcon, SunIcon, SunriseIcon, SunsetIcon, TableIcon, TabletIcon, TagIcon, TargetIcon, TerminalIcon, ThermometerIcon, ThumbsDownIcon, ThumbsUpIcon, ToggleLeftIcon, ToggleRightIcon, ToolIcon, Trash2Icon, TrashIcon, TrelloIcon, TrendingDownIcon, TrendingUpIcon, TriangleIcon, TruckIcon, TvIcon, TwitchIcon, TwitterIcon, TypeIcon, UmbrellaIcon, UnderlineIcon, UnlockIcon, UploadCloudIcon, UploadIcon, UserCheckIcon, UserIcon, UserMinusIcon, UserPlusIcon, UserXIcon, UsersIcon, VideoIcon, VideoOffIcon, VoicemailIcon, Volume1Icon, Volume2Icon, VolumeIcon, VolumeXIcon, WatchIcon, WifiIcon, WifiOffIcon, WindIcon, XCircleIcon, XIcon, XOctagonIcon, XSquareIcon, YoutubeIcon, ZapIcon, ZapOffIcon, ZoomInIcon, ZoomOutIcon } from './tokens/index.js';
|
|
59
60
|
import 'react';
|
|
60
61
|
import './attributes-DJIWir_0.js';
|
|
61
62
|
import './validation-Dqo1zqhT.js';
|
package/dist/index.js
CHANGED
|
@@ -11409,9 +11409,33 @@ var ToastProvider = ({
|
|
|
11409
11409
|
};
|
|
11410
11410
|
ToastProvider.displayName = "ToastProvider";
|
|
11411
11411
|
|
|
11412
|
+
// src/components/ToggleChip/ToggleChip.tsx
|
|
11413
|
+
import { jsx as jsx353 } from "react/jsx-runtime";
|
|
11414
|
+
var ToggleChip = (props) => {
|
|
11415
|
+
const { children, selected = false, onClick, disabled = false, size = "md" } = props;
|
|
11416
|
+
return /* @__PURE__ */ jsx353(
|
|
11417
|
+
"button",
|
|
11418
|
+
{
|
|
11419
|
+
type: "button",
|
|
11420
|
+
className: clsx_default(
|
|
11421
|
+
"lib-xplat-chip",
|
|
11422
|
+
"lib-xplat-toggle-chip",
|
|
11423
|
+
size,
|
|
11424
|
+
selected ? "selected" : "unselected"
|
|
11425
|
+
),
|
|
11426
|
+
"aria-pressed": selected,
|
|
11427
|
+
disabled,
|
|
11428
|
+
onClick,
|
|
11429
|
+
children
|
|
11430
|
+
}
|
|
11431
|
+
);
|
|
11432
|
+
};
|
|
11433
|
+
ToggleChip.displayName = "ToggleChip";
|
|
11434
|
+
var ToggleChip_default = ToggleChip;
|
|
11435
|
+
|
|
11412
11436
|
// src/components/Tooltip/Tooltip.tsx
|
|
11413
11437
|
import React42 from "react";
|
|
11414
|
-
import { Fragment as Fragment6, jsx as
|
|
11438
|
+
import { Fragment as Fragment6, jsx as jsx354, jsxs as jsxs224 } from "react/jsx-runtime";
|
|
11415
11439
|
var OFFSET = 12;
|
|
11416
11440
|
var GAP = 8;
|
|
11417
11441
|
var SHOW_DELAY = 300;
|
|
@@ -11516,7 +11540,7 @@ var Tooltip = (props) => {
|
|
|
11516
11540
|
window.clearTimeout(delayTimer.current);
|
|
11517
11541
|
cancelAnimationFrame(rafRef.current);
|
|
11518
11542
|
}, []);
|
|
11519
|
-
if (!title && !description) return /* @__PURE__ */
|
|
11543
|
+
if (!title && !description) return /* @__PURE__ */ jsx354(Fragment6, { children });
|
|
11520
11544
|
return /* @__PURE__ */ jsxs224(
|
|
11521
11545
|
"div",
|
|
11522
11546
|
{
|
|
@@ -11530,7 +11554,7 @@ var Tooltip = (props) => {
|
|
|
11530
11554
|
onBlur: close,
|
|
11531
11555
|
children: [
|
|
11532
11556
|
children,
|
|
11533
|
-
visible && /* @__PURE__ */
|
|
11557
|
+
visible && /* @__PURE__ */ jsx354(Portal_default, { children: /* @__PURE__ */ jsxs224(
|
|
11534
11558
|
"div",
|
|
11535
11559
|
{
|
|
11536
11560
|
ref: tooltipRef,
|
|
@@ -11538,8 +11562,8 @@ var Tooltip = (props) => {
|
|
|
11538
11562
|
className: clsx_default("lib-xplat-tooltip", shape),
|
|
11539
11563
|
style: { position: "fixed", left: pos.left, top: pos.top },
|
|
11540
11564
|
children: [
|
|
11541
|
-
title && /* @__PURE__ */
|
|
11542
|
-
description && /* @__PURE__ */
|
|
11565
|
+
title && /* @__PURE__ */ jsx354("div", { className: "tooltip-title", children: title }),
|
|
11566
|
+
description && /* @__PURE__ */ jsx354("div", { className: "tooltip-desc", children: description })
|
|
11543
11567
|
]
|
|
11544
11568
|
}
|
|
11545
11569
|
) })
|
|
@@ -11552,10 +11576,10 @@ var Tooltip_default = Tooltip;
|
|
|
11552
11576
|
|
|
11553
11577
|
// src/components/Video/Video.tsx
|
|
11554
11578
|
import React43 from "react";
|
|
11555
|
-
import { jsx as
|
|
11579
|
+
import { jsx as jsx355, jsxs as jsxs225 } from "react/jsx-runtime";
|
|
11556
11580
|
var PipIcon = () => /* @__PURE__ */ jsxs225("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
11557
|
-
/* @__PURE__ */
|
|
11558
|
-
/* @__PURE__ */
|
|
11581
|
+
/* @__PURE__ */ jsx355("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
|
|
11582
|
+
/* @__PURE__ */ jsx355("rect", { x: "12", y: "11", width: "7", height: "6", rx: "1", fill: "currentColor" })
|
|
11559
11583
|
] });
|
|
11560
11584
|
var formatTime = (sec) => {
|
|
11561
11585
|
if (!Number.isFinite(sec) || sec < 0) return "0:00";
|
|
@@ -11736,7 +11760,7 @@ var Video = React43.forwardRef((props, ref) => {
|
|
|
11736
11760
|
ref: containerRef,
|
|
11737
11761
|
className: clsx_default("lib-xplat-video", showControls && "has-controls"),
|
|
11738
11762
|
children: [
|
|
11739
|
-
/* @__PURE__ */
|
|
11763
|
+
/* @__PURE__ */ jsx355(
|
|
11740
11764
|
"video",
|
|
11741
11765
|
{
|
|
11742
11766
|
ref: setRefs,
|
|
@@ -11757,7 +11781,7 @@ var Video = React43.forwardRef((props, ref) => {
|
|
|
11757
11781
|
children
|
|
11758
11782
|
}
|
|
11759
11783
|
),
|
|
11760
|
-
showCenterPlay && /* @__PURE__ */
|
|
11784
|
+
showCenterPlay && /* @__PURE__ */ jsx355(
|
|
11761
11785
|
"button",
|
|
11762
11786
|
{
|
|
11763
11787
|
type: "button",
|
|
@@ -11769,11 +11793,11 @@ var Video = React43.forwardRef((props, ref) => {
|
|
|
11769
11793
|
onClick: togglePlay,
|
|
11770
11794
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
11771
11795
|
tabIndex: -1,
|
|
11772
|
-
children: /* @__PURE__ */
|
|
11796
|
+
children: /* @__PURE__ */ jsx355("span", { className: "center-play-icon", children: /* @__PURE__ */ jsx355(PlayCircleIcon_default, {}) })
|
|
11773
11797
|
}
|
|
11774
11798
|
),
|
|
11775
11799
|
showControls && /* @__PURE__ */ jsxs225("div", { className: "controls", onClick: (e) => e.stopPropagation(), children: [
|
|
11776
|
-
/* @__PURE__ */
|
|
11800
|
+
/* @__PURE__ */ jsx355(
|
|
11777
11801
|
"input",
|
|
11778
11802
|
{
|
|
11779
11803
|
type: "range",
|
|
@@ -11791,28 +11815,28 @@ var Video = React43.forwardRef((props, ref) => {
|
|
|
11791
11815
|
}
|
|
11792
11816
|
),
|
|
11793
11817
|
/* @__PURE__ */ jsxs225("div", { className: "controls-row", children: [
|
|
11794
|
-
/* @__PURE__ */
|
|
11818
|
+
/* @__PURE__ */ jsx355(
|
|
11795
11819
|
"button",
|
|
11796
11820
|
{
|
|
11797
11821
|
type: "button",
|
|
11798
11822
|
className: "control-btn",
|
|
11799
11823
|
onClick: togglePlay,
|
|
11800
11824
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
11801
|
-
children: isPlaying ? /* @__PURE__ */
|
|
11825
|
+
children: isPlaying ? /* @__PURE__ */ jsx355(PauseIcon_default, {}) : /* @__PURE__ */ jsx355(PlayIcon_default, {})
|
|
11802
11826
|
}
|
|
11803
11827
|
),
|
|
11804
11828
|
/* @__PURE__ */ jsxs225("div", { className: "volume-group", children: [
|
|
11805
|
-
/* @__PURE__ */
|
|
11829
|
+
/* @__PURE__ */ jsx355(
|
|
11806
11830
|
"button",
|
|
11807
11831
|
{
|
|
11808
11832
|
type: "button",
|
|
11809
11833
|
className: "control-btn",
|
|
11810
11834
|
onClick: toggleMute,
|
|
11811
11835
|
"aria-label": isMuted ? "\uC74C\uC18C\uAC70 \uD574\uC81C" : "\uC74C\uC18C\uAC70",
|
|
11812
|
-
children: /* @__PURE__ */
|
|
11836
|
+
children: /* @__PURE__ */ jsx355(VolumeGlyph, {})
|
|
11813
11837
|
}
|
|
11814
11838
|
),
|
|
11815
|
-
/* @__PURE__ */
|
|
11839
|
+
/* @__PURE__ */ jsx355(
|
|
11816
11840
|
"input",
|
|
11817
11841
|
{
|
|
11818
11842
|
type: "range",
|
|
@@ -11832,7 +11856,7 @@ var Video = React43.forwardRef((props, ref) => {
|
|
|
11832
11856
|
" / ",
|
|
11833
11857
|
formatTime(duration)
|
|
11834
11858
|
] }),
|
|
11835
|
-
/* @__PURE__ */
|
|
11859
|
+
/* @__PURE__ */ jsx355("div", { className: "controls-spacer" }),
|
|
11836
11860
|
playbackRates && playbackRates.length > 0 && /* @__PURE__ */ jsxs225("div", { className: clsx_default("rate-group", rateMenuOpen && "is-open"), children: [
|
|
11837
11861
|
/* @__PURE__ */ jsxs225(
|
|
11838
11862
|
"button",
|
|
@@ -11848,7 +11872,7 @@ var Video = React43.forwardRef((props, ref) => {
|
|
|
11848
11872
|
]
|
|
11849
11873
|
}
|
|
11850
11874
|
),
|
|
11851
|
-
rateMenuOpen && /* @__PURE__ */
|
|
11875
|
+
rateMenuOpen && /* @__PURE__ */ jsx355("ul", { className: "rate-menu", role: "menu", children: playbackRates.map((r2) => /* @__PURE__ */ jsx355("li", { children: /* @__PURE__ */ jsxs225(
|
|
11852
11876
|
"button",
|
|
11853
11877
|
{
|
|
11854
11878
|
type: "button",
|
|
@@ -11862,7 +11886,7 @@ var Video = React43.forwardRef((props, ref) => {
|
|
|
11862
11886
|
}
|
|
11863
11887
|
) }, r2)) })
|
|
11864
11888
|
] }),
|
|
11865
|
-
showCaptions && /* @__PURE__ */
|
|
11889
|
+
showCaptions && /* @__PURE__ */ jsx355(
|
|
11866
11890
|
"button",
|
|
11867
11891
|
{
|
|
11868
11892
|
type: "button",
|
|
@@ -11870,37 +11894,37 @@ var Video = React43.forwardRef((props, ref) => {
|
|
|
11870
11894
|
onClick: toggleCaptions,
|
|
11871
11895
|
"aria-label": captionsOn ? "\uC790\uB9C9 \uB044\uAE30" : "\uC790\uB9C9 \uCF1C\uAE30",
|
|
11872
11896
|
"aria-pressed": captionsOn,
|
|
11873
|
-
children: /* @__PURE__ */
|
|
11897
|
+
children: /* @__PURE__ */ jsx355(TypeIcon_default, {})
|
|
11874
11898
|
}
|
|
11875
11899
|
),
|
|
11876
|
-
showPip && pipSupported && /* @__PURE__ */
|
|
11900
|
+
showPip && pipSupported && /* @__PURE__ */ jsx355(
|
|
11877
11901
|
"button",
|
|
11878
11902
|
{
|
|
11879
11903
|
type: "button",
|
|
11880
11904
|
className: clsx_default("control-btn", isPip && "is-active"),
|
|
11881
11905
|
onClick: togglePip,
|
|
11882
11906
|
"aria-label": isPip ? "PIP \uC885\uB8CC" : "PIP",
|
|
11883
|
-
children: /* @__PURE__ */
|
|
11907
|
+
children: /* @__PURE__ */ jsx355(PipIcon, {})
|
|
11884
11908
|
}
|
|
11885
11909
|
),
|
|
11886
|
-
showDownload && /* @__PURE__ */
|
|
11910
|
+
showDownload && /* @__PURE__ */ jsx355(
|
|
11887
11911
|
"a",
|
|
11888
11912
|
{
|
|
11889
11913
|
className: "control-btn",
|
|
11890
11914
|
href: src,
|
|
11891
11915
|
download: downloadFileName ?? true,
|
|
11892
11916
|
"aria-label": "\uB2E4\uC6B4\uB85C\uB4DC",
|
|
11893
|
-
children: /* @__PURE__ */
|
|
11917
|
+
children: /* @__PURE__ */ jsx355(DownloadIcon_default, {})
|
|
11894
11918
|
}
|
|
11895
11919
|
),
|
|
11896
|
-
/* @__PURE__ */
|
|
11920
|
+
/* @__PURE__ */ jsx355(
|
|
11897
11921
|
"button",
|
|
11898
11922
|
{
|
|
11899
11923
|
type: "button",
|
|
11900
11924
|
className: "control-btn",
|
|
11901
11925
|
onClick: toggleFullscreen,
|
|
11902
11926
|
"aria-label": isFullscreen ? "\uC804\uCCB4\uD654\uBA74 \uC885\uB8CC" : "\uC804\uCCB4\uD654\uBA74",
|
|
11903
|
-
children: isFullscreen ? /* @__PURE__ */
|
|
11927
|
+
children: isFullscreen ? /* @__PURE__ */ jsx355(MinimizeIcon_default, {}) : /* @__PURE__ */ jsx355(MaximizeIcon_default, {})
|
|
11904
11928
|
}
|
|
11905
11929
|
)
|
|
11906
11930
|
] })
|
|
@@ -11913,7 +11937,7 @@ Video.displayName = "Video";
|
|
|
11913
11937
|
var Video_default = Video;
|
|
11914
11938
|
|
|
11915
11939
|
// src/layout/Grid/FullGrid/FullGrid.tsx
|
|
11916
|
-
import { jsx as
|
|
11940
|
+
import { jsx as jsx356 } from "react/jsx-runtime";
|
|
11917
11941
|
var GAP_MAP = {
|
|
11918
11942
|
none: "var(--spacing-space-none)",
|
|
11919
11943
|
xs: "var(--spacing-space-1)",
|
|
@@ -11926,13 +11950,13 @@ var GAP_MAP = {
|
|
|
11926
11950
|
var FullGrid = (props) => {
|
|
11927
11951
|
const { children, gap } = props;
|
|
11928
11952
|
const style = gap != null ? { gap: GAP_MAP[gap] } : void 0;
|
|
11929
|
-
return /* @__PURE__ */
|
|
11953
|
+
return /* @__PURE__ */ jsx356("div", { className: "lib-xplat-full-grid", style, children });
|
|
11930
11954
|
};
|
|
11931
11955
|
FullGrid.displayName = "FullGrid";
|
|
11932
11956
|
var FullGrid_default = FullGrid;
|
|
11933
11957
|
|
|
11934
11958
|
// src/layout/Grid/FullScreen/FullScreen.tsx
|
|
11935
|
-
import { jsx as
|
|
11959
|
+
import { jsx as jsx357 } from "react/jsx-runtime";
|
|
11936
11960
|
var GAP_MAP2 = {
|
|
11937
11961
|
none: "var(--spacing-space-none)",
|
|
11938
11962
|
xs: "var(--spacing-space-1)",
|
|
@@ -11945,13 +11969,13 @@ var GAP_MAP2 = {
|
|
|
11945
11969
|
var FullScreen = (props) => {
|
|
11946
11970
|
const { children, gap } = props;
|
|
11947
11971
|
const style = gap != null ? { gap: GAP_MAP2[gap] } : void 0;
|
|
11948
|
-
return /* @__PURE__ */
|
|
11972
|
+
return /* @__PURE__ */ jsx357("div", { className: "lib-xplat-full-screen", style, children });
|
|
11949
11973
|
};
|
|
11950
11974
|
FullScreen.displayName = "FullScreen";
|
|
11951
11975
|
var FullScreen_default = FullScreen;
|
|
11952
11976
|
|
|
11953
11977
|
// src/layout/Grid/Item/Item.tsx
|
|
11954
|
-
import { jsx as
|
|
11978
|
+
import { jsx as jsx358 } from "react/jsx-runtime";
|
|
11955
11979
|
var calculateSpans = (column) => {
|
|
11956
11980
|
const spans = {};
|
|
11957
11981
|
let inherited = column.default;
|
|
@@ -11968,35 +11992,35 @@ var GridItem = ({ column, children, className }) => {
|
|
|
11968
11992
|
Object.entries(spans).forEach(([key, value]) => {
|
|
11969
11993
|
style[`--column-${key}`] = value;
|
|
11970
11994
|
});
|
|
11971
|
-
return /* @__PURE__ */
|
|
11995
|
+
return /* @__PURE__ */ jsx358("div", { className: clsx_default("lib-xplat-grid-item", className), style, children });
|
|
11972
11996
|
};
|
|
11973
11997
|
GridItem.displayName = "GridItem";
|
|
11974
11998
|
var Item_default = GridItem;
|
|
11975
11999
|
|
|
11976
12000
|
// src/layout/Header/Header.tsx
|
|
11977
|
-
import { jsx as
|
|
12001
|
+
import { jsx as jsx359, jsxs as jsxs226 } from "react/jsx-runtime";
|
|
11978
12002
|
var Header = ({
|
|
11979
12003
|
logo,
|
|
11980
12004
|
centerContent,
|
|
11981
12005
|
rightContent
|
|
11982
12006
|
}) => {
|
|
11983
12007
|
return /* @__PURE__ */ jsxs226("div", { className: "lib-xplat-layout-header", children: [
|
|
11984
|
-
/* @__PURE__ */
|
|
11985
|
-
/* @__PURE__ */
|
|
11986
|
-
/* @__PURE__ */
|
|
12008
|
+
/* @__PURE__ */ jsx359("div", { children: logo }),
|
|
12009
|
+
/* @__PURE__ */ jsx359("div", { children: centerContent }),
|
|
12010
|
+
/* @__PURE__ */ jsx359("div", { children: rightContent })
|
|
11987
12011
|
] });
|
|
11988
12012
|
};
|
|
11989
12013
|
Header.displayName = "Header";
|
|
11990
12014
|
var Header_default = Header;
|
|
11991
12015
|
|
|
11992
12016
|
// src/layout/Layout/Layout.tsx
|
|
11993
|
-
import { Fragment as Fragment7, jsx as
|
|
12017
|
+
import { Fragment as Fragment7, jsx as jsx360, jsxs as jsxs227 } from "react/jsx-runtime";
|
|
11994
12018
|
var Layout = (props) => {
|
|
11995
12019
|
const { header, sideBar, children } = props;
|
|
11996
|
-
return /* @__PURE__ */
|
|
11997
|
-
sideBar && /* @__PURE__ */
|
|
12020
|
+
return /* @__PURE__ */ jsx360("div", { className: "lib-xplat-layout", children: /* @__PURE__ */ jsxs227("div", { className: "lib-xplat-layout-content-wrapper", children: [
|
|
12021
|
+
sideBar && /* @__PURE__ */ jsx360(Fragment7, { children: sideBar }),
|
|
11998
12022
|
/* @__PURE__ */ jsxs227("div", { className: "lib-xplat-layout-content", children: [
|
|
11999
|
-
header && /* @__PURE__ */
|
|
12023
|
+
header && /* @__PURE__ */ jsx360("div", { className: "lib-xplat-layout-conent-header", children: header }),
|
|
12000
12024
|
children
|
|
12001
12025
|
] })
|
|
12002
12026
|
] }) });
|
|
@@ -12018,18 +12042,18 @@ var useSideBarContext = () => {
|
|
|
12018
12042
|
var SideBarContext_default = SideBarContext;
|
|
12019
12043
|
|
|
12020
12044
|
// src/layout/SideBar/SideBar.tsx
|
|
12021
|
-
import { jsx as
|
|
12045
|
+
import { jsx as jsx361 } from "react/jsx-runtime";
|
|
12022
12046
|
var SideBar = (props) => {
|
|
12023
12047
|
const { children, className } = props;
|
|
12024
12048
|
const [isOpen, setIsOpen] = React45.useState(true);
|
|
12025
12049
|
const handleSwitchSideBar = () => {
|
|
12026
12050
|
setIsOpen((prev) => !prev);
|
|
12027
12051
|
};
|
|
12028
|
-
return /* @__PURE__ */
|
|
12052
|
+
return /* @__PURE__ */ jsx361(
|
|
12029
12053
|
SideBarContext_default.Provider,
|
|
12030
12054
|
{
|
|
12031
12055
|
value: { isSidebarOpen: isOpen, handleSwitchSideBar },
|
|
12032
|
-
children: /* @__PURE__ */
|
|
12056
|
+
children: /* @__PURE__ */ jsx361(
|
|
12033
12057
|
"div",
|
|
12034
12058
|
{
|
|
12035
12059
|
className: clsx_default(
|
|
@@ -12363,6 +12387,7 @@ export {
|
|
|
12363
12387
|
ThumbsUpIcon_default as ThumbsUpIcon,
|
|
12364
12388
|
TimePicker_default as TimePicker,
|
|
12365
12389
|
ToastProvider,
|
|
12390
|
+
ToggleChip_default as ToggleChip,
|
|
12366
12391
|
ToggleLeftIcon_default as ToggleLeftIcon,
|
|
12367
12392
|
ToggleRightIcon_default as ToggleRightIcon,
|
|
12368
12393
|
ToolIcon_default as ToolIcon,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { FullGrid } from './FullGrid/index.cjs';
|
|
2
2
|
export { FullScreen } from './FullScreen/index.cjs';
|
|
3
3
|
export { GridItem } from './Item/index.cjs';
|
|
4
|
-
export { B as BREAKPOINT_KEYS_ORDERED, a as BreakpointKey,
|
|
4
|
+
export { B as BREAKPOINT_KEYS_ORDERED, a as BreakpointKey, G as GridColumnConfig, b as GridSpanFor } from '../../breakpoints-CKkNxA-y.cjs';
|
|
5
5
|
import 'react';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { FullGrid } from './FullGrid/index.js';
|
|
2
2
|
export { FullScreen } from './FullScreen/index.js';
|
|
3
3
|
export { GridItem } from './Item/index.js';
|
|
4
|
-
export { B as BREAKPOINT_KEYS_ORDERED, a as BreakpointKey,
|
|
4
|
+
export { B as BREAKPOINT_KEYS_ORDERED, a as BreakpointKey, G as GridColumnConfig, b as GridSpanFor } from '../../breakpoints-CKkNxA-y.js';
|
|
5
5
|
import 'react';
|
package/dist/layout/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { FullGrid } from './Grid/FullGrid/index.cjs';
|
|
2
2
|
export { FullScreen } from './Grid/FullScreen/index.cjs';
|
|
3
3
|
export { GridItem } from './Grid/Item/index.cjs';
|
|
4
|
-
export { B as BREAKPOINT_KEYS_ORDERED, a as BreakpointKey,
|
|
4
|
+
export { B as BREAKPOINT_KEYS_ORDERED, a as BreakpointKey, G as GridColumnConfig, b as GridSpanFor } from '../breakpoints-CKkNxA-y.cjs';
|
|
5
5
|
export { Header } from './Header/index.cjs';
|
|
6
6
|
export { Layout } from './Layout/index.cjs';
|
|
7
7
|
export { SideBar, SideBarContext, useSideBarContext } from './SideBar/index.cjs';
|
package/dist/layout/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { FullGrid } from './Grid/FullGrid/index.js';
|
|
2
2
|
export { FullScreen } from './Grid/FullScreen/index.js';
|
|
3
3
|
export { GridItem } from './Grid/Item/index.js';
|
|
4
|
-
export { B as BREAKPOINT_KEYS_ORDERED, a as BreakpointKey,
|
|
4
|
+
export { B as BREAKPOINT_KEYS_ORDERED, a as BreakpointKey, G as GridColumnConfig, b as GridSpanFor } from '../breakpoints-CKkNxA-y.js';
|
|
5
5
|
export { Header } from './Header/index.js';
|
|
6
6
|
export { Layout } from './Layout/index.js';
|
|
7
7
|
export { SideBar, SideBarContext, useSideBarContext } from './SideBar/index.js';
|
package/dist/tokens/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BREAKPOINT_KEYS_ORDERED, a as BreakpointKey,
|
|
1
|
+
export { B as BREAKPOINT_KEYS_ORDERED, a as BreakpointKey, G as GridColumnConfig, b as GridSpanFor, c as breakpoints, g as gridColumns } from '../breakpoints-CKkNxA-y.cjs';
|
|
2
2
|
export { TokenVar, cssVar, semantic } from '@x-plat/tokens-core';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
package/dist/tokens/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BREAKPOINT_KEYS_ORDERED, a as BreakpointKey,
|
|
1
|
+
export { B as BREAKPOINT_KEYS_ORDERED, a as BreakpointKey, G as GridColumnConfig, b as GridSpanFor, c as breakpoints, g as gridColumns } from '../breakpoints-CKkNxA-y.js';
|
|
2
2
|
export { TokenVar, cssVar, semantic } from '@x-plat/tokens-core';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
package/guidelines/Guidelines.md
CHANGED
|
@@ -55,7 +55,7 @@ React 기반 디자인 시스템 라이브러리이다. Figma Make Kit과 1:1
|
|
|
55
55
|
- [피드백](./components/feedback.md) - Alert, Toast, NotificationBadge
|
|
56
56
|
- [오버레이](./components/overlay.md) - Modal, Drawer, PopOver, Tooltip
|
|
57
57
|
- [폼 컨트롤](./components/form.md) - CheckBox, Radio, Switch
|
|
58
|
-
- [Chip & Tag](./components/chip-tag.md)
|
|
58
|
+
- [Chip & ToggleChip & Tag](./components/chip-tag.md)
|
|
59
59
|
- [내비게이션](./components/navigation.md) - Tab, CardTab, Breadcrumb, Pagination, Steps
|
|
60
60
|
- [DatePicker](./components/datepicker.md) - Calendar, DatePicker 4종
|
|
61
61
|
- [Accordion](./components/accordion.md)
|
package/guidelines/MIGRATION.md
CHANGED
|
@@ -6,6 +6,33 @@
|
|
|
6
6
|
- 최신본 URL: `https://unpkg.com/@x-plat/design-system/guidelines/MIGRATION.md`
|
|
7
7
|
- 자기 버전부터 아래로 읽어 내려가면 된다.
|
|
8
8
|
|
|
9
|
+
## 먼저: 지금 내가 위험한가
|
|
10
|
+
|
|
11
|
+
**`0.x` 에서 캐럿(`^`)은 마이너를 고정한다.** 메이저가 0 이면 npm 은 마이너 번호를
|
|
12
|
+
메이저처럼 다룬다.
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
^0.12.0 ≡ >=0.12.0 <0.13.0 ← 0.13.0 은 안 온다
|
|
16
|
+
^0.5.42 ≡ >=0.5.42 <0.6.0 ← 0.6.0 은 안 온다
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
그래서 **`install` 을 다시 돌려도 아래 변경들은 오지 않는다.** 전부
|
|
20
|
+
`package.json` 의 명시 버전을 직접 올리는 순간에 한꺼번에 온다.
|
|
21
|
+
|
|
22
|
+
이 말은 두 가지를 뜻한다.
|
|
23
|
+
|
|
24
|
+
1. **당장 안 올릴 거면 이 문서를 읽지 않아도 된다.** 지금 화면은 안 깨진다.
|
|
25
|
+
2. **올릴 때는 건너뛴 구간의 절을 전부 읽어야 한다.** 한 마이너씩 올라가는 게
|
|
26
|
+
아니라 여러 마이너를 한 번에 건너뛰게 되기 때문이다.
|
|
27
|
+
|
|
28
|
+
특히 오래 머물러 있던 저장소는 **성격이 다른 변경 둘을 한꺼번에 맞는다.**
|
|
29
|
+
`0.5.x` 에서 최신으로 올리면 [0.6.0 CSS 변수 개명](#05x--060--css-변수-이름-전면-교체)과
|
|
30
|
+
[0.13.0 `label` 의미 변경](#0120--0130--fileupload--imageselector-의-label-뜻이-바뀜)을
|
|
31
|
+
같이 겪는다. **둘 다 타입이나 빌드가 잡아 주지 않고 화면만 바뀐다.** 이관 후
|
|
32
|
+
눈으로 확인할 것.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
9
36
|
## 이 문서를 믿어도 되는 범위
|
|
10
37
|
|
|
11
38
|
각 항목은 **커밋 해시**를 달아 뒀다. 커밋 제목만 보고 판단하지 말 것 —
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Chip & Tag
|
|
1
|
+
# Chip & ToggleChip & Tag
|
|
2
2
|
|
|
3
3
|
## Chip
|
|
4
4
|
|
|
@@ -41,9 +41,82 @@
|
|
|
41
41
|
|
|
42
42
|
---
|
|
43
43
|
|
|
44
|
+
## ToggleChip
|
|
45
|
+
|
|
46
|
+
**눌러서 고르는** 칩이다. 켜짐/꺼짐을 다룬다 — `Tag` 의 클릭은 삭제이고, 이쪽은
|
|
47
|
+
삭제가 아니다.
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
<ToggleChip selected={picked.has("ko")} onClick={() => toggle("ko")}>
|
|
51
|
+
한국어
|
|
52
|
+
</ToggleChip>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
| Prop | 타입 | 기본값 | 설명 |
|
|
56
|
+
|------|------|--------|------|
|
|
57
|
+
| children | `ReactNode` | — | 내용 |
|
|
58
|
+
| selected | `boolean` | `false` | 켜진 상태. `aria-pressed` 도 함께 바뀐다 |
|
|
59
|
+
| onClick | `() => void` | — | 누를 때 |
|
|
60
|
+
| disabled | `boolean` | `false` | 흐리게 하고 못 누르게 한다 |
|
|
61
|
+
| size | `"sm" \| "md" \| "lg"` | `"md"` | `Chip` 과 같은 눈금 |
|
|
62
|
+
|
|
63
|
+
**여러 개 고르기와 한 개 고르기 양쪽에 쓴다.** 몇 개까지 켤 수 있는지, 마지막
|
|
64
|
+
하나를 뗄 수 있는지 같은 규칙은 쓰는 쪽 사정이라 여기서 정하지 않는다. 묶어
|
|
65
|
+
주는 껍데기도 없다 — 낱개로 늘어놓고 상태만 쥐고 있으면 된다.
|
|
66
|
+
|
|
67
|
+
```tsx
|
|
68
|
+
// 여러 개 고르기
|
|
69
|
+
const [picked, setPicked] = useState<Set<string>>(new Set());
|
|
70
|
+
const toggle = (v: string) =>
|
|
71
|
+
setPicked((prev) => {
|
|
72
|
+
const next = new Set(prev);
|
|
73
|
+
next.has(v) ? next.delete(v) : next.add(v);
|
|
74
|
+
return next;
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
{OPTIONS.map((o) => (
|
|
78
|
+
<ToggleChip key={o.value} selected={picked.has(o.value)} onClick={() => toggle(o.value)}>
|
|
79
|
+
{o.label}
|
|
80
|
+
</ToggleChip>
|
|
81
|
+
))}
|
|
82
|
+
|
|
83
|
+
// 한 개 고르기 (거르개)
|
|
84
|
+
{FILTERS.map((f) => (
|
|
85
|
+
<ToggleChip key={f} selected={filter === f} onClick={() => setFilter(f)}>
|
|
86
|
+
{f}
|
|
87
|
+
</ToggleChip>
|
|
88
|
+
))}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
`Chip` 과 **같은 알약 모양·같은 크기 눈금**을 쓴다. 두 CSS 가 따로 있는 게
|
|
92
|
+
아니라 `ToggleChip` 이 `.lib-xplat-chip` 을 그대로 입고 상호작용분만 얹으므로
|
|
93
|
+
둘이 따로 놀 수 없다. 거르개 칩 아래에 표시용 `Chip` 이 깔리는 화면에서
|
|
94
|
+
겉돌지 않는다.
|
|
95
|
+
|
|
96
|
+
색은 `Chip` 의 상태 색(primary·success…)을 받지 않는다. **고른 것과 안 고른 것**
|
|
97
|
+
두 가지뿐이라 상태 색 어휘가 끼어들 자리가 없다. 고른 것은 옅은 브랜드 바탕에
|
|
98
|
+
브랜드 테두리다 — 여러 개를 한꺼번에 켜는 쓰임이 더 많은데 진한 채움이 여럿이면
|
|
99
|
+
화면이 시끄럽고 곁의 버튼과 구분이 안 된다.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
44
103
|
## 의사결정
|
|
45
104
|
|
|
46
105
|
| 상황 | 사용할 것 |
|
|
47
106
|
|------|----------|
|
|
48
|
-
| 상태/분류 라벨 (
|
|
107
|
+
| 상태/분류 라벨 (누를 일 없음) | Chip |
|
|
108
|
+
| 눌러서 고르기 (켜짐/꺼짐) | **ToggleChip** |
|
|
49
109
|
| 사용자가 제거할 수 있는 태그 | Tag |
|
|
110
|
+
| 개수·점 표시 | NotificationBadge |
|
|
111
|
+
|
|
112
|
+
셋이 비슷하게 생겼으므로 **무엇이 일어나는가**로 고른다.
|
|
113
|
+
|
|
114
|
+
| | 누르면 | 렌더 |
|
|
115
|
+
|---|---|---|
|
|
116
|
+
| `Chip` | 아무 일도 없다 | `<div>` |
|
|
117
|
+
| `ToggleChip` | 켜지거나 꺼진다 | `<button aria-pressed>` |
|
|
118
|
+
| `Tag` | (X 를 누르면) 사라진다 | `<span>` + 닫기 `<button>` |
|
|
119
|
+
|
|
120
|
+
> 고르는 칩을 `Chip` 을 `<button>` 으로 감싸서 만들지 말 것. 커서·초점 테두리·
|
|
121
|
+
> `aria-pressed` 가 빠지고, 실제로 그렇게 만든 화면들에서 **아무도 누를 수 있는
|
|
122
|
+
> 줄 몰랐다.** `ToggleChip` 이 그 셋을 기본으로 갖는다.
|