@fluentui-copilot/react-prompt-starter 0.9.3 → 0.10.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/CHANGELOG.json +57 -1
- package/CHANGELOG.md +23 -2
- package/dist/index.d.ts +109 -0
- package/lib/PromptStarterList.js +2 -0
- package/lib/PromptStarterList.js.map +1 -0
- package/lib/PromptStarterV2.js +2 -0
- package/lib/PromptStarterV2.js.map +1 -0
- package/lib/components/PromptStarter/usePromptStarter.js +10 -1
- package/lib/components/PromptStarter/usePromptStarter.js.map +1 -1
- package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.js +13 -0
- package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.types.js +4 -0
- package/lib/components/PromptStarterV2/PromptStarter/PromptStarter.types.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarter/index.js +5 -0
- package/lib/components/PromptStarterV2/PromptStarter/index.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarter/promptStarterMotion.js +43 -0
- package/lib/components/PromptStarterV2/PromptStarter/promptStarterMotion.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarter/renderPromptStarter.js +11 -0
- package/lib/components/PromptStarterV2/PromptStarter/renderPromptStarter.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarter.js +62 -0
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarter.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js +204 -0
- package/lib/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.js +13 -0
- package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js +2 -0
- package/lib/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarterList/index.js +5 -0
- package/lib/components/PromptStarterV2/PromptStarterList/index.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js +20 -0
- package/lib/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js +114 -0
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js +9 -0
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js.map +1 -0
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js +57 -0
- package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js.map +1 -0
- package/lib/contexts/PromptStarterListContext.js +8 -0
- package/lib/contexts/PromptStarterListContext.js.map +1 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib-commonjs/PromptStarterList.js +29 -0
- package/lib-commonjs/PromptStarterList.js.map +1 -0
- package/lib-commonjs/PromptStarterV2.js +29 -0
- package/lib-commonjs/PromptStarterV2.js.map +1 -0
- package/lib-commonjs/components/PromptStarter/usePromptStarter.js +9 -0
- package/lib-commonjs/components/PromptStarter/usePromptStarter.js.map +1 -1
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.js +23 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.types.js +7 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/PromptStarter.types.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/index.js +32 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/index.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/promptStarterMotion.js +60 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/promptStarterMotion.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/renderPromptStarter.js +27 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/renderPromptStarter.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarter.js +62 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarter.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js +381 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarter/usePromptStarterStyles.styles.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.js +23 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js +5 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/PromptStarterList.types.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/index.js +32 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/index.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js +29 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/renderPromptStarterList.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js +116 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterList.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js +16 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js.map +1 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js +89 -0
- package/lib-commonjs/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js.map +1 -0
- package/lib-commonjs/contexts/PromptStarterListContext.js +28 -0
- package/lib-commonjs/contexts/PromptStarterListContext.js.map +1 -0
- package/lib-commonjs/index.js +32 -0
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { __styles, __resetStyles, mergeClasses, shorthands, typographyStyles, createFocusOutlineStyle } from '@fluentui/react-components';
|
|
2
|
+
import { tokens } from '@fluentui-copilot/tokens';
|
|
3
|
+
export const promptStarterClassNames = {
|
|
4
|
+
root: 'fai-PromptStarter',
|
|
5
|
+
primaryAction: 'fai-PromptStarter__primaryAction',
|
|
6
|
+
icon: 'fai-PromptStarter__icon',
|
|
7
|
+
prompt: 'fai-PromptStarter__prompt',
|
|
8
|
+
reasonMarker: 'fai-PromptStarter__reasonMarker',
|
|
9
|
+
actions: 'fai-PromptStarter__actions'
|
|
10
|
+
};
|
|
11
|
+
const useRootResetStyles = __resetStyles("r1x2hm06", null, [".r1x2hm06{display:grid;grid-template-columns:1fr auto;grid-template-rows:max-content auto;min-width:214px;}", ".r1x2hm06:hover .fai-PromptStarter__primaryAction{box-shadow:var(--shadow16);transform:scale(1.03);transition:transform var(--durationNormal) var(--curveDecelerateMin);}", ".r1x2hm06:active .fai-PromptStarter__primaryAction{box-shadow:var(--shadow8);transform:scale(1.03);transition:transform var(--durationNormal) var(--curveDecelerateMin);}", ".r1x2hm06:not(:focus-within):not(:hover) .fai-PromptStarter__actions{clip:rect(0px, 0px, 0px, 0px);height:1px;margin:-1px;overflow:hidden;padding:0px;width:1px;position:absolute;opacity:0;}"]);
|
|
12
|
+
const useStyles = __styles({
|
|
13
|
+
primaryAction: {
|
|
14
|
+
nk6f5a: 0,
|
|
15
|
+
Ijaq50: 0,
|
|
16
|
+
h3tjnc: "fcdwmbt",
|
|
17
|
+
Bw0ie65: 0,
|
|
18
|
+
Br312pm: 0,
|
|
19
|
+
Beweih1: "f1eb8yyf",
|
|
20
|
+
mc9l5x: "f22iagw",
|
|
21
|
+
Beiy3e4: "f1vx9l62",
|
|
22
|
+
qhf8xq: "f10pi13n",
|
|
23
|
+
Beyfa6y: 0,
|
|
24
|
+
Bbmb7ep: 0,
|
|
25
|
+
Btl43ni: 0,
|
|
26
|
+
B7oj6ja: 0,
|
|
27
|
+
Dimara: "f14w4nd",
|
|
28
|
+
De3pzq: "fxugw4r",
|
|
29
|
+
sj55zd: "fkfq4zb",
|
|
30
|
+
Bahqtrf: "fk6fouc",
|
|
31
|
+
Bceei9c: "f1k6fduh",
|
|
32
|
+
oeaueh: "f1s6fcnf",
|
|
33
|
+
fsow6f: ["f1o700av", "fes3tcz"],
|
|
34
|
+
Belr9w4: "fylz90v",
|
|
35
|
+
Byoj8tv: 0,
|
|
36
|
+
uwmqm3: 0,
|
|
37
|
+
z189sj: 0,
|
|
38
|
+
z8tnut: 0,
|
|
39
|
+
B0ocmuz: "fq88wcj",
|
|
40
|
+
B4j52fo: "f192inf7",
|
|
41
|
+
Bekrc4i: ["f5tn483", "f1ojsxk5"],
|
|
42
|
+
Bn0qgzm: "f1vxd6vx",
|
|
43
|
+
ibv6hh: ["f1ojsxk5", "f5tn483"],
|
|
44
|
+
icvyot: "fzkkow9",
|
|
45
|
+
vrafjx: ["fcdblym", "fjik90z"],
|
|
46
|
+
oivjwe: "fg706s2",
|
|
47
|
+
wvpqe5: ["fjik90z", "fcdblym"],
|
|
48
|
+
g2u3we: "f68mrw8",
|
|
49
|
+
h3c5rm: ["f7pw515", "fw35ms5"],
|
|
50
|
+
B9xav0g: "frpde29",
|
|
51
|
+
zhjwy3: ["fw35ms5", "f7pw515"],
|
|
52
|
+
Brovlpu: "ftqa4ok",
|
|
53
|
+
B486eqv: "f2hkw1w",
|
|
54
|
+
B8q5s1w: "f8hki3x",
|
|
55
|
+
Bci5o5g: ["f1d2448m", "ffh67wi"],
|
|
56
|
+
n8qw10: "f1bjia2o",
|
|
57
|
+
Bdrgwmp: ["ffh67wi", "f1d2448m"],
|
|
58
|
+
Bqhya38: "f1j6vpng",
|
|
59
|
+
Bwxa6fj: ["f1pniga2", "f1ffjurs"],
|
|
60
|
+
Bdhvstf: "f987i1v",
|
|
61
|
+
B7zbvrb: ["f1ffjurs", "f1pniga2"],
|
|
62
|
+
Bm4h7ae: "f15bsgw9",
|
|
63
|
+
B7ys5i9: "f14e48fq",
|
|
64
|
+
Busjfv9: "f18yb2kv",
|
|
65
|
+
Bhk32uz: "fd6o370",
|
|
66
|
+
f6g5ot: 0,
|
|
67
|
+
Boxcth7: 0,
|
|
68
|
+
Bhdgwq3: 0,
|
|
69
|
+
hgwjuy: 0,
|
|
70
|
+
Bshpdp8: 0,
|
|
71
|
+
Bsom6fd: 0,
|
|
72
|
+
Blkhhs4: 0,
|
|
73
|
+
Bonggc9: 0,
|
|
74
|
+
Ddfuxk: 0,
|
|
75
|
+
i03rao: 0,
|
|
76
|
+
kclons: 0,
|
|
77
|
+
clg4pj: 0,
|
|
78
|
+
Bpqj9nj: 0,
|
|
79
|
+
B6dhp37: 0,
|
|
80
|
+
Bf4ptjt: 0,
|
|
81
|
+
Bqtpl0w: 0,
|
|
82
|
+
i4rwgc: "ffwy5si",
|
|
83
|
+
Dah5zi: 0,
|
|
84
|
+
B1tsrr9: 0,
|
|
85
|
+
qqdqy8: 0,
|
|
86
|
+
Bkh64rk: 0,
|
|
87
|
+
e3fwne: "faugzkp",
|
|
88
|
+
J0r882: "f57olzd",
|
|
89
|
+
Bule8hv: ["f4stah7", "fs1por5"],
|
|
90
|
+
Bjwuhne: "f480a47",
|
|
91
|
+
Ghsupd: ["fs1por5", "f4stah7"]
|
|
92
|
+
},
|
|
93
|
+
primaryActionHovered: {
|
|
94
|
+
E5pizo: "f1hg901r",
|
|
95
|
+
Bz10aip: "f15ncuxf",
|
|
96
|
+
Bn62ygk: 0,
|
|
97
|
+
Cwk7ip: 0,
|
|
98
|
+
B3o57yi: 0,
|
|
99
|
+
Bmy1vo4: 0,
|
|
100
|
+
Bkqvd7p: 0,
|
|
101
|
+
Bi2q7bf: "ffrhwuo"
|
|
102
|
+
},
|
|
103
|
+
icon: {
|
|
104
|
+
mc9l5x: "f22iagw",
|
|
105
|
+
Bt984gj: "f122n59",
|
|
106
|
+
sshi5w: "fntfeoj"
|
|
107
|
+
},
|
|
108
|
+
actions: {
|
|
109
|
+
jrapky: 0,
|
|
110
|
+
Frg6f3: 0,
|
|
111
|
+
t21cq0: 0,
|
|
112
|
+
B6of3ja: 0,
|
|
113
|
+
B74szlk: ["foizga4", "f5m8a6r"],
|
|
114
|
+
qhf8xq: "f10pi13n",
|
|
115
|
+
nk6f5a: 0,
|
|
116
|
+
Ijaq50: 0,
|
|
117
|
+
h3tjnc: "f3hl5xl",
|
|
118
|
+
Bw0ie65: 0,
|
|
119
|
+
Br312pm: 0,
|
|
120
|
+
Beweih1: "f14q5zaz",
|
|
121
|
+
abs64n: "f5p0z4x",
|
|
122
|
+
Bn62ygk: 0,
|
|
123
|
+
Cwk7ip: 0,
|
|
124
|
+
B3o57yi: 0,
|
|
125
|
+
Bmy1vo4: 0,
|
|
126
|
+
Bkqvd7p: 0,
|
|
127
|
+
Bi2q7bf: "f1964ud6"
|
|
128
|
+
},
|
|
129
|
+
prompt: {
|
|
130
|
+
Bahqtrf: "fk6fouc",
|
|
131
|
+
Be2twd7: "fkhj508",
|
|
132
|
+
Bhrd7zp: "fl43uef",
|
|
133
|
+
Bg96gwp: "f1i3iumi",
|
|
134
|
+
mc9l5x: "f1rvi9lw",
|
|
135
|
+
Fd1uvx: "fpfc2by",
|
|
136
|
+
Bh9c35c: "f1lvsx7g",
|
|
137
|
+
Bmxbyg5: "f1sil6mw"
|
|
138
|
+
},
|
|
139
|
+
reasonMarker: {
|
|
140
|
+
Bahqtrf: "fk6fouc",
|
|
141
|
+
Be2twd7: "f13mqy1h",
|
|
142
|
+
Bhrd7zp: "figsok6",
|
|
143
|
+
Bg96gwp: "fcpl73t"
|
|
144
|
+
},
|
|
145
|
+
singleColumnStyles: {
|
|
146
|
+
mc9l5x: "fjseox"
|
|
147
|
+
}
|
|
148
|
+
}, {
|
|
149
|
+
d: [[".fcdwmbt{grid-row:1/3;}", {
|
|
150
|
+
p: -1
|
|
151
|
+
}], [".f1eb8yyf{grid-column:1/3;}", {
|
|
152
|
+
p: -1
|
|
153
|
+
}], ".f22iagw{display:flex;}", ".f1vx9l62{flex-direction:column;}", ".f10pi13n{position:relative;}", [".f14w4nd{border-radius:28px;}", {
|
|
154
|
+
p: -1
|
|
155
|
+
}], ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".fkfq4zb{color:var(--colorNeutralForeground2);}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".f1k6fduh{cursor:pointer;}", ".f1s6fcnf{outline-style:none;}", ".f1o700av{text-align:left;}", ".fes3tcz{text-align:right;}", ".fylz90v{row-gap:var(--spacingHorizontalS);}", [".fq88wcj{padding:var(--spacingVerticalL) var(--spacingHorizontalL);}", {
|
|
156
|
+
p: -1
|
|
157
|
+
}], ".f192inf7{border-top-width:var(--strokeWidthThin);}", ".f5tn483{border-right-width:var(--strokeWidthThin);}", ".f1ojsxk5{border-left-width:var(--strokeWidthThin);}", ".f1vxd6vx{border-bottom-width:var(--strokeWidthThin);}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".f68mrw8{border-top-color:var(--colorNeutralStroke2);}", ".f7pw515{border-right-color:var(--colorNeutralStroke2);}", ".fw35ms5{border-left-color:var(--colorNeutralStroke2);}", ".frpde29{border-bottom-color:var(--colorNeutralStroke2);}", ".f8hki3x[data-fui-focus-visible]{border-top-color:transparent;}", ".f1d2448m[data-fui-focus-visible]{border-right-color:transparent;}", ".ffh67wi[data-fui-focus-visible]{border-left-color:transparent;}", ".f1bjia2o[data-fui-focus-visible]{border-bottom-color:transparent;}", ".f15bsgw9[data-fui-focus-visible]::after{content:\"\";}", ".f14e48fq[data-fui-focus-visible]::after{position:absolute;}", ".f18yb2kv[data-fui-focus-visible]::after{pointer-events:none;}", ".fd6o370[data-fui-focus-visible]::after{z-index:1;}", [".ffwy5si[data-fui-focus-visible]::after{border:2px solid var(--colorStrokeFocus2);}", {
|
|
158
|
+
p: -2
|
|
159
|
+
}], [".faugzkp[data-fui-focus-visible]::after{border-radius:28px;}", {
|
|
160
|
+
p: -1
|
|
161
|
+
}], ".f57olzd[data-fui-focus-visible]::after{top:calc(2px * -1);}", ".f4stah7[data-fui-focus-visible]::after{right:calc(2px * -1);}", ".fs1por5[data-fui-focus-visible]::after{left:calc(2px * -1);}", ".f480a47[data-fui-focus-visible]::after{bottom:calc(2px * -1);}", ".f1hg901r{box-shadow:var(--shadow16);}", ".f15ncuxf{transform:scale(1.03);}", [".ffrhwuo{transition:transform var(--durationNormal) var(--curveDecelerateMin);}", {
|
|
162
|
+
p: -1
|
|
163
|
+
}], ".f122n59{align-items:center;}", ".fntfeoj{min-height:var(--spacingVerticalXXL);}", [".foizga4{margin:var(--spacingVerticalL) var(--spacingHorizontalL) var(--spacingVerticalNone) var(--spacingHorizontalNone);}", {
|
|
164
|
+
p: -1
|
|
165
|
+
}], [".f5m8a6r{margin:var(--spacingVerticalL) var(--spacingHorizontalNone) var(--spacingVerticalNone) var(--spacingHorizontalL);}", {
|
|
166
|
+
p: -1
|
|
167
|
+
}], [".f3hl5xl{grid-row:1/2;}", {
|
|
168
|
+
p: -1
|
|
169
|
+
}], [".f14q5zaz{grid-column:2/3;}", {
|
|
170
|
+
p: -1
|
|
171
|
+
}], ".f5p0z4x{opacity:1;}", [".f1964ud6{transition:opacity var(--durationFast) var(--curveLinear);}", {
|
|
172
|
+
p: -1
|
|
173
|
+
}], ".fkhj508{font-size:var(--fontSizeBase300);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".f1rvi9lw{display:-webkit-box;}", ".fpfc2by{-webkit-box-orient:vertical;}", ".f1lvsx7g{-webkit-line-clamp:2;}", ".f1sil6mw{overflow-y:hidden;}", ".f13mqy1h{font-size:var(--fontSizeBase100);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fcpl73t{line-height:var(--lineHeightBase100);}", ".fjseox{display:none;}"],
|
|
174
|
+
f: [".ftqa4ok:focus{outline-style:none;}"],
|
|
175
|
+
i: [".f2hkw1w:focus-visible{outline-style:none;}"],
|
|
176
|
+
m: [["@media (forced-colors: active){.f1j6vpng[data-fui-focus-visible]::after{border-top-color:Highlight;}}", {
|
|
177
|
+
m: "(forced-colors: active)"
|
|
178
|
+
}], ["@media (forced-colors: active){.f1ffjurs[data-fui-focus-visible]::after{border-left-color:Highlight;}.f1pniga2[data-fui-focus-visible]::after{border-right-color:Highlight;}}", {
|
|
179
|
+
m: "(forced-colors: active)"
|
|
180
|
+
}], ["@media (forced-colors: active){.f987i1v[data-fui-focus-visible]::after{border-bottom-color:Highlight;}}", {
|
|
181
|
+
m: "(forced-colors: active)"
|
|
182
|
+
}]]
|
|
183
|
+
});
|
|
184
|
+
export const usePromptStarterStyles_unstable = state => {
|
|
185
|
+
'use no memo';
|
|
186
|
+
|
|
187
|
+
const {
|
|
188
|
+
isSingleColumn
|
|
189
|
+
} = state;
|
|
190
|
+
const styles = useStyles();
|
|
191
|
+
const rootResetStyles = useRootResetStyles();
|
|
192
|
+
state.root.className = mergeClasses(promptStarterClassNames.root, rootResetStyles, state.root.className);
|
|
193
|
+
state.primaryAction.className = mergeClasses(promptStarterClassNames.primaryAction, styles.primaryAction, state.primaryAction.className);
|
|
194
|
+
state.icon.className = mergeClasses(promptStarterClassNames.icon, styles.icon, isSingleColumn && styles.singleColumnStyles, state.icon.className);
|
|
195
|
+
state.prompt.className = mergeClasses(promptStarterClassNames.prompt, styles.prompt, state.prompt.className);
|
|
196
|
+
if (state.reasonMarker) {
|
|
197
|
+
state.reasonMarker.className = mergeClasses(promptStarterClassNames.reasonMarker, styles.reasonMarker, isSingleColumn && styles.singleColumnStyles, state.reasonMarker.className);
|
|
198
|
+
}
|
|
199
|
+
if (state.actions) {
|
|
200
|
+
state.actions.className = mergeClasses(promptStarterClassNames.actions, styles.actions, isSingleColumn && styles.singleColumnStyles, state.actions.className);
|
|
201
|
+
}
|
|
202
|
+
return state;
|
|
203
|
+
};
|
|
204
|
+
//# sourceMappingURL=usePromptStarterStyles.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["usePromptStarterStyles.styles.ts"],"sourcesContent":["import {\n makeStyles,\n makeResetStyles,\n mergeClasses,\n shorthands,\n typographyStyles,\n createFocusOutlineStyle,\n} from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\nimport type { PromptStarterSlots, PromptStarterState } from './PromptStarter.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const promptStarterClassNames: SlotClassNames<PromptStarterSlots> = {\n root: 'fai-PromptStarter',\n primaryAction: 'fai-PromptStarter__primaryAction',\n icon: 'fai-PromptStarter__icon',\n prompt: 'fai-PromptStarter__prompt',\n reasonMarker: 'fai-PromptStarter__reasonMarker',\n actions: 'fai-PromptStarter__actions',\n};\n\nconst useRootResetStyles = makeResetStyles({\n display: 'grid',\n gridTemplateColumns: '1fr auto',\n gridTemplateRows: 'max-content auto',\n minWidth: '214px',\n\n // Apply styles to the primary action on hover / active states\n '&:hover': {\n [`& .${promptStarterClassNames.primaryAction}`]: {\n boxShadow: tokens.shadow16,\n transform: 'scale(1.03)',\n transition: `transform ${tokens.durationNormal} ${tokens.curveDecelerateMin}`,\n },\n },\n '&:active': {\n [`& .${promptStarterClassNames.primaryAction}`]: {\n boxShadow: tokens.shadow8,\n transform: 'scale(1.03)',\n transition: `transform ${tokens.durationNormal} ${tokens.curveDecelerateMin}`,\n },\n },\n\n // Hide actions when not focused or hovered\n ':not(:focus-within):not(:hover)': {\n [`& .${promptStarterClassNames.actions}`]: {\n clip: 'rect(0px, 0px, 0px, 0px)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: '0px',\n width: '1px',\n position: 'absolute',\n opacity: 0,\n },\n },\n});\n\nconst useStyles = makeStyles({\n primaryAction: {\n gridRow: '1 / 3',\n gridColumn: '1 / 3',\n display: 'flex',\n flexDirection: 'column',\n position: 'relative',\n borderRadius: '28px',\n backgroundColor: tokens.colorNeutralBackground1,\n color: tokens.colorNeutralForeground2,\n fontFamily: tokens.fontFamilyBase,\n cursor: 'pointer',\n outlineStyle: 'none',\n textAlign: 'left',\n rowGap: tokens.spacingHorizontalS,\n padding: `${tokens.spacingVerticalL} ${tokens.spacingHorizontalL}`,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke2),\n ...createFocusOutlineStyle({ style: { outlineRadius: '28px' } }),\n },\n\n primaryActionHovered: {\n boxShadow: tokens.shadow16,\n transform: 'scale(1.03)',\n transition: `transform ${tokens.durationNormal} ${tokens.curveDecelerateMin}`,\n },\n\n icon: {\n display: 'flex',\n alignItems: 'center',\n minHeight: tokens.spacingVerticalXXL,\n },\n actions: {\n margin: `${tokens.spacingVerticalL} ${tokens.spacingHorizontalL}\n ${tokens.spacingVerticalNone} ${tokens.spacingHorizontalNone}`,\n position: 'relative',\n gridRow: '1 / 2',\n gridColumn: '2 / 3',\n\n opacity: 1,\n transition: `opacity ${tokens.durationFast} ${tokens.curveLinear}`,\n },\n prompt: {\n ...typographyStyles.body1Strong,\n\n // Truncate text after two lines.\n display: '-webkit-box',\n '-webkit-box-orient': 'vertical',\n '-webkit-line-clamp': '2',\n overflowY: 'hidden',\n },\n reasonMarker: {\n ...typographyStyles.caption2,\n },\n\n // Hide icon, actions, and reason marker in single column appearance\n singleColumnStyles: {\n display: 'none',\n },\n});\n\nexport const usePromptStarterStyles_unstable = (state: PromptStarterState): PromptStarterState => {\n 'use no memo';\n\n const { isSingleColumn } = state;\n\n const styles = useStyles();\n const rootResetStyles = useRootResetStyles();\n state.root.className = mergeClasses(promptStarterClassNames.root, rootResetStyles, state.root.className);\n state.primaryAction.className = mergeClasses(\n promptStarterClassNames.primaryAction,\n styles.primaryAction,\n state.primaryAction.className,\n );\n state.icon.className = mergeClasses(\n promptStarterClassNames.icon,\n styles.icon,\n isSingleColumn && styles.singleColumnStyles,\n state.icon.className,\n );\n state.prompt.className = mergeClasses(promptStarterClassNames.prompt, styles.prompt, state.prompt.className);\n if (state.reasonMarker) {\n state.reasonMarker.className = mergeClasses(\n promptStarterClassNames.reasonMarker,\n styles.reasonMarker,\n isSingleColumn && styles.singleColumnStyles,\n state.reasonMarker.className,\n );\n }\n if (state.actions) {\n state.actions.className = mergeClasses(\n promptStarterClassNames.actions,\n styles.actions,\n isSingleColumn && styles.singleColumnStyles,\n state.actions.className,\n );\n }\n\n return state;\n};\n"],"names":["makeStyles","makeResetStyles","mergeClasses","shorthands","typographyStyles","createFocusOutlineStyle","tokens","promptStarterClassNames","root","primaryAction","icon","prompt","reasonMarker","actions","useRootResetStyles","display","gridTemplateColumns","gridTemplateRows","minWidth","boxShadow","shadow16","transform","transition","durationNormal","curveDecelerateMin","shadow8","clip","height","margin","overflow","padding","width","position","opacity","useStyles","gridRow","gridColumn","flexDirection","borderRadius","backgroundColor","colorNeutralBackground1","color","colorNeutralForeground2","fontFamily","fontFamilyBase","cursor","outlineStyle","textAlign","rowGap","spacingHorizontalS","spacingVerticalL","spacingHorizontalL","border","strokeWidthThin","colorNeutralStroke2","style","outlineRadius","primaryActionHovered","alignItems","minHeight","spacingVerticalXXL","spacingVerticalNone","spacingHorizontalNone","durationFast","curveLinear","body1Strong","overflowY","caption2","singleColumnStyles","usePromptStarterStyles_unstable","state","isSingleColumn","styles","rootResetStyles","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { usePromptStarterList_unstable } from './usePromptStarterList';
|
|
3
|
+
import { renderPromptStarterList_unstable } from './renderPromptStarterList';
|
|
4
|
+
import { usePromptStarterListStyles_unstable } from './usePromptStarterListStyles.styles';
|
|
5
|
+
import { usePromptStarterListContextValues } from './usePromptStarterListContextValues';
|
|
6
|
+
export const PromptStarterList = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
7
|
+
const state = usePromptStarterList_unstable(props, ref);
|
|
8
|
+
const contextValues = usePromptStarterListContextValues(state);
|
|
9
|
+
usePromptStarterListStyles_unstable(state);
|
|
10
|
+
return renderPromptStarterList_unstable(state, contextValues);
|
|
11
|
+
});
|
|
12
|
+
PromptStarterList.displayName = 'PromptStarterList';
|
|
13
|
+
//# sourceMappingURL=PromptStarterList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["PromptStarterList.tsx"],"sourcesContent":["import * as React from 'react';\nimport { usePromptStarterList_unstable } from './usePromptStarterList';\nimport { renderPromptStarterList_unstable } from './renderPromptStarterList';\nimport { usePromptStarterListStyles_unstable } from './usePromptStarterListStyles.styles';\nimport type { PromptStarterListProps } from './PromptStarterList.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\nimport { usePromptStarterListContextValues } from './usePromptStarterListContextValues';\n\nexport const PromptStarterList: ForwardRefComponent<PromptStarterListProps> = React.forwardRef((props, ref) => {\n const state = usePromptStarterList_unstable(props, ref);\n const contextValues = usePromptStarterListContextValues(state);\n\n usePromptStarterListStyles_unstable(state);\n return renderPromptStarterList_unstable(state, contextValues);\n});\n\nPromptStarterList.displayName = 'PromptStarterList';\n"],"names":["React","usePromptStarterList_unstable","renderPromptStarterList_unstable","usePromptStarterListStyles_unstable","usePromptStarterListContextValues","PromptStarterList","forwardRef","props","ref","state","contextValues","displayName"],"rangeMappings":";;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,gCAAgC,QAAQ,4BAA4B;AAC7E,SAASC,mCAAmC,QAAQ,sCAAsC;AAG1F,SAASC,iCAAiC,QAAQ,sCAAsC;AAExF,OAAO,MAAMC,kCAAiEL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACrG,MAAMC,QAAQR,8BAA8BM,OAAOC;IACnD,MAAME,gBAAgBN,kCAAkCK;IAExDN,oCAAoCM;IACpC,OAAOP,iCAAiCO,OAAOC;AACjD,GAAG;AAEHL,kBAAkBM,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["PromptStarterList.types.ts"],"sourcesContent":["import type { DesignVersion } from '@fluentui-copilot/react-provider';\nimport type {\n ComponentProps,\n ComponentState,\n Slot,\n Button,\n UseArrowNavigationGroupOptions,\n} from '@fluentui/react-components';\n\nexport type PromptStarterListSlots = {\n root: NonNullable<Slot<'div'>>;\n gridWrapper: NonNullable<Slot<'div'>>;\n expandButton?: Slot<typeof Button>;\n};\n\n/**\n * PromptStarterList Props\n */\nexport type PromptStarterListProps = ComponentProps<PromptStarterListSlots> &\n DesignVersion & {\n /**\n * Text for the expand button when the list is collapsed.\n *\n * default: \"Show more\"\n */\n expandButtonLabel?: string;\n /**\n * Text for the expand button when the list is expanded.\n *\n * default: \"Show less\"\n */\n collapseButtonLabel?: string;\n /**\n * Arrow navigation options. This can be used to customize Tabster's direction,\n * tab behavior, and memoization options.\n *\n * default: { axis: 'horizontal', memorizeCurrent: true }\n */\n arrowNavigationOptions?: UseArrowNavigationGroupOptions;\n };\n\n/**\n * State used in rendering PromptStarterList\n */\nexport type PromptStarterListState = ComponentState<PromptStarterListSlots> &\n Required<Pick<PromptStarterListProps, 'designVersion'>> & {\n numberOfColumns: number;\n isExpanded?: boolean;\n };\n\nexport type PromptStarterListContextValue = Pick<PromptStarterListState, 'numberOfColumns' | 'isExpanded'>;\n"],"names":[],"rangeMappings":"","mappings":"AAkDA,WAA2G"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { PromptStarterList } from './PromptStarterList';
|
|
2
|
+
export { renderPromptStarterList_unstable } from './renderPromptStarterList';
|
|
3
|
+
export { usePromptStarterList_unstable } from './usePromptStarterList';
|
|
4
|
+
export { promptStarterListClassNames, usePromptStarterListStyles_unstable } from './usePromptStarterListStyles.styles';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export { PromptStarterList } from './PromptStarterList';\nexport type {\n PromptStarterListProps,\n PromptStarterListSlots,\n PromptStarterListState,\n PromptStarterListContextValue,\n} from './PromptStarterList.types';\nexport { renderPromptStarterList_unstable } from './renderPromptStarterList';\nexport { usePromptStarterList_unstable } from './usePromptStarterList';\nexport { promptStarterListClassNames, usePromptStarterListStyles_unstable } from './usePromptStarterListStyles.styles';\n"],"names":["PromptStarterList","renderPromptStarterList_unstable","usePromptStarterList_unstable","promptStarterListClassNames","usePromptStarterListStyles_unstable"],"rangeMappings":";;;","mappings":"AAAA,SAASA,iBAAiB,QAAQ,sBAAsB;AAOxD,SAASC,gCAAgC,QAAQ,4BAA4B;AAC7E,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,2BAA2B,EAAEC,mCAAmC,QAAQ,sCAAsC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
+
import { assertSlots, PresenceGroup } from '@fluentui/react-components';
|
|
3
|
+
import { PromptStarterListProvider } from '../../../contexts/PromptStarterListContext';
|
|
4
|
+
/**
|
|
5
|
+
* Render the final JSX of PromptStarterList
|
|
6
|
+
*/
|
|
7
|
+
export const renderPromptStarterList_unstable = (state, contextValue) => {
|
|
8
|
+
assertSlots(state);
|
|
9
|
+
return /*#__PURE__*/_jsx(PromptStarterListProvider, {
|
|
10
|
+
value: contextValue,
|
|
11
|
+
children: /*#__PURE__*/_jsxs(state.root, {
|
|
12
|
+
children: [/*#__PURE__*/_jsx(PresenceGroup, {
|
|
13
|
+
children: /*#__PURE__*/_jsx(state.gridWrapper, {
|
|
14
|
+
children: state.root.children
|
|
15
|
+
})
|
|
16
|
+
}), state.expandButton && /*#__PURE__*/_jsx(state.expandButton, {})]
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=renderPromptStarterList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderPromptStarterList.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots, PresenceGroup } from '@fluentui/react-components';\nimport { PromptStarterListProvider } from '../../../contexts/PromptStarterListContext';\nimport type {\n PromptStarterListState,\n PromptStarterListSlots,\n PromptStarterListContextValue,\n} from './PromptStarterList.types';\n\n/**\n * Render the final JSX of PromptStarterList\n */\nexport const renderPromptStarterList_unstable = (\n state: PromptStarterListState,\n contextValue: PromptStarterListContextValue,\n) => {\n assertSlots<PromptStarterListSlots>(state);\n\n return (\n <PromptStarterListProvider value={contextValue}>\n <state.root>\n <PresenceGroup>\n <state.gridWrapper>{state.root.children}</state.gridWrapper>\n </PresenceGroup>\n {state.expandButton && <state.expandButton />}\n </state.root>\n </PromptStarterListProvider>\n );\n};\n"],"names":["assertSlots","PresenceGroup","PromptStarterListProvider","renderPromptStarterList_unstable","state","contextValue","value","root","gridWrapper","children","expandButton"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,EAAEC,aAAa,QAAQ,6BAA6B;AACxE,SAASC,yBAAyB,QAAQ,6CAA6C;AAOvF;;CAEC,GACD,OAAO,MAAMC,mCAAmC,CAC9CC,OACAC;IAEAL,YAAoCI;IAEpC,qBACE,KAACF;QAA0BI,OAAOD;kBAChC,cAAA,MAACD,MAAMG,IAAI;;8BACT,KAACN;8BACC,cAAA,KAACG,MAAMI,WAAW;kCAAEJ,MAAMG,IAAI,CAACE,QAAQ;;;gBAExCL,MAAMM,YAAY,kBAAI,KAACN,MAAMM,YAAY;;;;AAIlD,EAAE"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { getIntrinsicElementProps, slot, Button, useArrowNavigationGroup, mergeCallbacks, useFluent, useMergedRefs } from '@fluentui/react-components';
|
|
3
|
+
import { useDesignVersion } from '@fluentui-copilot/react-provider';
|
|
4
|
+
import { ChevronDown12Regular } from '@fluentui/react-icons';
|
|
5
|
+
import { PromptStarterMotion } from '../PromptStarter/promptStarterMotion';
|
|
6
|
+
/**
|
|
7
|
+
* Create the state required to render PromptStarterList.
|
|
8
|
+
*
|
|
9
|
+
* The returned state can be modified with hooks such as usePromptStarterListStyles_unstable,
|
|
10
|
+
* before being passed to renderPromptStarterList_unstable.
|
|
11
|
+
*
|
|
12
|
+
* @param props - props from this instance of PromptStarterList
|
|
13
|
+
* @param ref - reference to root HTMLElement of PromptStarterList
|
|
14
|
+
*/
|
|
15
|
+
export const usePromptStarterList_unstable = (props, ref) => {
|
|
16
|
+
const {
|
|
17
|
+
arrowNavigationOptions,
|
|
18
|
+
expandButtonLabel = 'Show more',
|
|
19
|
+
collapseButtonLabel = 'Show less'
|
|
20
|
+
} = props;
|
|
21
|
+
const designVersion = useDesignVersion(props.designVersion);
|
|
22
|
+
var _arrowNavigationOptions_axis, _arrowNavigationOptions_memorizeCurrent;
|
|
23
|
+
const focusAttrs = useArrowNavigationGroup({
|
|
24
|
+
...arrowNavigationOptions,
|
|
25
|
+
axis: (_arrowNavigationOptions_axis = arrowNavigationOptions === null || arrowNavigationOptions === void 0 ? void 0 : arrowNavigationOptions.axis) !== null && _arrowNavigationOptions_axis !== void 0 ? _arrowNavigationOptions_axis : 'grid-linear',
|
|
26
|
+
memorizeCurrent: (_arrowNavigationOptions_memorizeCurrent = arrowNavigationOptions === null || arrowNavigationOptions === void 0 ? void 0 : arrowNavigationOptions.memorizeCurrent) !== null && _arrowNavigationOptions_memorizeCurrent !== void 0 ? _arrowNavigationOptions_memorizeCurrent : true
|
|
27
|
+
});
|
|
28
|
+
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
29
|
+
const [numberOfColumns, setNumberOfColumns] = React.useState(3);
|
|
30
|
+
const gridWrapperRef = React.useRef(null);
|
|
31
|
+
const {
|
|
32
|
+
targetDocument
|
|
33
|
+
} = useFluent();
|
|
34
|
+
const win = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.defaultView;
|
|
35
|
+
React.useEffect(() => {
|
|
36
|
+
if (!win || !gridWrapperRef.current) return;
|
|
37
|
+
const promptStarterGrid = gridWrapperRef.current;
|
|
38
|
+
const updateNumberOfColumns = () => {
|
|
39
|
+
const numColumns = win.getComputedStyle(promptStarterGrid).gridTemplateColumns.split(' ').length;
|
|
40
|
+
setNumberOfColumns(numColumns);
|
|
41
|
+
};
|
|
42
|
+
const ro = new win.ResizeObserver(updateNumberOfColumns);
|
|
43
|
+
ro.observe(promptStarterGrid);
|
|
44
|
+
return () => {
|
|
45
|
+
ro.unobserve(promptStarterGrid);
|
|
46
|
+
};
|
|
47
|
+
}, [win]);
|
|
48
|
+
const state = {
|
|
49
|
+
numberOfColumns: numberOfColumns,
|
|
50
|
+
isExpanded,
|
|
51
|
+
designVersion,
|
|
52
|
+
components: {
|
|
53
|
+
root: 'div',
|
|
54
|
+
gridWrapper: 'div',
|
|
55
|
+
expandButton: Button
|
|
56
|
+
},
|
|
57
|
+
root: slot.always(getIntrinsicElementProps('div', {
|
|
58
|
+
ref,
|
|
59
|
+
...props
|
|
60
|
+
}), {
|
|
61
|
+
elementType: 'div'
|
|
62
|
+
}),
|
|
63
|
+
gridWrapper: slot.always(props.gridWrapper, {
|
|
64
|
+
defaultProps: {
|
|
65
|
+
role: 'group',
|
|
66
|
+
...focusAttrs
|
|
67
|
+
},
|
|
68
|
+
elementType: 'div'
|
|
69
|
+
}),
|
|
70
|
+
expandButton: slot.optional(props.expandButton, {
|
|
71
|
+
defaultProps: {
|
|
72
|
+
appearance: 'subtle',
|
|
73
|
+
size: 'small',
|
|
74
|
+
shape: 'rounded',
|
|
75
|
+
icon: /*#__PURE__*/React.createElement(ChevronDown12Regular, null),
|
|
76
|
+
iconPosition: 'after',
|
|
77
|
+
'aria-expanded': isExpanded,
|
|
78
|
+
children: isExpanded ? collapseButtonLabel : expandButtonLabel
|
|
79
|
+
},
|
|
80
|
+
renderByDefault: true,
|
|
81
|
+
elementType: Button
|
|
82
|
+
})
|
|
83
|
+
};
|
|
84
|
+
state.gridWrapper.ref = useMergedRefs(gridWrapperRef, state.gridWrapper.ref);
|
|
85
|
+
// Get the array of children.
|
|
86
|
+
const childrenArray = React.useMemo(() => {
|
|
87
|
+
return React.Children.toArray(state.root.children);
|
|
88
|
+
}, [state.root.children]);
|
|
89
|
+
// Add motion to the children.
|
|
90
|
+
const childrenWithMotion = React.useMemo(() => childrenArray.map((child, index) => {
|
|
91
|
+
// Throw error if the child is not a valid React element or is a Fragment.
|
|
92
|
+
if (! /*#__PURE__*/React.isValidElement(child) || child.type === React.Fragment) {
|
|
93
|
+
throw new Error('You should only use PromptStarter components as the children of PromptStarterList.');
|
|
94
|
+
}
|
|
95
|
+
return /*#__PURE__*/React.createElement(PromptStarterMotion, {
|
|
96
|
+
appear: true,
|
|
97
|
+
key: index,
|
|
98
|
+
index: index,
|
|
99
|
+
numberOfColumns: numberOfColumns
|
|
100
|
+
}, child);
|
|
101
|
+
}), [childrenArray, numberOfColumns]);
|
|
102
|
+
// In the collapsed state, we only show 2-3 children depending on the number of numberOfColumns.
|
|
103
|
+
if (!isExpanded) {
|
|
104
|
+
const collapsedVisibleItems = numberOfColumns === 2 ? 2 : 3;
|
|
105
|
+
state.root.children = childrenWithMotion.slice(0, collapsedVisibleItems);
|
|
106
|
+
} else {
|
|
107
|
+
state.root.children = childrenWithMotion;
|
|
108
|
+
}
|
|
109
|
+
if (state.expandButton) {
|
|
110
|
+
state.expandButton.onClick = mergeCallbacks(state.expandButton.onClick, () => setIsExpanded(!isExpanded));
|
|
111
|
+
}
|
|
112
|
+
return state;
|
|
113
|
+
};
|
|
114
|
+
//# sourceMappingURL=usePromptStarterList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["usePromptStarterList.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n getIntrinsicElementProps,\n slot,\n Button,\n useArrowNavigationGroup,\n mergeCallbacks,\n useFluent,\n useMergedRefs,\n} from '@fluentui/react-components';\nimport type { PromptStarterListProps, PromptStarterListState } from './PromptStarterList.types';\nimport { useDesignVersion } from '@fluentui-copilot/react-provider';\nimport { ChevronDown12Regular } from '@fluentui/react-icons';\nimport { PromptStarterMotion } from '../PromptStarter/promptStarterMotion';\n\n/**\n * Create the state required to render PromptStarterList.\n *\n * The returned state can be modified with hooks such as usePromptStarterListStyles_unstable,\n * before being passed to renderPromptStarterList_unstable.\n *\n * @param props - props from this instance of PromptStarterList\n * @param ref - reference to root HTMLElement of PromptStarterList\n */\nexport const usePromptStarterList_unstable = (\n props: PromptStarterListProps,\n ref: React.Ref<HTMLDivElement>,\n): PromptStarterListState => {\n const { arrowNavigationOptions, expandButtonLabel = 'Show more', collapseButtonLabel = 'Show less' } = props;\n const designVersion = useDesignVersion(props.designVersion);\n const focusAttrs = useArrowNavigationGroup({\n ...arrowNavigationOptions,\n axis: arrowNavigationOptions?.axis ?? 'grid-linear',\n memorizeCurrent: arrowNavigationOptions?.memorizeCurrent ?? true,\n });\n\n const [isExpanded, setIsExpanded] = React.useState(false);\n const [numberOfColumns, setNumberOfColumns] = React.useState<number>(3);\n\n const gridWrapperRef = React.useRef<HTMLDivElement>(null);\n const { targetDocument } = useFluent();\n const win = targetDocument?.defaultView;\n\n React.useEffect(() => {\n if (!win || !gridWrapperRef.current) return;\n\n const promptStarterGrid = gridWrapperRef.current;\n\n const updateNumberOfColumns = () => {\n const numColumns = win.getComputedStyle(promptStarterGrid).gridTemplateColumns.split(' ').length;\n setNumberOfColumns(numColumns);\n };\n\n const ro = new win.ResizeObserver(updateNumberOfColumns);\n ro.observe(promptStarterGrid);\n\n return () => {\n ro.unobserve(promptStarterGrid);\n };\n }, [win]);\n\n const state: PromptStarterListState = {\n numberOfColumns: numberOfColumns,\n isExpanded,\n designVersion,\n components: {\n root: 'div',\n gridWrapper: 'div',\n expandButton: Button,\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n }),\n { elementType: 'div' },\n ),\n gridWrapper: slot.always(props.gridWrapper, {\n defaultProps: {\n role: 'group',\n ...focusAttrs,\n },\n elementType: 'div',\n }),\n expandButton: slot.optional(props.expandButton, {\n defaultProps: {\n appearance: 'subtle',\n size: 'small',\n shape: 'rounded',\n icon: <ChevronDown12Regular />,\n iconPosition: 'after',\n 'aria-expanded': isExpanded,\n children: isExpanded ? collapseButtonLabel : expandButtonLabel,\n },\n renderByDefault: true,\n elementType: Button,\n }),\n };\n\n state.gridWrapper.ref = useMergedRefs(gridWrapperRef, state.gridWrapper.ref);\n\n // Get the array of children.\n const childrenArray = React.useMemo<(React.ReactChild | React.ReactFragment | React.ReactPortal)[]>(() => {\n return React.Children.toArray(state.root.children);\n }, [state.root.children]);\n\n // Add motion to the children.\n const childrenWithMotion = React.useMemo(\n () =>\n childrenArray.map((child, index) => {\n // Throw error if the child is not a valid React element or is a Fragment.\n if (!React.isValidElement(child) || child.type === React.Fragment) {\n throw new Error('You should only use PromptStarter components as the children of PromptStarterList.');\n }\n return (\n <PromptStarterMotion appear key={index} index={index} numberOfColumns={numberOfColumns}>\n {child}\n </PromptStarterMotion>\n );\n }),\n [childrenArray, numberOfColumns],\n );\n\n // In the collapsed state, we only show 2-3 children depending on the number of numberOfColumns.\n if (!isExpanded) {\n const collapsedVisibleItems = numberOfColumns === 2 ? 2 : 3;\n state.root.children = childrenWithMotion.slice(0, collapsedVisibleItems);\n } else {\n state.root.children = childrenWithMotion;\n }\n\n if (state.expandButton) {\n state.expandButton.onClick = mergeCallbacks(\n state.expandButton.onClick as React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>,\n () => setIsExpanded(!isExpanded),\n );\n }\n\n return state;\n};\n"],"names":["React","getIntrinsicElementProps","slot","Button","useArrowNavigationGroup","mergeCallbacks","useFluent","useMergedRefs","useDesignVersion","ChevronDown12Regular","PromptStarterMotion","usePromptStarterList_unstable","props","ref","arrowNavigationOptions","expandButtonLabel","collapseButtonLabel","designVersion","focusAttrs","axis","memorizeCurrent","isExpanded","setIsExpanded","useState","numberOfColumns","setNumberOfColumns","gridWrapperRef","useRef","targetDocument","win","defaultView","useEffect","current","promptStarterGrid","updateNumberOfColumns","numColumns","getComputedStyle","gridTemplateColumns","split","length","ro","ResizeObserver","observe","unobserve","state","components","root","gridWrapper","expandButton","always","elementType","defaultProps","role","optional","appearance","size","shape","icon","iconPosition","children","renderByDefault","childrenArray","useMemo","Children","toArray","childrenWithMotion","map","child","index","isValidElement","type","Fragment","Error","appear","key","collapsedVisibleItems","slice","onClick"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"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"}
|
package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListContextValues.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["usePromptStarterListContextValues.ts"],"sourcesContent":["import type { PromptStarterListContextValue, PromptStarterListState } from './PromptStarterList.types';\n\nexport function usePromptStarterListContextValues(state: PromptStarterListState): PromptStarterListContextValue {\n const { numberOfColumns } = state;\n\n return {\n numberOfColumns,\n };\n}\n"],"names":["usePromptStarterListContextValues","state","numberOfColumns"],"rangeMappings":";;;;;","mappings":"AAEA,OAAO,SAASA,kCAAkCC,KAA6B;IAC7E,MAAM,EAAEC,eAAe,EAAE,GAAGD;IAE5B,OAAO;QACLC;IACF;AACF"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { buttonClassNames, __resetStyles, __styles, mergeClasses } from '@fluentui/react-components';
|
|
2
|
+
import { tokens } from '@fluentui-copilot/tokens';
|
|
3
|
+
export const promptStarterListClassNames = {
|
|
4
|
+
root: 'fai-PromptStarterList',
|
|
5
|
+
gridWrapper: 'fai-PromptStarterList__gridWrapper',
|
|
6
|
+
expandButton: 'fai-PromptStarterList__expandButton'
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Styles for the root slot
|
|
10
|
+
*/
|
|
11
|
+
const useRootClassName = __resetStyles("r1n85ojv", null, [".r1n85ojv{display:flex;flex-direction:column;max-width:772px;gap:var(--spacingHorizontalXL);}"]);
|
|
12
|
+
const useStyles = __styles({
|
|
13
|
+
gridWrapper: {
|
|
14
|
+
mc9l5x: "f13qh94s",
|
|
15
|
+
i8kkvl: 0,
|
|
16
|
+
Belr9w4: 0,
|
|
17
|
+
rmohyg: "f1p93rwu",
|
|
18
|
+
t4k1zu: "f4wu0r3",
|
|
19
|
+
Budl1dq: "fvo7o13",
|
|
20
|
+
Bxotwcr: "f1nkeedh"
|
|
21
|
+
},
|
|
22
|
+
expandButton: {
|
|
23
|
+
qb2dma: "f1locze1",
|
|
24
|
+
wrk2wx: "f11k2d1d",
|
|
25
|
+
dutsh0: "f1iwh30k",
|
|
26
|
+
B4u5nao: "fn63aq9",
|
|
27
|
+
Bbdnnc7: "fm7zj7h",
|
|
28
|
+
x3br3k: "fuzcl37"
|
|
29
|
+
},
|
|
30
|
+
expandButtonExpanded: {
|
|
31
|
+
Bs9jjb3: ["f5l68jj", "f1i29bk4"]
|
|
32
|
+
}
|
|
33
|
+
}, {
|
|
34
|
+
d: [".f13qh94s{display:grid;}", [".f1p93rwu{gap:var(--spacingHorizontalL);}", {
|
|
35
|
+
p: -1
|
|
36
|
+
}], ".f4wu0r3{grid-auto-columns:max-content;}", ".fvo7o13{grid-template-columns:repeat(auto-fit, minmax(214px, 1fr));}", ".f1nkeedh{grid-auto-flow:unset;}", ".f1locze1{align-self:end;}", ".f11k2d1d .fui-Button__icon{font-size:12px;}", ".f1iwh30k .fui-Button__icon{height:12px;}", ".fn63aq9 .fui-Button__icon{width:12px;}", ".f5l68jj>.fui-Button__icon{transform:rotate(180deg);}", ".f1i29bk4>.fui-Button__icon{transform:rotate(-180deg);}"],
|
|
37
|
+
h: [".fm7zj7h:hover .fui-Button__icon{color:var(--colorNeutralForeground2Hover);}", ".fuzcl37:hover:active .fui-Button__icon{color:var(--colorNeutralForeground2Pressed);}"]
|
|
38
|
+
});
|
|
39
|
+
/**
|
|
40
|
+
* Apply styling to the PromptStarterList slots based on the state
|
|
41
|
+
*/
|
|
42
|
+
export const usePromptStarterListStyles_unstable = state => {
|
|
43
|
+
'use no memo';
|
|
44
|
+
|
|
45
|
+
const {
|
|
46
|
+
isExpanded
|
|
47
|
+
} = state;
|
|
48
|
+
const rootClassName = useRootClassName();
|
|
49
|
+
const styles = useStyles();
|
|
50
|
+
state.root.className = mergeClasses(promptStarterListClassNames.root, rootClassName, state.root.className);
|
|
51
|
+
state.gridWrapper.className = mergeClasses(promptStarterListClassNames.gridWrapper, styles.gridWrapper, state.gridWrapper.className);
|
|
52
|
+
if (state.expandButton) {
|
|
53
|
+
state.expandButton.className = mergeClasses(promptStarterListClassNames.expandButton, styles.expandButton, isExpanded && styles.expandButtonExpanded, state.expandButton.className);
|
|
54
|
+
}
|
|
55
|
+
return state;
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=usePromptStarterListStyles.styles.js.map
|
package/lib/components/PromptStarterV2/PromptStarterList/usePromptStarterListStyles.styles.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["usePromptStarterListStyles.styles.ts"],"sourcesContent":["import { buttonClassNames, makeResetStyles, makeStyles, mergeClasses } from '@fluentui/react-components';\nimport type { PromptStarterListSlots, PromptStarterListState } from './PromptStarterList.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\n\nexport const promptStarterListClassNames: SlotClassNames<PromptStarterListSlots> = {\n root: 'fai-PromptStarterList',\n gridWrapper: 'fai-PromptStarterList__gridWrapper',\n expandButton: 'fai-PromptStarterList__expandButton',\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootClassName = makeResetStyles({\n display: 'flex',\n flexDirection: 'column',\n maxWidth: '772px',\n gap: tokens.spacingHorizontalXL,\n});\n\nconst useStyles = makeStyles({\n gridWrapper: {\n display: 'grid',\n gap: tokens.spacingHorizontalL,\n gridAutoColumns: 'max-content',\n\n gridTemplateColumns: `repeat(auto-fit, minmax(214px, 1fr))`,\n gridAutoFlow: 'unset',\n },\n\n expandButton: {\n alignSelf: 'end',\n [`& .${buttonClassNames.icon}`]: {\n fontSize: '12px',\n height: '12px',\n width: '12px',\n },\n ':hover': {\n [`& .${buttonClassNames.icon}`]: {\n color: tokens.colorNeutralForeground2Hover,\n },\n },\n ':hover:active': {\n [`& .${buttonClassNames.icon}`]: {\n color: tokens.colorNeutralForeground2Pressed,\n },\n },\n },\n\n expandButtonExpanded: {\n [`& > .${buttonClassNames.icon}`]: {\n transform: 'rotate(180deg)',\n },\n },\n});\n\n/**\n * Apply styling to the PromptStarterList slots based on the state\n */\nexport const usePromptStarterListStyles_unstable = (state: PromptStarterListState): PromptStarterListState => {\n 'use no memo';\n\n const { isExpanded } = state;\n\n const rootClassName = useRootClassName();\n const styles = useStyles();\n state.root.className = mergeClasses(promptStarterListClassNames.root, rootClassName, state.root.className);\n state.gridWrapper.className = mergeClasses(\n promptStarterListClassNames.gridWrapper,\n styles.gridWrapper,\n state.gridWrapper.className,\n );\n if (state.expandButton) {\n state.expandButton.className = mergeClasses(\n promptStarterListClassNames.expandButton,\n styles.expandButton,\n isExpanded && styles.expandButtonExpanded,\n state.expandButton.className,\n );\n }\n\n return state;\n};\n"],"names":["buttonClassNames","makeResetStyles","makeStyles","mergeClasses","tokens","promptStarterListClassNames","root","gridWrapper","expandButton","useRootClassName","display","flexDirection","maxWidth","gap","spacingHorizontalXL","useStyles","spacingHorizontalL","gridAutoColumns","gridTemplateColumns","gridAutoFlow","alignSelf","icon","fontSize","height","width","color","colorNeutralForeground2Hover","colorNeutralForeground2Pressed","expandButtonExpanded","transform","usePromptStarterListStyles_unstable","state","isExpanded","rootClassName","styles","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,gBAAgB,EAAEC,eAAe,EAAEC,UAAU,EAAEC,YAAY,QAAQ,6BAA6B;AAGzG,SAASC,MAAM,QAAQ,2BAA2B;AAElD,OAAO,MAAMC,8BAAsE;IACjFC,MAAM;IACNC,aAAa;IACbC,cAAc;AAChB,EAAE;AAEF;;CAEC,GACD,MAAMC,mBAAmBR,gBAAgB;IACvCS,SAAS;IACTC,eAAe;IACfC,UAAU;IACVC,KAAKT,OAAOU,mBAAmB;AACjC;AAEA,MAAMC,YAAYb,WAAW;IAC3BK,aAAa;QACXG,SAAS;QACTG,KAAKT,OAAOY,kBAAkB;QAC9BC,iBAAiB;QAEjBC,qBAAqB,CAAC,oCAAoC,CAAC;QAC3DC,cAAc;IAChB;IAEAX,cAAc;QACZY,WAAW;QACX,CAAC,CAAC,GAAG,EAAEpB,iBAAiBqB,IAAI,CAAC,CAAC,CAAC,EAAE;YAC/BC,UAAU;YACVC,QAAQ;YACRC,OAAO;QACT;QACA,UAAU;YACR,CAAC,CAAC,GAAG,EAAExB,iBAAiBqB,IAAI,CAAC,CAAC,CAAC,EAAE;gBAC/BI,OAAOrB,OAAOsB,4BAA4B;YAC5C;QACF;QACA,iBAAiB;YACf,CAAC,CAAC,GAAG,EAAE1B,iBAAiBqB,IAAI,CAAC,CAAC,CAAC,EAAE;gBAC/BI,OAAOrB,OAAOuB,8BAA8B;YAC9C;QACF;IACF;IAEAC,sBAAsB;QACpB,CAAC,CAAC,KAAK,EAAE5B,iBAAiBqB,IAAI,CAAC,CAAC,CAAC,EAAE;YACjCQ,WAAW;QACb;IACF;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,sCAAsC,CAACC;IAClD;IAEA,MAAM,EAAEC,UAAU,EAAE,GAAGD;IAEvB,MAAME,gBAAgBxB;IACtB,MAAMyB,SAASnB;IACfgB,MAAMzB,IAAI,CAAC6B,SAAS,GAAGhC,aAAaE,4BAA4BC,IAAI,EAAE2B,eAAeF,MAAMzB,IAAI,CAAC6B,SAAS;IACzGJ,MAAMxB,WAAW,CAAC4B,SAAS,GAAGhC,aAC5BE,4BAA4BE,WAAW,EACvC2B,OAAO3B,WAAW,EAClBwB,MAAMxB,WAAW,CAAC4B,SAAS;IAE7B,IAAIJ,MAAMvB,YAAY,EAAE;QACtBuB,MAAMvB,YAAY,CAAC2B,SAAS,GAAGhC,aAC7BE,4BAA4BG,YAAY,EACxC0B,OAAO1B,YAAY,EACnBwB,cAAcE,OAAON,oBAAoB,EACzCG,MAAMvB,YAAY,CAAC2B,SAAS;IAEhC;IAEA,OAAOJ;AACT,EAAE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createContext, useContextSelector } from '@fluentui/react-context-selector';
|
|
2
|
+
export const PromptStarterListContext = createContext(undefined);
|
|
3
|
+
const promptStarterListContextDefaultValue = {
|
|
4
|
+
numberOfColumns: 3
|
|
5
|
+
};
|
|
6
|
+
export const usePromptStarterListContext = selector => useContextSelector(PromptStarterListContext, (ctx = promptStarterListContextDefaultValue) => selector(ctx));
|
|
7
|
+
export const PromptStarterListProvider = PromptStarterListContext.Provider;
|
|
8
|
+
//# sourceMappingURL=PromptStarterListContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["PromptStarterListContext.ts"],"sourcesContent":["import { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { ContextSelector } from '@fluentui/react-context-selector';\nimport type { PromptStarterListContextValue } from '../PromptStarterList';\n\nexport const PromptStarterListContext = createContext<PromptStarterListContextValue | undefined>(undefined);\n\nconst promptStarterListContextDefaultValue: PromptStarterListContextValue = {\n numberOfColumns: 3,\n};\n\nexport const usePromptStarterListContext = <T>(selector: ContextSelector<PromptStarterListContextValue, T>) =>\n useContextSelector(PromptStarterListContext, (ctx = promptStarterListContextDefaultValue) => selector(ctx));\nexport const PromptStarterListProvider = PromptStarterListContext.Provider;\n"],"names":["createContext","useContextSelector","PromptStarterListContext","undefined","promptStarterListContextDefaultValue","numberOfColumns","usePromptStarterListContext","selector","ctx","PromptStarterListProvider","Provider"],"rangeMappings":";;;;;;","mappings":"AAAA,SAASA,aAAa,EAAEC,kBAAkB,QAAQ,mCAAmC;AAIrF,OAAO,MAAMC,2BAA2BF,cAAyDG,WAAW;AAE5G,MAAMC,uCAAsE;IAC1EC,iBAAiB;AACnB;AAEA,OAAO,MAAMC,8BAA8B,CAAIC,WAC7CN,mBAAmBC,0BAA0B,CAACM,MAAMJ,oCAAoC,GAAKG,SAASC,MAAM;AAC9G,OAAO,MAAMC,4BAA4BP,yBAAyBQ,QAAQ,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export { PromptStarter, promptStarterClassNames, renderPromptStarter_unstable, usePromptStarterStyles_unstable, usePromptStarter_unstable } from './PromptStarter';
|
|
2
|
+
export { PromptStarter as PromptStarterV2, promptStarterClassNames as promptStarterV2ClassNames, renderPromptStarter_unstable as renderPromptStarterV2_unstable, usePromptStarterStyles_unstable as usePromptStarterV2Styles_unstable, usePromptStarter_unstable as usePromptStarterV2_unstable } from './PromptStarterV2';
|
|
3
|
+
export { PromptStarterList, renderPromptStarterList_unstable, usePromptStarterList_unstable, promptStarterListClassNames, usePromptStarterListStyles_unstable } from './PromptStarterList';
|
|
2
4
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export type { PromptStarterProps, PromptStarterSlots, PromptStarterState } from './PromptStarter';\nexport {\n PromptStarter,\n promptStarterClassNames,\n renderPromptStarter_unstable,\n usePromptStarterStyles_unstable,\n usePromptStarter_unstable,\n} from './PromptStarter';\n"],"names":["PromptStarter","promptStarterClassNames","renderPromptStarter_unstable","usePromptStarterStyles_unstable","usePromptStarter_unstable"],"rangeMappings":"","mappings":"AACA,SACEA,aAAa,EACbC,uBAAuB,EACvBC,4BAA4B,EAC5BC,+BAA+B,EAC/BC,yBAAyB,QACpB,kBAAkB"}
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export type { PromptStarterProps, PromptStarterSlots, PromptStarterState } from './PromptStarter';\nexport {\n PromptStarter,\n promptStarterClassNames,\n renderPromptStarter_unstable,\n usePromptStarterStyles_unstable,\n usePromptStarter_unstable,\n} from './PromptStarter';\n\nexport type {\n PromptStarterProps as PromptStarterV2Props,\n PromptStarterSlots as PromptStarterV2Slots,\n PromptStarterState as PromptStarterV2State,\n} from './PromptStarterV2';\nexport {\n PromptStarter as PromptStarterV2,\n promptStarterClassNames as promptStarterV2ClassNames,\n renderPromptStarter_unstable as renderPromptStarterV2_unstable,\n usePromptStarterStyles_unstable as usePromptStarterV2Styles_unstable,\n usePromptStarter_unstable as usePromptStarterV2_unstable,\n} from './PromptStarterV2';\n\nexport {\n PromptStarterList,\n renderPromptStarterList_unstable,\n usePromptStarterList_unstable,\n promptStarterListClassNames,\n usePromptStarterListStyles_unstable,\n} from './PromptStarterList';\nexport type { PromptStarterListProps, PromptStarterListSlots, PromptStarterListState } from './PromptStarterList';"],"names":["PromptStarter","promptStarterClassNames","renderPromptStarter_unstable","usePromptStarterStyles_unstable","usePromptStarter_unstable","PromptStarterV2","promptStarterV2ClassNames","renderPromptStarterV2_unstable","usePromptStarterV2Styles_unstable","usePromptStarterV2_unstable","PromptStarterList","renderPromptStarterList_unstable","usePromptStarterList_unstable","promptStarterListClassNames","usePromptStarterListStyles_unstable"],"rangeMappings":";;","mappings":"AACA,SACEA,aAAa,EACbC,uBAAuB,EACvBC,4BAA4B,EAC5BC,+BAA+B,EAC/BC,yBAAyB,QACpB,kBAAkB;AAOzB,SACEJ,iBAAiBK,eAAe,EAChCJ,2BAA2BK,yBAAyB,EACpDJ,gCAAgCK,8BAA8B,EAC9DJ,mCAAmCK,iCAAiC,EACpEJ,6BAA6BK,2BAA2B,QACnD,oBAAoB;AAE3B,SACEC,iBAAiB,EACjBC,gCAAgC,EAChCC,6BAA6B,EAC7BC,2BAA2B,EAC3BC,mCAAmC,QAC9B,sBAAsB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
PromptStarterList: function() {
|
|
13
|
+
return _index.PromptStarterList;
|
|
14
|
+
},
|
|
15
|
+
promptStarterListClassNames: function() {
|
|
16
|
+
return _index.promptStarterListClassNames;
|
|
17
|
+
},
|
|
18
|
+
renderPromptStarterList_unstable: function() {
|
|
19
|
+
return _index.renderPromptStarterList_unstable;
|
|
20
|
+
},
|
|
21
|
+
usePromptStarterListStyles_unstable: function() {
|
|
22
|
+
return _index.usePromptStarterListStyles_unstable;
|
|
23
|
+
},
|
|
24
|
+
usePromptStarterList_unstable: function() {
|
|
25
|
+
return _index.usePromptStarterList_unstable;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const _index = require("./components/PromptStarterV2/PromptStarterList/index");
|
|
29
|
+
//# sourceMappingURL=PromptStarterList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["PromptStarterList.ts"],"sourcesContent":["export {\n PromptStarterList,\n renderPromptStarterList_unstable,\n usePromptStarterList_unstable,\n promptStarterListClassNames,\n usePromptStarterListStyles_unstable,\n} from './components/PromptStarterV2/PromptStarterList/index';\nexport type {\n PromptStarterListProps,\n PromptStarterListSlots,\n PromptStarterListState,\n PromptStarterListContextValue,\n} from './components/PromptStarterV2/PromptStarterList/index';\n"],"names":["PromptStarterList","promptStarterListClassNames","renderPromptStarterList_unstable","usePromptStarterListStyles_unstable","usePromptStarterList_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACEA,iBAAiB;eAAjBA,wBAAiB;;IAGjBC,2BAA2B;eAA3BA,kCAA2B;;IAF3BC,gCAAgC;eAAhCA,uCAAgC;;IAGhCC,mCAAmC;eAAnCA,0CAAmC;;IAFnCC,6BAA6B;eAA7BA,oCAA6B;;;uBAGxB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
PromptStarter: function() {
|
|
13
|
+
return _index.PromptStarter;
|
|
14
|
+
},
|
|
15
|
+
promptStarterClassNames: function() {
|
|
16
|
+
return _index.promptStarterClassNames;
|
|
17
|
+
},
|
|
18
|
+
renderPromptStarter_unstable: function() {
|
|
19
|
+
return _index.renderPromptStarter_unstable;
|
|
20
|
+
},
|
|
21
|
+
usePromptStarterStyles_unstable: function() {
|
|
22
|
+
return _index.usePromptStarterStyles_unstable;
|
|
23
|
+
},
|
|
24
|
+
usePromptStarter_unstable: function() {
|
|
25
|
+
return _index.usePromptStarter_unstable;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const _index = require("./components/PromptStarterV2/PromptStarter/index");
|
|
29
|
+
//# sourceMappingURL=PromptStarterV2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["PromptStarterV2.ts"],"sourcesContent":["export type {\n PromptStarterProps,\n PromptStarterSlots,\n PromptStarterState,\n} from './components/PromptStarterV2/PromptStarter/index';\nexport {\n PromptStarter,\n promptStarterClassNames,\n renderPromptStarter_unstable,\n usePromptStarterStyles_unstable,\n usePromptStarter_unstable,\n} from './components/PromptStarterV2/PromptStarter/index';\n"],"names":["PromptStarter","promptStarterClassNames","renderPromptStarter_unstable","usePromptStarterStyles_unstable","usePromptStarter_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAMEA,aAAa;eAAbA,oBAAa;;IACbC,uBAAuB;eAAvBA,8BAAuB;;IACvBC,4BAA4B;eAA5BA,mCAA4B;;IAC5BC,+BAA+B;eAA/BA,sCAA+B;;IAC/BC,yBAAyB;eAAzBA,gCAAyB;;;uBACpB"}
|