slice-machine-ui 2.1.1-alpha.lh-delete-repeatable-zone-model-warning.2 → 2.1.1-beta.2
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/.depcheckrc +0 -1
- package/next.config.mjs +1 -4
- package/out/404.html +1 -1
- package/out/_next/static/Gw4eXOE5EqeLdC_fSnsHZ/_buildManifest.js +1 -0
- package/out/_next/static/chunks/152-c40fcb226b0df27f.js +1 -0
- package/out/_next/static/chunks/{18539003-32a73014bab3a789.js → 18539003-eda642ad962ef598.js} +2 -2
- package/out/_next/static/chunks/212-8e3e36f1dcc00ef3.js +1 -0
- package/out/_next/static/chunks/264-4bb6f3fb14863ef3.js +1 -0
- package/out/_next/static/chunks/465-47a6d2a5f66f521e.js +1 -0
- package/out/_next/static/chunks/{50-cfc2514205b86001.js → 50-8d014b6d3cc35e30.js} +1 -1
- package/out/_next/static/chunks/574-6039c48fbc93b4a8.js +1 -0
- package/out/_next/static/chunks/{210-aee6116139329803.js → 66-d37d30551288858b.js} +2 -2
- package/out/_next/static/chunks/{756-b11a3060cdc2f2d3.js → 756-1e44fe84bedc262b.js} +3 -3
- package/out/_next/static/chunks/816-68d4db26c0adab2e.js +1 -0
- package/out/_next/static/chunks/{918-5bb55fb464e34768.js → 918-09e9e4a012d48a3a.js} +1 -1
- package/out/_next/static/chunks/main-207ecb3e9b995dd9.js +1 -0
- package/out/_next/static/chunks/pages/{_app-3e4983279aa9cc00.js → _app-830444cf7b0539f1.js} +133 -133
- package/out/_next/static/chunks/pages/{_error-69b4f498bafdd188.js → _error-6aa4c7b8478d35e3.js} +1 -1
- package/out/_next/static/chunks/pages/changelog-d309ea186a0e56bf.js +1 -0
- package/out/_next/static/chunks/pages/changes-1bb1a7b784a22151.js +1 -0
- package/out/_next/static/chunks/pages/custom-types/[customTypeId]-74be2c0ac9c854c7.js +1 -0
- package/out/_next/static/chunks/pages/custom-types-bac97f007a5ca743.js +1 -0
- package/out/_next/static/chunks/pages/{index-41fcbf4361de7317.js → index-785a0ab6e2a4fc27.js} +1 -1
- package/out/_next/static/chunks/pages/{labs-ef915adf4601f422.js → labs-2e4f3a5f68e65b93.js} +1 -1
- package/out/_next/static/chunks/pages/page-types/[pageTypeId]-d35c87b9aaec445a.js +1 -0
- package/out/_next/static/chunks/pages/settings-25eb02893ed871b7.js +1 -0
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-b47a72d5e94bd946.js +1 -0
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-921f459ea4e05117.js +1 -0
- package/out/_next/static/chunks/pages/slices-cc44eeccd58d23a9.js +1 -0
- package/out/_next/static/css/b3bb731ce567d63f.css +1 -0
- package/out/_next/static/css/d0dd8015d7f5ea89.css +1 -0
- package/out/changelog.html +1 -1
- package/out/changes.html +1 -1
- package/out/custom-types/[customTypeId].html +1 -1
- package/out/custom-types.html +1 -1
- package/out/index.html +1 -1
- package/out/labs.html +1 -1
- package/out/page-types/[pageTypeId].html +1 -1
- package/out/settings.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
- package/out/slices.html +1 -1
- package/package.json +6 -10
- package/src/components/Card/Card.stories.tsx +4 -6
- package/src/components/FieldSet/FieldSet.stories.tsx +6 -12
- package/src/features/changes/BlankSlates/NoChangesBlankSlate.tsx +2 -2
- package/src/features/customTypes/customTypesTable/CustomTypesTable.tsx +1 -2
- package/src/features/settings/git/GitOwnerSelect.tsx +2 -2
- package/src/features/settings/git/GitProviderConnectButtons.tsx +2 -2
- package/src/features/slices/sliceCards/SharedSliceCard.tsx +2 -4
- package/src/legacy/components/Changelog/navigation/index.tsx +3 -3
- package/src/legacy/components/Changelog/versionDetails/index.tsx +2 -2
- package/src/legacy/lib/builders/CustomTypeBuilder/index.tsx +7 -6
- package/src/legacy/lib/builders/SliceBuilder/FieldZones/index.tsx +8 -24
- package/src/legacy/lib/builders/SliceBuilder/SimulatorButton/index.tsx +4 -4
- package/vite.config.ts +1 -2
- package/out/_next/static/M2ofVpbE71V-Mblcx06A2/_buildManifest.js +0 -1
- package/out/_next/static/chunks/188-ee59edb19bc752c3.js +0 -1
- package/out/_next/static/chunks/339-905c2ce3609b74fe.js +0 -1
- package/out/_next/static/chunks/569-2ae3e9666f3bf991.js +0 -1
- package/out/_next/static/chunks/614-5130fbdbcfab2d35.js +0 -1
- package/out/_next/static/chunks/661-aa0b760bb52a7edf.js +0 -1
- package/out/_next/static/chunks/90-2d4bdae13d031364.js +0 -1
- package/out/_next/static/chunks/main-5e6780279ca21cb9.js +0 -1
- package/out/_next/static/chunks/pages/changelog-fa4f69f69dafb8f0.js +0 -1
- package/out/_next/static/chunks/pages/changes-86bf0b1b09af60fa.js +0 -1
- package/out/_next/static/chunks/pages/custom-types/[customTypeId]-982ecf1d799b6bcf.js +0 -1
- package/out/_next/static/chunks/pages/custom-types-19c4fe4abeca8a48.js +0 -1
- package/out/_next/static/chunks/pages/page-types/[pageTypeId]-886fc28240831dae.js +0 -1
- package/out/_next/static/chunks/pages/settings-99f7a183397cb097.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-9bdb355306fca592.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-49a10d6fc458cce2.js +0 -1
- package/out/_next/static/chunks/pages/slices-f65c48ab547692c4.js +0 -1
- package/out/_next/static/css/037ba37d121d4afe.css +0 -1
- package/out/_next/static/css/a6b6600e19e1c0c1.css +0 -1
- package/src/components/Window/Window.css.ts +0 -165
- package/src/components/Window/Window.stories.tsx +0 -135
- package/src/components/Window/Window.tsx +0 -119
- package/src/components/Window/index.ts +0 -8
- /package/out/_next/static/{M2ofVpbE71V-Mblcx06A2 → Gw4eXOE5EqeLdC_fSnsHZ}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._1k08lzu3{height:calc(var(--_7j49md4m) - var(--_7j49mdh))}._1k08lzu5{height:calc(var(--_7j49md4b) - var(--_7j49md47));width:calc(var(--_7j49md4b) - var(--_7j49md47))}._1k08lzu7{box-shadow:inset 0 calc(-1 * var(--_7j49mdh)) 0 0 var(--_7j49md1d);height:calc(var(--_7j49md4m) - var(--_7j49mdh));-ms-overflow-style:none;scrollbar-width:none}._1k08lzu7::-webkit-scrollbar{display:none}._1k08lzu3+._1k08lzu6>._1k08lzu7{padding-top:var(--_7j49mdh)}._1k08lzu8:last-child:before,:not(:is(:focus,:hover,[data-state=active]))+._1k08lzu8:before{content:"";background-color:var(--_7j49md1e);bottom:var(--_7j49md53);height:var(--_7j49md4i);left:calc(-1 * var(--_7j49md4z));position:absolute;width:var(--_7j49mdh)}._1k08lzu9{max-width:256px}._1k08lzu9[data-state=active]{color:var(--_7j49md1j)}._1k08lzu9:is(:focus,:hover,[data-state=active]):before{content:"";background-color:var(--_7j49md19);border-color:var(--_7j49md1d);border-top-left-radius:var(--_7j49md7);border-top-right-radius:var(--_7j49md7);border-style:var(--_7j49mdf) var(--_7j49mdf) var(--_7j49mdd);border-width:var(--_7j49mdh);box-sizing:border-box;height:calc(var(--_7j49md4s) + var(--_7j49mdh));left:calc(-1 * var(--_7j49mdh));position:absolute;top:calc(-1 * var(--_7j49mdh));width:calc(var(--_7j49md4s) + var(--_7j49mdh))}._1k08lzub{margin-right:calc(-1 * var(--_7j49md53))}:is(:focus,:hover,[data-state=active])>._1k08lzub{visibility:visible}._1k08lzub:has(>[data-state=open]){visibility:visible}._1k08lzuc{box-shadow:inset 0 calc(-1 * var(--_7j49mdh)) 0 0 var(--_7j49md1d),0 calc(-1 * var(--_7j49mdh)) 0 0 var(--_7j49md1a)}._1k08lzud[data-state=inactive]{display:none}.List_flex__v0QQS{all:unset;display:flex}.List_row__sBVx1{flex-direction:row}.List_root__f9klF{border-color:var(--grey6);flex-direction:column;overflow-x:hidden}.List_root-border__2nh4p{border-radius:6px;border-style:solid;border-width:1px}.List_child__O_eM9{align-items:center;border-bottom-color:var(--grey6);border-bottom-width:1px;box-sizing:border-box;height:48px;padding-right:8px}.List_child__O_eM9:last-child{border-bottom-color:transparent}.List_header__J5e8m{background-color:var(--grey2);border-bottom-style:solid;gap:8px;padding-left:16px}.List_headerActions__FqUvW{align-items:center;flex-grow:1;gap:8px;justify-content:end;min-width:0}.List_item__t5SQz{background-color:var(--grey1);border-bottom-style:dashed;padding-left:12px}.ZoneEmptyState_root__K6dwt{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;background-color:var(--grey3);text-align:center;padding-top:32px;padding-bottom:32px;min-height:288px}.BlankSlate_column__ysDb2{all:unset;box-sizing:border-box;display:flex;flex-direction:column}.BlankSlate_root__DJ7wC{max-width:498px;min-height:400px;animation:BlankSlate_fadeIn__KMuKu ease-in-out 300;border-color:var(--grey6);border-radius:6px;border-style:solid;border-width:1px;overflow:hidden;background-color:var(--light-grey1)}.BlankSlate_withBackground___V5y5{width:100%;max-width:100%;height:100%;text-align:center;background-size:cover;background-color:transparent;border-radius:0;border-style:none}.BlankSlate_image__rOe9w{border-bottom:1px solid var(--grey6);overflow:hidden}.BlankSlate_content__wmOAI{padding:32px}.BlankSlate_withBackground___V5y5 .BlankSlate_content__wmOAI{padding:64px}.BlankSlate_title__5oTre{font-size:18px;font-weight:600;line-height:32px}.BlankSlate_desc__f6ZWf{font-weight:400;line-height:24px}.BlankSlate_withBackground___V5y5 .BlankSlate_desc__f6ZWf{max-width:464px;align-self:center}.BlankSlate_actions__6zYZr{all:unset;align-items:center;box-sizing:border-box;display:flex;gap:16px;margin-top:16px}.BlankSlate_withBackground___V5y5 .BlankSlate_actions__6zYZr{justify-content:center}.Card_flex__rWbYX{all:unset;display:flex}.Card_grid__2SfEP{all:unset;display:grid}.Card_column__Svw4j{flex-direction:column}.Card_root__nmIAy{position:relative;box-sizing:border-box;border-color:var(--grey6);border-radius:6px;border-style:solid;border-width:1px;overflow-x:hidden}.Card_size-small__gpkDz{height:240px}.Card_size-medium__O933V{height:320px}.Card_solid__Tx416{background-color:var(--grey3)}.Card_solid__Tx416[data-state=checked]{border-color:var(--purple10)}.Card_outlined__Qc3KT{background-color:var(--grey2)}.Card_outlined__Qc3KT[data-state=checked]{border-color:var(--purple8)}.Card_interactive__o6QZt:focus-visible{box-shadow:var(--box-shadow-purple-focus)}.Card_interactive__o6QZt[data-disabled]{opacity:.5}.Card_interactive__o6QZt:not([data-disabled]){cursor:pointer}.Card_interactive__o6QZt.Card_solid__Tx416:focus-visible{background-color:var(--grey5);border-color:var(--purple10)}.Card_interactive__o6QZt.Card_outlined__Qc3KT:active{background-color:var(--grey4);border-color:var(--purple9)}.Card_interactive__o6QZt.Card_outlined__Qc3KT:focus-visible{background-color:var(--grey1);border-color:var(--purple8)}.Card_interactive__o6QZt.Card_outlined__Qc3KT:hover{background-color:var(--grey4)}.Card_media__lIyZ7{flex-basis:0;flex-grow:1;min-height:0;position:relative;order:0}.Card_solid__Tx416>.Card_media__lIyZ7{padding:32px}.Card_outlined__Qc3KT>.Card_media__lIyZ7{background-color:var(--light-grey3);margin-inline:16px;margin-top:16px;padding:16px}.Card_mediaComponent-div__4DTTy{flex-grow:1}.Card_mediaComponent-img__GFdbs{height:100%;-o-object-fit:contain;object-fit:contain}.Card_mediaComponent-img__GFdbs:not([src]){visibility:hidden}.Card_mediaOverlay__ax3Tc{inset:0;position:absolute;visibility:hidden}.Card_mediaOverlay__ax3Tc:before{background-color:var(--light-grey12);content:"";inset:0;opacity:.1;position:absolute}.Card_interactive__o6QZt:focus-visible .Card_mediaOverlay__ax3Tc,.Card_interactive__o6QZt:not([data-disabled]) .Card_mediaOverlay__ax3Tc:has(:focus-visible),.Card_interactive__o6QZt:not([data-disabled]) .Card_media__lIyZ7:hover>.Card_mediaOverlay__ax3Tc{visibility:visible}.Card_nonMedia__ts5oN{align-items:center;box-sizing:border-box;flex-direction:row}.Card_solid__Tx416>.Card_nonMedia__ts5oN{background-color:var(--light-grey1)}.Card_solid__Tx416>.Card_nonMedia__ts5oN:not(:first-child){border-top-color:var(--light-grey6);border-top-style:solid;border-top-width:inherit}.Card_actions__7mTeM{height:48px;justify-content:space-between;order:1}.Card_solid__Tx416>.Card_actions__7mTeM{padding-left:12px;padding-right:8px}.Card_outlined__Qc3KT>.Card_actions__7mTeM{padding-inline:16px}.Card_footer__2UBoj{gap:8px;height:60px;order:2}.Card_solid__Tx416>.Card_footer__2UBoj{padding-inline:12px}.Card_outlined__Qc3KT>.Card_footer__2UBoj{padding-inline:16px}.Card_footerTexts__Lf0fw{flex-basis:0;flex-grow:1;min-width:0;margin-bottom:4px}.Card_status__cmKRp{height:24px;inset-inline:0;justify-content:center;padding-inline:8px;position:absolute;background-color:var(--purple4);color:var(--purple11)}.ConvertLegacySliceButton_scrollArea__gW7L4{width:448px;height:100%;display:flex;gap:8px;padding-inline:16px;padding-block:16px}.ConvertLegacySliceButton_label__yP2Pt{display:inline-flex;align-items:center;gap:4px}.ContentTabs_flex__kAimf{all:unset;display:flex}.ContentTabs_column__x5QZL{flex-direction:column}.ContentTabs_root__GPtve{background-color:var(--grey1);min-height:0}.ContentTabs_list__XarTi{border-bottom:1px solid var(--grey5);padding-inline:16px}.ContentTabs_trigger__8hs6H{color:var(--grey11);cursor:pointer;padding-block:8px}.ContentTabs_trigger__8hs6H:not(:last-child){margin-right:16px}.ContentTabs_trigger__8hs6H[data-state=active]{box-shadow:inset 0 -1px 0 0 currentColor,0 1px 0 0 currentColor;color:var(--purple9)}.ContentTabs_triggerText__ka3DD{line-height:32px}.ContentTabs_content__mMr1s{min-height:0;outline:none;flex:1 1}.ContentTabs_content__mMr1s[data-state=inactive]{display:none}.ContentTabs_scrollArea__ZBVHa{padding:16px}.CodeBlock_block__ljak4{all:unset;box-sizing:border-box;font-family:var(--font-family-body)}.CodeBlock_blockWithDisplayRevert__zM3Ns{display:revert}.CodeBlock_root__3ZYFL{border-width:1px;border-radius:6px;border-style:solid;border-color:var(--grey6)}.CodeBlock_header__kLT1f{border-top-right-radius:4px;border-top-left-radius:4px;background-color:var(--grey2);border-bottom:1px solid var(--grey6);padding-block:4px;padding-right:4px}.CodeBlock_fileInfo__ocLpL,.CodeBlock_header__kLT1f{display:flex;align-items:center;justify-content:space-between}.CodeBlock_fileName__jmuEV{font-size:calc(14rem / 16);line-height:calc(32rem / 16)}.MarkdownRenderer_section__4QTyU{padding-bottom:16px}.MarkdownRenderer_inlineCode__Oois6{font-family:var(--font-family-code);background-color:var(--grey2);border-radius:6px;padding-block:2px;padding-inline:4px}.PageSnippetDialog_content___SDjB{display:flex;flex-direction:column;min-height:0;gap:12px;overflow:hidden;grid-area:content}
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import { colors, sprinkles, vars } from "@prismicio/editor-ui";
|
|
2
|
-
import { style } from "@vanilla-extract/css";
|
|
3
|
-
import { calc } from "@vanilla-extract/css-utils";
|
|
4
|
-
|
|
5
|
-
const flex = sprinkles({ all: "unset", display: "flex" });
|
|
6
|
-
|
|
7
|
-
const column = style([flex, sprinkles({ flexDirection: "column" })]);
|
|
8
|
-
|
|
9
|
-
const row = style([flex, sprinkles({ flexDirection: "row" })]);
|
|
10
|
-
|
|
11
|
-
export const root = style([
|
|
12
|
-
column,
|
|
13
|
-
sprinkles({
|
|
14
|
-
backgroundColor: colors.grey3,
|
|
15
|
-
borderColor: colors.grey6,
|
|
16
|
-
borderRadius: 6,
|
|
17
|
-
borderStyle: "solid",
|
|
18
|
-
borderWidth: 1,
|
|
19
|
-
overflowX: "hidden",
|
|
20
|
-
}),
|
|
21
|
-
// The following `{}` is necessary for the `root` class to work in selectors.
|
|
22
|
-
// It helps us remove the `List` component's borders when used in a `Window`.
|
|
23
|
-
{},
|
|
24
|
-
]);
|
|
25
|
-
|
|
26
|
-
export const frame = style([
|
|
27
|
-
row,
|
|
28
|
-
sprinkles({ alignItems: "center", paddingInline: 16 }),
|
|
29
|
-
{ height: calc.subtract(vars.size[48], vars.borderWidth[1]) },
|
|
30
|
-
]);
|
|
31
|
-
|
|
32
|
-
export const titleBarOptions = style([row, sprinkles({ gap: 8 })]);
|
|
33
|
-
|
|
34
|
-
export const titleBarOption = style([
|
|
35
|
-
column,
|
|
36
|
-
sprinkles({ backgroundColor: colors.grey5, borderRadius: "50%" }),
|
|
37
|
-
{
|
|
38
|
-
height: calc.subtract(vars.size[12], vars.size[1]),
|
|
39
|
-
width: calc.subtract(vars.size[12], vars.size[1]),
|
|
40
|
-
},
|
|
41
|
-
]);
|
|
42
|
-
|
|
43
|
-
export const tabs = style([column, sprinkles({ flexGrow: 1 })]);
|
|
44
|
-
|
|
45
|
-
export const tabsList = style([
|
|
46
|
-
row,
|
|
47
|
-
sprinkles({ overflowX: "auto" }),
|
|
48
|
-
{
|
|
49
|
-
boxShadow: `inset 0 ${calc.multiply(-1, vars.borderWidth[1])} 0 0 ${
|
|
50
|
-
vars.color.greyLight6
|
|
51
|
-
}`,
|
|
52
|
-
height: calc.subtract(vars.size[48], vars.borderWidth[1]),
|
|
53
|
-
msOverflowStyle: "none",
|
|
54
|
-
scrollbarWidth: "none",
|
|
55
|
-
"::-webkit-scrollbar": { display: "none" },
|
|
56
|
-
selectors: {
|
|
57
|
-
[`${frame} + ${tabs} > &`]: { paddingTop: vars.borderWidth[1] },
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
]);
|
|
61
|
-
|
|
62
|
-
const tabsListChild = style([
|
|
63
|
-
row,
|
|
64
|
-
sprinkles({ alignItems: "center", paddingBottom: 1 }),
|
|
65
|
-
{
|
|
66
|
-
selectors: {
|
|
67
|
-
':not(:is(:focus, :hover, [data-state="active"])) + &::before, &:last-child::before':
|
|
68
|
-
{
|
|
69
|
-
backgroundColor: vars.color.greyLight7,
|
|
70
|
-
bottom: vars.space[8],
|
|
71
|
-
content: "",
|
|
72
|
-
height: vars.size[32],
|
|
73
|
-
left: calc.multiply(-1, vars.space[1]),
|
|
74
|
-
position: "absolute",
|
|
75
|
-
width: vars.borderWidth[1],
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
]);
|
|
80
|
-
|
|
81
|
-
export const tabsTrigger = style([
|
|
82
|
-
tabsListChild,
|
|
83
|
-
sprinkles({
|
|
84
|
-
boxSizing: "border-box",
|
|
85
|
-
color: colors.grey11,
|
|
86
|
-
cursor: "pointer",
|
|
87
|
-
gap: 8,
|
|
88
|
-
paddingInline: 16,
|
|
89
|
-
position: "relative",
|
|
90
|
-
}),
|
|
91
|
-
{
|
|
92
|
-
maxWidth: "256px",
|
|
93
|
-
selectors: {
|
|
94
|
-
'&[data-state="active"]': {
|
|
95
|
-
color: vars.color.greyLight12,
|
|
96
|
-
},
|
|
97
|
-
'&:is(:focus, :hover, [data-state="active"])::before': {
|
|
98
|
-
backgroundColor: vars.color.greyLight2,
|
|
99
|
-
borderBottomStyle: vars.borderStyle.none,
|
|
100
|
-
borderColor: vars.color.greyLight6,
|
|
101
|
-
borderLeftStyle: vars.borderStyle.solid,
|
|
102
|
-
borderRightStyle: vars.borderStyle.solid,
|
|
103
|
-
borderTopLeftRadius: vars.borderRadius[6],
|
|
104
|
-
borderTopRightRadius: vars.borderRadius[6],
|
|
105
|
-
borderTopStyle: vars.borderStyle.solid,
|
|
106
|
-
borderWidth: vars.borderWidth[1],
|
|
107
|
-
boxSizing: "border-box",
|
|
108
|
-
content: "",
|
|
109
|
-
height: calc.add(vars.size["100%"], vars.borderWidth[1]),
|
|
110
|
-
left: calc.multiply(-1, vars.borderWidth[1]),
|
|
111
|
-
position: "absolute",
|
|
112
|
-
top: calc.multiply(-1, vars.borderWidth[1]),
|
|
113
|
-
width: calc.add(vars.size["100%"], vars.borderWidth[1]),
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
]);
|
|
118
|
-
|
|
119
|
-
const tabsTriggerChild = sprinkles({ position: "relative" });
|
|
120
|
-
|
|
121
|
-
export const tabsTriggerText = style([
|
|
122
|
-
tabsTriggerChild,
|
|
123
|
-
sprinkles({ flexGrow: 1 }),
|
|
124
|
-
]);
|
|
125
|
-
|
|
126
|
-
export const tabsTriggerMenu = style([
|
|
127
|
-
tabsTriggerChild,
|
|
128
|
-
sprinkles({ visibility: "hidden" }),
|
|
129
|
-
{
|
|
130
|
-
marginRight: calc.multiply(-1, vars.space[8]),
|
|
131
|
-
selectors: {
|
|
132
|
-
':is(:focus, :hover, [data-state="active"]) > &': {
|
|
133
|
-
visibility: "visible",
|
|
134
|
-
},
|
|
135
|
-
'&:has(> [data-state="open"])': { visibility: "visible" },
|
|
136
|
-
},
|
|
137
|
-
},
|
|
138
|
-
]);
|
|
139
|
-
|
|
140
|
-
export const newTabButton = style([
|
|
141
|
-
tabsListChild,
|
|
142
|
-
sprinkles({
|
|
143
|
-
backgroundColor: colors.grey3,
|
|
144
|
-
paddingInline: 8,
|
|
145
|
-
position: "sticky",
|
|
146
|
-
right: 0,
|
|
147
|
-
}),
|
|
148
|
-
{
|
|
149
|
-
boxShadow: `inset 0 ${calc.multiply(-1, vars.borderWidth[1])} 0 0 ${
|
|
150
|
-
vars.color.greyLight6
|
|
151
|
-
}, 0 ${calc.multiply(-1, vars.borderWidth[1])} 0 0 ${
|
|
152
|
-
vars.color.greyLight3
|
|
153
|
-
}`,
|
|
154
|
-
},
|
|
155
|
-
]);
|
|
156
|
-
|
|
157
|
-
export const tabsContent = style([
|
|
158
|
-
sprinkles({
|
|
159
|
-
all: "unset",
|
|
160
|
-
backgroundColor: colors.grey2,
|
|
161
|
-
display: "grid",
|
|
162
|
-
flexGrow: 1,
|
|
163
|
-
}),
|
|
164
|
-
{ selectors: { '&[data-state="inactive"]': { display: "none" } } },
|
|
165
|
-
]);
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { DropdownMenuItem } from "@prismicio/editor-ui";
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
Window,
|
|
6
|
-
WindowFrame,
|
|
7
|
-
WindowTabs,
|
|
8
|
-
WindowTabsContent,
|
|
9
|
-
WindowTabsList,
|
|
10
|
-
WindowTabsTrigger,
|
|
11
|
-
} from "./Window";
|
|
12
|
-
|
|
13
|
-
type Story = StoryObj<typeof meta>;
|
|
14
|
-
|
|
15
|
-
const meta = {
|
|
16
|
-
component: Window,
|
|
17
|
-
argTypes: { children: { control: { disable: true } } },
|
|
18
|
-
} satisfies Meta<typeof Window>;
|
|
19
|
-
|
|
20
|
-
export default meta;
|
|
21
|
-
|
|
22
|
-
export const Default = {
|
|
23
|
-
args: {
|
|
24
|
-
children: (
|
|
25
|
-
<>
|
|
26
|
-
<WindowFrame />
|
|
27
|
-
<WindowTabs defaultValue="tab-0">
|
|
28
|
-
<WindowTabsList>
|
|
29
|
-
<WindowTabsTrigger
|
|
30
|
-
menu={<DropdownMenuItem>Item</DropdownMenuItem>}
|
|
31
|
-
value="tab-0"
|
|
32
|
-
>
|
|
33
|
-
Tab 1
|
|
34
|
-
</WindowTabsTrigger>
|
|
35
|
-
<WindowTabsTrigger
|
|
36
|
-
menu={<DropdownMenuItem>Item</DropdownMenuItem>}
|
|
37
|
-
value="tab-1"
|
|
38
|
-
>
|
|
39
|
-
Tab 2
|
|
40
|
-
</WindowTabsTrigger>
|
|
41
|
-
</WindowTabsList>
|
|
42
|
-
<WindowTabsContent value="tab-0">Tab 1</WindowTabsContent>
|
|
43
|
-
<WindowTabsContent value="tab-1">Tab 2</WindowTabsContent>
|
|
44
|
-
</WindowTabs>
|
|
45
|
-
</>
|
|
46
|
-
),
|
|
47
|
-
style: { boxSizing: "border-box", height: "256px" },
|
|
48
|
-
},
|
|
49
|
-
} satisfies Story;
|
|
50
|
-
|
|
51
|
-
export const WithListOverflow = {
|
|
52
|
-
args: {
|
|
53
|
-
...Default.args,
|
|
54
|
-
children: (
|
|
55
|
-
<>
|
|
56
|
-
<WindowFrame />
|
|
57
|
-
<WindowTabs defaultValue="tab-0">
|
|
58
|
-
<WindowTabsList>
|
|
59
|
-
{[...Array(100).keys()].map((index) => (
|
|
60
|
-
<WindowTabsTrigger
|
|
61
|
-
key={index}
|
|
62
|
-
menu={<DropdownMenuItem>Item</DropdownMenuItem>}
|
|
63
|
-
value={`tab-${index}`}
|
|
64
|
-
>
|
|
65
|
-
Tab {index + 1}
|
|
66
|
-
</WindowTabsTrigger>
|
|
67
|
-
))}
|
|
68
|
-
</WindowTabsList>
|
|
69
|
-
{[...Array(100).keys()].map((index) => (
|
|
70
|
-
<WindowTabsContent key={index} value={`tab-${index}`}>
|
|
71
|
-
Tab {index + 1}
|
|
72
|
-
</WindowTabsContent>
|
|
73
|
-
))}
|
|
74
|
-
</WindowTabs>
|
|
75
|
-
</>
|
|
76
|
-
),
|
|
77
|
-
},
|
|
78
|
-
} satisfies Story;
|
|
79
|
-
|
|
80
|
-
export const WithTriggerOverflow = {
|
|
81
|
-
args: {
|
|
82
|
-
...Default.args,
|
|
83
|
-
children: (
|
|
84
|
-
<>
|
|
85
|
-
<WindowFrame />
|
|
86
|
-
<WindowTabs defaultValue="tab-0">
|
|
87
|
-
<WindowTabsList>
|
|
88
|
-
<WindowTabsTrigger
|
|
89
|
-
menu={<DropdownMenuItem>Item</DropdownMenuItem>}
|
|
90
|
-
value="tab-0"
|
|
91
|
-
>
|
|
92
|
-
Tab 1
|
|
93
|
-
</WindowTabsTrigger>
|
|
94
|
-
<WindowTabsTrigger
|
|
95
|
-
menu={<DropdownMenuItem>Item</DropdownMenuItem>}
|
|
96
|
-
value="lorem-ipsum"
|
|
97
|
-
>
|
|
98
|
-
Lorem ipsum dolor sit amet, consectetur.
|
|
99
|
-
</WindowTabsTrigger>
|
|
100
|
-
</WindowTabsList>
|
|
101
|
-
<WindowTabsContent value="tab-0">Tab 1</WindowTabsContent>
|
|
102
|
-
<WindowTabsContent value="lorem-ipsum">
|
|
103
|
-
Lorem ipsum dolor sit amet, consectetur.
|
|
104
|
-
</WindowTabsContent>
|
|
105
|
-
</WindowTabs>
|
|
106
|
-
</>
|
|
107
|
-
),
|
|
108
|
-
},
|
|
109
|
-
} satisfies Story;
|
|
110
|
-
|
|
111
|
-
export const WithoutFrame = {
|
|
112
|
-
args: {
|
|
113
|
-
...Default.args,
|
|
114
|
-
children: (
|
|
115
|
-
<WindowTabs defaultValue="tab-0">
|
|
116
|
-
<WindowTabsList>
|
|
117
|
-
<WindowTabsTrigger
|
|
118
|
-
menu={<DropdownMenuItem>Item</DropdownMenuItem>}
|
|
119
|
-
value="tab-0"
|
|
120
|
-
>
|
|
121
|
-
Tab 1
|
|
122
|
-
</WindowTabsTrigger>
|
|
123
|
-
<WindowTabsTrigger
|
|
124
|
-
menu={<DropdownMenuItem>Item</DropdownMenuItem>}
|
|
125
|
-
value="tab-1"
|
|
126
|
-
>
|
|
127
|
-
Tab 2
|
|
128
|
-
</WindowTabsTrigger>
|
|
129
|
-
</WindowTabsList>
|
|
130
|
-
<WindowTabsContent value="tab-0">Tab 1</WindowTabsContent>
|
|
131
|
-
<WindowTabsContent value="tab-1">Tab 2</WindowTabsContent>
|
|
132
|
-
</WindowTabs>
|
|
133
|
-
),
|
|
134
|
-
},
|
|
135
|
-
} satisfies Story;
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { findFocusableAncestor } from "@prismicio/editor-support/DOM";
|
|
2
|
-
import {
|
|
3
|
-
DropdownMenu,
|
|
4
|
-
DropdownMenuContent,
|
|
5
|
-
DropdownMenuTrigger,
|
|
6
|
-
IconButton,
|
|
7
|
-
Text,
|
|
8
|
-
} from "@prismicio/editor-ui";
|
|
9
|
-
import * as Tabs from "@radix-ui/react-tabs";
|
|
10
|
-
import type { CSSProperties, FC, PropsWithChildren, ReactNode } from "react";
|
|
11
|
-
|
|
12
|
-
import * as styles from "./Window.css";
|
|
13
|
-
|
|
14
|
-
type WindowProps = PropsWithChildren<{ style?: CSSProperties }>;
|
|
15
|
-
|
|
16
|
-
export const Window: FC<WindowProps> = (props) => (
|
|
17
|
-
<div {...props} className={styles.root} />
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
export const WindowFrame: FC = (props) => (
|
|
21
|
-
<div {...props} className={styles.frame}>
|
|
22
|
-
<div className={styles.titleBarOptions}>
|
|
23
|
-
<span className={styles.titleBarOption} />
|
|
24
|
-
<span className={styles.titleBarOption} />
|
|
25
|
-
<span className={styles.titleBarOption} />
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
type WindowTabsProps = Pick<
|
|
31
|
-
Tabs.TabsProps,
|
|
32
|
-
"children" | "defaultValue" | "onValueChange" | "value"
|
|
33
|
-
>;
|
|
34
|
-
|
|
35
|
-
export const WindowTabs: FC<WindowTabsProps> = (props) => (
|
|
36
|
-
<Tabs.Root {...props} activationMode="manual" className={styles.tabs} />
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
type WindowTabsListProps = PropsWithChildren<{ onAddNewTab?: () => void }>;
|
|
40
|
-
|
|
41
|
-
export const WindowTabsList: FC<WindowTabsListProps> = ({
|
|
42
|
-
children,
|
|
43
|
-
onAddNewTab,
|
|
44
|
-
...otherProps
|
|
45
|
-
}) => (
|
|
46
|
-
<Tabs.List {...otherProps} className={styles.tabsList}>
|
|
47
|
-
{children}
|
|
48
|
-
<div className={styles.newTabButton}>
|
|
49
|
-
<IconButton icon="add" onClick={onAddNewTab} hiddenLabel="Add new tab" />
|
|
50
|
-
</div>
|
|
51
|
-
</Tabs.List>
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
type WindowTabsTriggerProps = Pick<
|
|
55
|
-
Tabs.TabsTriggerProps,
|
|
56
|
-
"children" | "value"
|
|
57
|
-
> & { menu?: ReactNode };
|
|
58
|
-
|
|
59
|
-
export const WindowTabsTrigger: FC<WindowTabsTriggerProps> = ({
|
|
60
|
-
children,
|
|
61
|
-
menu,
|
|
62
|
-
value,
|
|
63
|
-
...otherProps
|
|
64
|
-
}) => (
|
|
65
|
-
<Tabs.Trigger
|
|
66
|
-
{...otherProps}
|
|
67
|
-
aria-label={value}
|
|
68
|
-
asChild
|
|
69
|
-
onMouseDown={(event) => {
|
|
70
|
-
const target = event.target as HTMLElement;
|
|
71
|
-
const focusableAncestor = findFocusableAncestor(target);
|
|
72
|
-
if (
|
|
73
|
-
focusableAncestor !== event.currentTarget &&
|
|
74
|
-
focusableAncestor !== event.currentTarget.parentElement
|
|
75
|
-
) {
|
|
76
|
-
event.preventDefault();
|
|
77
|
-
}
|
|
78
|
-
if (target === event.currentTarget) {
|
|
79
|
-
target.scrollIntoView({
|
|
80
|
-
behavior: "smooth",
|
|
81
|
-
block: "nearest",
|
|
82
|
-
inline: "center",
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
}}
|
|
86
|
-
value={value}
|
|
87
|
-
>
|
|
88
|
-
<div className={styles.tabsTrigger}>
|
|
89
|
-
<Text
|
|
90
|
-
className={styles.tabsTriggerText}
|
|
91
|
-
color="inherit"
|
|
92
|
-
component="span"
|
|
93
|
-
noWrap
|
|
94
|
-
variant="emphasized"
|
|
95
|
-
>
|
|
96
|
-
{children}
|
|
97
|
-
</Text>
|
|
98
|
-
{Boolean(menu) ? (
|
|
99
|
-
<div className={styles.tabsTriggerMenu}>
|
|
100
|
-
<DropdownMenu>
|
|
101
|
-
<DropdownMenuTrigger>
|
|
102
|
-
<IconButton
|
|
103
|
-
icon="moreVert"
|
|
104
|
-
hiddenLabel={`tab-${value}-menu-button`}
|
|
105
|
-
/>
|
|
106
|
-
</DropdownMenuTrigger>
|
|
107
|
-
<DropdownMenuContent align="start">{menu}</DropdownMenuContent>
|
|
108
|
-
</DropdownMenu>
|
|
109
|
-
</div>
|
|
110
|
-
) : undefined}
|
|
111
|
-
</div>
|
|
112
|
-
</Tabs.Trigger>
|
|
113
|
-
);
|
|
114
|
-
|
|
115
|
-
type WindowTabsContentProps = Pick<Tabs.TabsContentProps, "children" | "value">;
|
|
116
|
-
|
|
117
|
-
export const WindowTabsContent: FC<WindowTabsContentProps> = (props) => (
|
|
118
|
-
<Tabs.Content {...props} className={styles.tabsContent} />
|
|
119
|
-
);
|
|
File without changes
|