@handijitcom/ui 3.6.0 → 3.7.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/README.md +194 -36
- package/build/chat.cjs +3 -3
- package/build/chat.cjs.map +1 -1
- package/build/chat.css +1 -1
- package/build/chat.js +168 -160
- package/build/chat.js.map +1 -1
- package/build/components/Alert/index.cjs +1 -1
- package/build/components/Alert/index.cjs.map +1 -1
- package/build/components/Alert/index.d.cts +7 -0
- package/build/components/Alert/index.d.ts +7 -0
- package/build/components/Alert/index.js +32 -19
- package/build/components/Alert/index.js.map +1 -1
- package/build/components/Alert/style.css +1 -1
- package/build/components/AppShell/style.css +1 -1
- package/build/components/AppliedFilters/style.css +1 -1
- package/build/components/Chip/style.css +1 -1
- package/build/components/CommandPalette/style.css +1 -1
- package/build/components/Directory/style.css +1 -1
- package/build/components/EmptyState/style.css +1 -1
- package/build/components/FacetSection/index.cjs +1 -1
- package/build/components/FacetSection/index.cjs.map +1 -1
- package/build/components/FacetSection/index.js +145 -138
- package/build/components/FacetSection/index.js.map +1 -1
- package/build/components/FacetSection/style.css +1 -1
- package/build/components/FacetSidebar/index.cjs +1 -1
- package/build/components/FacetSidebar/index.cjs.map +1 -1
- package/build/components/FacetSidebar/index.js +22 -29
- package/build/components/FacetSidebar/index.js.map +1 -1
- package/build/components/Heading/index.cjs +2 -0
- package/build/components/Heading/index.cjs.map +1 -0
- package/build/components/Heading/index.d.cts +34 -0
- package/build/components/Heading/index.d.ts +34 -0
- package/build/components/Heading/index.js +44 -0
- package/build/components/Heading/index.js.map +1 -0
- package/build/components/Heading/style.css +1 -0
- package/build/components/MegaMenu/index.cjs +1 -1
- package/build/components/MegaMenu/index.cjs.map +1 -1
- package/build/components/MegaMenu/index.d.cts +5 -1
- package/build/components/MegaMenu/index.d.ts +5 -1
- package/build/components/MegaMenu/index.js +131 -111
- package/build/components/MegaMenu/index.js.map +1 -1
- package/build/components/MegaMenu/style.css +1 -1
- package/build/components/Modal/style.css +1 -1
- package/build/components/NotificationCenter/style.css +1 -1
- package/build/components/PageHeader/style.css +1 -1
- package/build/components/Price/index.cjs +1 -1
- package/build/components/Price/index.cjs.map +1 -1
- package/build/components/Price/index.d.cts +5 -1
- package/build/components/Price/index.d.ts +5 -1
- package/build/components/Price/index.js +31 -32
- package/build/components/Price/index.js.map +1 -1
- package/build/components/Price/style.css +1 -1
- package/build/components/Radio/style.css +1 -1
- package/build/components/SectionHeader/style.css +1 -1
- package/build/components/Stat/index.cjs +1 -1
- package/build/components/Stat/index.cjs.map +1 -1
- package/build/components/Stat/index.d.cts +7 -3
- package/build/components/Stat/index.d.ts +7 -3
- package/build/components/Stat/index.js +61 -66
- package/build/components/Stat/index.js.map +1 -1
- package/build/components/StatCard/StatDelta.cjs +2 -0
- package/build/components/StatCard/StatDelta.cjs.map +1 -0
- package/build/components/StatCard/StatDelta.d.cts +17 -0
- package/build/components/StatCard/StatDelta.d.ts +17 -0
- package/build/components/StatCard/StatDelta.js +45 -0
- package/build/components/StatCard/StatDelta.js.map +1 -0
- package/build/components/StatCard/index.cjs +2 -0
- package/build/components/StatCard/index.cjs.map +1 -0
- package/build/components/StatCard/index.d.cts +36 -0
- package/build/components/StatCard/index.d.ts +36 -0
- package/build/components/StatCard/index.js +60 -0
- package/build/components/StatCard/index.js.map +1 -0
- package/build/components/StatCard/style.css +1 -0
- package/build/components/Table/style.css +1 -1
- package/build/components/Tabs/index.cjs +1 -1
- package/build/components/Tabs/index.cjs.map +1 -1
- package/build/components/Tabs/index.d.cts +26 -1
- package/build/components/Tabs/index.d.ts +26 -1
- package/build/components/Tabs/index.js +140 -112
- package/build/components/Tabs/index.js.map +1 -1
- package/build/components/Tabs/style.css +1 -1
- package/build/components/Text/index.cjs +2 -0
- package/build/components/Text/index.cjs.map +1 -0
- package/build/components/Text/index.d.cts +49 -0
- package/build/components/Text/index.d.ts +49 -0
- package/build/components/Text/index.js +47 -0
- package/build/components/Text/index.js.map +1 -0
- package/build/components/Text/style.css +1 -0
- package/build/design/index.cjs +12 -2
- package/build/design/index.cjs.map +1 -1
- package/build/design/index.d.cts +1 -5
- package/build/design/index.d.mts +1 -5
- package/build/design/index.mjs +12 -2
- package/build/design/index.mjs.map +1 -1
- package/build/design/index.umd.cjs +1 -1
- package/build/design/index.umd.cjs.map +1 -1
- package/build/design/tokens.css +29 -4
- package/build/design/tokens.json +42 -2
- package/build/design/tokens.scss +55 -0
- package/build/helpers/text.helper.cjs +1 -1
- package/build/helpers/text.helper.cjs.map +1 -1
- package/build/helpers/text.helper.d.cts +5 -0
- package/build/helpers/text.helper.d.ts +5 -0
- package/build/helpers/text.helper.js +3 -2
- package/build/helpers/text.helper.js.map +1 -1
- package/build/index.cjs +1 -1
- package/build/index.d.cts +5 -2
- package/build/index.d.ts +5 -2
- package/build/index.js +169 -163
- package/build/index.js.map +1 -1
- package/build/scss/_mixins.scss +101 -13
- package/build/scss/_variables.scss +5 -1
- package/build/styles.css +24 -18
- package/build/types/chat/DescriptionList/index.d.cts +6 -0
- package/build/types/chat/DescriptionList/index.d.ts +6 -0
- package/build/types/stat.type.d.cts +2 -0
- package/build/types/stat.type.d.ts +2 -0
- package/package.json +31 -1
package/README.md
CHANGED
|
@@ -225,20 +225,21 @@ Besides the design tokens, a few components read custom properties of their own
|
|
|
225
225
|
(`var(--ui-…, default)`) so an application can restyle one component from
|
|
226
226
|
`:root` without a class selector:
|
|
227
227
|
|
|
228
|
-
| Component
|
|
229
|
-
|
|
|
230
|
-
| focus ring
|
|
231
|
-
| inputs
|
|
232
|
-
| modal scrim
|
|
233
|
-
| `Button`
|
|
234
|
-
| `Chip`
|
|
235
|
-
| `Badge`
|
|
236
|
-
| `Stat`
|
|
237
|
-
| `Tabs`
|
|
238
|
-
| `RadioCard`
|
|
239
|
-
| sticky parts
|
|
240
|
-
| overlines
|
|
241
|
-
|
|
|
228
|
+
| Component | Variables |
|
|
229
|
+
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
230
|
+
| focus ring | `--ui-ring-width` (2px) · `--ui-ring-offset` (2px; `-2px` pulls it inside) |
|
|
231
|
+
| inputs | `--ui-placeholder` (`text-3`) |
|
|
232
|
+
| modal scrim | `--ui-scrim-blur` |
|
|
233
|
+
| `Button` | `--ui-button-radius` · `-weight` · `-tracking` · `-wrap` (`nowrap`) |
|
|
234
|
+
| `Chip` | `--ui-chip-bg` · `-line` · `-fg` · `-radius` · `-weight` · `-selected-bg` · `-selected-line` · `-selected-fg` · `-selected-weight` |
|
|
235
|
+
| `Badge` | `--ui-badge-font` · `-weight` · `-tracking` · `-transform` · `-radius` · `-bg` · `-line` · `-fg` |
|
|
236
|
+
| `Stat` | `--ui-stat-label-font/-size/-weight/-tracking/-transform` · `-value-font/-weight/-tracking` · `-unit-font/-size/-tracking/-transform` (`StatCard` reads them too, 3.7) |
|
|
237
|
+
| `Tabs` | `--ui-tab-weight` |
|
|
238
|
+
| `RadioCard` | `--ui-radio-card-line` · `-radius` |
|
|
239
|
+
| sticky parts | `--ui-header-height` (see below) |
|
|
240
|
+
| overlines | `--ui-overline-font` (3.4): the family of every overline — `Eyebrow`, section and filter leads, sticky table heads · `--ui-overline-transform` (`none`) · `--ui-overline-tracking` (`normal`) (3.7: capitals are opt-in) |
|
|
241
|
+
| `FacetSection` | `--ui-facet-clear-width` (5rem, 3.7): the room the header row keeps for "Temizle" |
|
|
242
|
+
| bottom bars | `--ui-sticky-bar-height` (3.4): written by `StickyActionBar` while shown; `CompareTray` sits above it, a page can pad with it |
|
|
242
243
|
|
|
243
244
|
```css
|
|
244
245
|
:root {
|
|
@@ -937,6 +938,99 @@ and one flag.
|
|
|
937
938
|
rule. Give its `Price` a larger `size` for more weight; usually one row has it.
|
|
938
939
|
- A row never breaks across two printed pages.
|
|
939
940
|
|
|
941
|
+
### Interface typography and discipline (3.7)
|
|
942
|
+
|
|
943
|
+
The parts portal's review found the interface undisciplined: text sized by hand on every screen,
|
|
944
|
+
cards the colour of the page, labels in mono capitals that broke onto two lines, a tab line 12px
|
|
945
|
+
above its rule, a mega menu 70% empty. 3.7 fixes the causes in the system:
|
|
946
|
+
|
|
947
|
+
- **Layers you can see.** The light page is a cool grey-blue (`#eef2f9`), 4.1 ΔE under the white
|
|
948
|
+
surface (it was 1.25); dark keeps its 4.1. A card separates by its fill. Inside a card a note is
|
|
949
|
+
`<Alert variant="inline">` — the tint without its frame, no border inside a border. Shadows are for
|
|
950
|
+
layers only: `shadow-2` menus and popovers, `shadow-3` dialogs; a card has none at rest.
|
|
951
|
+
- **One type scale.** `Heading` and `Text`; a page writes no raw `<h1>`–`<h6>` or sized `<p>`.
|
|
952
|
+
- **Labels as written.** Overlines, table heads and group titles are 13px semibold in `text-2`,
|
|
953
|
+
never forced capitals (`--ui-overline-transform` turns capitals back on for a brand that wants
|
|
954
|
+
them). Mono is for part numbers, stock codes and order numbers only (`<Text variant="code">`).
|
|
955
|
+
- **One active-navigation mark.** A 2px straight `primary` line: under a tab or a category, at the
|
|
956
|
+
start of a side-navigation item (`nav-indicator` in the SCSS API).
|
|
957
|
+
- **Counts look the same everywhere.** Secondary tabular figures at the end of the row, no pill:
|
|
958
|
+
facet options, facet headers, mega-menu links (`count-text`). A tab's count is a 20px chip on the
|
|
959
|
+
label's scale.
|
|
960
|
+
- **Text never overflows.** Titles clamp at two lines, cells and labels at one, with an ellipsis and
|
|
961
|
+
the full text in `title` (`maxLines` on `Heading` / `Text`; `line-clamp` and `text-truncate` in
|
|
962
|
+
SCSS).
|
|
963
|
+
- **Figures line up.** Tabular digits on every number; `Price` writes a negative amount with the true
|
|
964
|
+
minus, "−₺1.229,00"; `size="inherit"` makes a price take its slot's size.
|
|
965
|
+
|
|
966
|
+
```tsx
|
|
967
|
+
<Heading level={1} size="lg" maxLines={2}>Ön far (sol) – Stralis / S-Way / Trakker</Heading>
|
|
968
|
+
<Heading level={2}>Teknik özellikler</Heading> {/* 22px */}
|
|
969
|
+
<Heading level={3} size="xs">Teslimat adresi</Heading> {/* 15px, a block in a card */}
|
|
970
|
+
|
|
971
|
+
<Text variant="label">Satış birimi</Text> {/* 13px medium, text-2 */}
|
|
972
|
+
<Text>Adet</Text> {/* 15px body */}
|
|
973
|
+
<Text variant="code">428959612</Text> {/* mono: codes only */}
|
|
974
|
+
<Text variant="small" maxLines={1}>Karadeniz Oto Yedek Parça Ltd. Şti.</Text>
|
|
975
|
+
```
|
|
976
|
+
|
|
977
|
+
| `Heading` `size` | px | role | default for |
|
|
978
|
+
| ---------------- | --: | --------- | ------------------------------------------ |
|
|
979
|
+
| `xl` | 32 | `title-1` | `level={1}` — the page title |
|
|
980
|
+
| `lg` | 28 | `title-2` | — a product title (`level={1} size="lg"`) |
|
|
981
|
+
| `md` | 22 | `title-3` | `level={2}` — a section |
|
|
982
|
+
| `sm` | 18 | `title-4` | `level={3}` |
|
|
983
|
+
| `xs` | 15 | `title-5` | `level={4}`–`6` — a block inside a surface |
|
|
984
|
+
|
|
985
|
+
`Text` `variant`: `body` 15 · `small` 13 · `caption` 12 · `label` 13 medium `text-2` · `numeric`
|
|
986
|
+
15 tabular, one line · `code` 13 mono. `weight`: `regular` · `medium` · `semibold`. `tone`:
|
|
987
|
+
`default` · `secondary` · `tertiary` · `success` (cobalt) · `danger` · `inherit`. `as` picks the
|
|
988
|
+
element (`p` for `body` / `small`, `span` otherwise; `label` with `htmlFor`, `time` with `dateTime`).
|
|
989
|
+
|
|
990
|
+
**KPIs: `StatCard`.** The one key-figure pattern: a one-line label with its icon at the end, a
|
|
991
|
+
one-line 22px value in tabular figures (18px `size="sm"`), then the change and one line of context.
|
|
992
|
+
Neighbouring cards line up on every line whatever the label's length. `Stat`'s `card` variant draws
|
|
993
|
+
a `StatCard`; `plain` and `inline` keep their layouts.
|
|
994
|
+
|
|
995
|
+
```tsx
|
|
996
|
+
<StatCard
|
|
997
|
+
label="Bugünkü sipariş tutarı"
|
|
998
|
+
value={<Price value="212.058,87" size="inherit" />}
|
|
999
|
+
delta="%12"
|
|
1000
|
+
trend="up"
|
|
1001
|
+
description="düne göre"
|
|
1002
|
+
icon={<Cash />}
|
|
1003
|
+
/>
|
|
1004
|
+
<StatCard label="Vadesi geçen bayi" value="2" tone="danger" />
|
|
1005
|
+
```
|
|
1006
|
+
|
|
1007
|
+
**Tabs.** `variant="card"` puts the strip and the panel on one surface (a product page's details);
|
|
1008
|
+
`size="lg"` is 15px tabs. `isEveryPanelRendered` keeps every panel in the HTML (hidden but one) for
|
|
1009
|
+
search engines and in-page find; `isHashSynced` keeps the selected tab in `#<id>`.
|
|
1010
|
+
|
|
1011
|
+
```tsx
|
|
1012
|
+
<Tabs
|
|
1013
|
+
variant="card"
|
|
1014
|
+
size="lg"
|
|
1015
|
+
isEveryPanelRendered
|
|
1016
|
+
isHashSynced
|
|
1017
|
+
items={[
|
|
1018
|
+
{ id: 'ozellikler', label: 'Teknik özellikler', content: specs },
|
|
1019
|
+
{ id: 'numaralar', label: 'Parça numaraları', count: 4, content: numbers },
|
|
1020
|
+
]}
|
|
1021
|
+
/>
|
|
1022
|
+
```
|
|
1023
|
+
|
|
1024
|
+
**Mega menu.** The panel is as wide as its content and hangs under its category: one column per
|
|
1025
|
+
group (up to three), a lone long group split into them, never an empty column; a link takes a
|
|
1026
|
+
`count`; the `feature` sits on a sunken block beside the columns.
|
|
1027
|
+
|
|
1028
|
+
**Facets.** "Temizle" sits in the section's header row; radio and checkbox rows are the same row
|
|
1029
|
+
with one flat hover; counts and the selection count are plain secondary figures.
|
|
1030
|
+
|
|
1031
|
+
**Summaries.** `TotalsList` for money totals; `DescriptionList` (`/chat`) takes
|
|
1032
|
+
`valueAlign="end"` to set values against the end edge in tabular figures.
|
|
1033
|
+
|
|
940
1034
|
### Commerce building blocks (3.4)
|
|
941
1035
|
|
|
942
1036
|
A storefront's catalogue, product page and header. Each component has its own
|
|
@@ -962,9 +1056,28 @@ opens by itself while it holds a selection.
|
|
|
962
1056
|
applyLabel={`${formatNumber(total)} ürünü göster`}
|
|
963
1057
|
>
|
|
964
1058
|
<FacetSection title="Kategori" mode="link" options={categories} selected={[category]} />
|
|
965
|
-
<FacetSection
|
|
966
|
-
|
|
967
|
-
|
|
1059
|
+
<FacetSection
|
|
1060
|
+
title="Marka"
|
|
1061
|
+
options={brands}
|
|
1062
|
+
selected={brandIds}
|
|
1063
|
+
onChange={setBrands}
|
|
1064
|
+
onClear={clearBrands}
|
|
1065
|
+
/>
|
|
1066
|
+
<FacetSection
|
|
1067
|
+
title="Kalite"
|
|
1068
|
+
mode="radio"
|
|
1069
|
+
options={qualities}
|
|
1070
|
+
selected={[quality]}
|
|
1071
|
+
onChange={([q]) => setQuality(q)}
|
|
1072
|
+
/>
|
|
1073
|
+
<FacetSection
|
|
1074
|
+
title="Fiyat"
|
|
1075
|
+
mode="range"
|
|
1076
|
+
currency="TL"
|
|
1077
|
+
range={price}
|
|
1078
|
+
onRangeChange={setPrice}
|
|
1079
|
+
onClear={clearPrice}
|
|
1080
|
+
/>
|
|
968
1081
|
<FacetSection title="Aracım" selectedCount={vehicle ? 1 : 0}>
|
|
969
1082
|
<VehiclePicker />
|
|
970
1083
|
</FacetSection>
|
|
@@ -989,7 +1102,12 @@ keep removing.
|
|
|
989
1102
|
|
|
990
1103
|
```tsx
|
|
991
1104
|
<AppliedFilters
|
|
992
|
-
filters={applied.map(filter => ({
|
|
1105
|
+
filters={applied.map(filter => ({
|
|
1106
|
+
key: filter.key,
|
|
1107
|
+
group: filter.group,
|
|
1108
|
+
label: filter.label,
|
|
1109
|
+
onRemove: () => remove(filter.key),
|
|
1110
|
+
}))}
|
|
993
1111
|
onClearAll={clearAll}
|
|
994
1112
|
/>
|
|
995
1113
|
```
|
|
@@ -1004,7 +1122,11 @@ its props are given: the narrow-screen "filter" button with its badge
|
|
|
1004
1122
|
|
|
1005
1123
|
```tsx
|
|
1006
1124
|
<FilterToolbar
|
|
1007
|
-
count={
|
|
1125
|
+
count={
|
|
1126
|
+
<>
|
|
1127
|
+
<strong>{formatNumber(total)}</strong> ürün
|
|
1128
|
+
</>
|
|
1129
|
+
}
|
|
1008
1130
|
onFilterClick={openFilters}
|
|
1009
1131
|
activeFilterCount={active}
|
|
1010
1132
|
sortOptions={SORT_OPTIONS}
|
|
@@ -1038,7 +1160,13 @@ lays tiles in a wrapping grid (`--ui-sortable-tile`, 120px).
|
|
|
1038
1160
|
<CardMedia src={image.url} alt={image.alt} />
|
|
1039
1161
|
<CardFooter>
|
|
1040
1162
|
{handle}
|
|
1041
|
-
{index === 0 ?
|
|
1163
|
+
{index === 0 ? (
|
|
1164
|
+
<Badge tone="info">Kapak</Badge>
|
|
1165
|
+
) : (
|
|
1166
|
+
<Button variant={UIVariant.GHOST} size={UISize.SMALL} onClick={() => moveTo(0)}>
|
|
1167
|
+
Kapak yap
|
|
1168
|
+
</Button>
|
|
1169
|
+
)}
|
|
1042
1170
|
</CardFooter>
|
|
1043
1171
|
</Card>
|
|
1044
1172
|
)}
|
|
@@ -1052,7 +1180,9 @@ adds a copy button with `labels.copyField`'s texts. Without `isCopyable` it is
|
|
|
1052
1180
|
a server component.
|
|
1053
1181
|
|
|
1054
1182
|
```tsx
|
|
1055
|
-
<p>
|
|
1183
|
+
<p>
|
|
1184
|
+
OEM: <CodeText code="1K0 615 301 AA" isMuted isCopyable />
|
|
1185
|
+
</p>
|
|
1056
1186
|
```
|
|
1057
1187
|
|
|
1058
1188
|
**`BrandLockup`.** A client's mark for an app's header or footer: the logo
|
|
@@ -1061,7 +1191,12 @@ initial, the name, an optional tagline, `size` `sm` / `md` / `lg`. With `href`
|
|
|
1061
1191
|
it is the home link.
|
|
1062
1192
|
|
|
1063
1193
|
```tsx
|
|
1064
|
-
<BrandLockup
|
|
1194
|
+
<BrandLockup
|
|
1195
|
+
name="Yıldız Oto"
|
|
1196
|
+
tagline="Yedek parça"
|
|
1197
|
+
href="/"
|
|
1198
|
+
logo={<img src="/logo.svg" alt="" />}
|
|
1199
|
+
/>
|
|
1065
1200
|
```
|
|
1066
1201
|
|
|
1067
1202
|
**`StickyActionBar`.** Keeps the page's main action in reach: an
|
|
@@ -1074,8 +1209,19 @@ controls it by hand). While shown it writes its height to
|
|
|
1074
1209
|
`--ui-sticky-bar-height`.
|
|
1075
1210
|
|
|
1076
1211
|
```tsx
|
|
1077
|
-
<StickyActionBar
|
|
1078
|
-
|
|
1212
|
+
<StickyActionBar
|
|
1213
|
+
label="Sepete ekle"
|
|
1214
|
+
targetRef={buyBoxRef}
|
|
1215
|
+
info={
|
|
1216
|
+
<>
|
|
1217
|
+
<strong>{name}</strong>
|
|
1218
|
+
<Price value={price} size="sm" />
|
|
1219
|
+
</>
|
|
1220
|
+
}
|
|
1221
|
+
>
|
|
1222
|
+
<Button variant={UIVariant.ACCENT} onClick={addToCart}>
|
|
1223
|
+
Sepete ekle
|
|
1224
|
+
</Button>
|
|
1079
1225
|
</StickyActionBar>
|
|
1080
1226
|
```
|
|
1081
1227
|
|
|
@@ -1085,7 +1231,13 @@ and compare as a link (`compareHref`) or an action (`onCompare`). Below
|
|
|
1085
1231
|
`minItems` (2) the button is disabled and says why. Draws nothing when empty.
|
|
1086
1232
|
|
|
1087
1233
|
```tsx
|
|
1088
|
-
<CompareTray
|
|
1234
|
+
<CompareTray
|
|
1235
|
+
max={4}
|
|
1236
|
+
items={picked}
|
|
1237
|
+
onRemove={unpick}
|
|
1238
|
+
onClear={clear}
|
|
1239
|
+
compareHref={`/karsilastir?urunler=${ids}`}
|
|
1240
|
+
/>
|
|
1089
1241
|
```
|
|
1090
1242
|
|
|
1091
1243
|
**`ProductCarousel`.** A showcase rail ("Çok satanlar") on `Carousel`: a
|
|
@@ -1096,8 +1248,14 @@ card to card. Draws nothing without cards. `Carousel` itself gained the two
|
|
|
1096
1248
|
options it needed: `itemsPerView` and `header`.
|
|
1097
1249
|
|
|
1098
1250
|
```tsx
|
|
1099
|
-
<ProductCarousel
|
|
1100
|
-
|
|
1251
|
+
<ProductCarousel
|
|
1252
|
+
title="Çok satanlar"
|
|
1253
|
+
description="Son 30 gün"
|
|
1254
|
+
seeAllHref="/arama?siralama=cok-satan"
|
|
1255
|
+
>
|
|
1256
|
+
{products.map(product => (
|
|
1257
|
+
<ProductCard key={product.id} product={product} />
|
|
1258
|
+
))}
|
|
1101
1259
|
</ProductCarousel>
|
|
1102
1260
|
```
|
|
1103
1261
|
|
|
@@ -1117,15 +1275,15 @@ section that opens in place.
|
|
|
1117
1275
|
|
|
1118
1276
|
**Smaller additions.**
|
|
1119
1277
|
|
|
1120
|
-
| Component
|
|
1121
|
-
|
|
|
1122
|
-
| `DataTable`
|
|
1123
|
-
| `Gallery`
|
|
1124
|
-
| `Steps`
|
|
1125
|
-
| `Table`
|
|
1126
|
-
| `AppShellNav`
|
|
1127
|
-
| `Carousel`
|
|
1128
|
-
| overlines
|
|
1278
|
+
| Component | 3.4 option |
|
|
1279
|
+
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
1280
|
+
| `DataTable` | `DataTableColumn.align` (`start` / `end` / `center`) and `isNumeric` (end-aligned, tabular figures, no wrap); the header's sort button follows the alignment |
|
|
1281
|
+
| `Gallery` | `placeholder` (drawn in the image's place when there is no image; an empty gallery drew nothing) and `hasCounter` ("2 / 5" on the main image) |
|
|
1282
|
+
| `Steps` | `mobileLayout="row"`: a checkout's steps stay on one line on a phone, only the current label written (the others are still read) |
|
|
1283
|
+
| `Table` | `variant="spec"`: technical specifications — `th scope="row"` keys in the secondary colour, values in mono tabular figures |
|
|
1284
|
+
| `AppShellNav` | `onClick` on an item without `href`: an action row ("Çıkış yap") with the link rows' metrics, for an account sidebar |
|
|
1285
|
+
| `Carousel` | `itemsPerView` and `header` (see `ProductCarousel`) |
|
|
1286
|
+
| overlines | `--ui-overline-font` sets the family of every overline at once |
|
|
1129
1287
|
|
|
1130
1288
|
### Printing (3.3.0)
|
|
1131
1289
|
|
package/build/chat.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),_=require("react"),U=require("react-bootstrap-icons"),h=require("@handijitcom/ui"),Oe=require("@handijitcom/ui/design"),p=(...e)=>{let s="";for(const t of e)t&&(s=s===""?t:`${s} ${t}`);return s},x=(e,s)=>Object.assign(e,{displayName:s}),de=new Set,N=(e,...s)=>{for(const t of s)if(t!==void 0)return t;return process.env.NODE_ENV!=="production"&&!de.has(e)&&(de.add(e),console.error(`[@handijitcom/ui] Eksik metin: ${e}. Prop olarak geçin ya da <UiProvider labels={…}> içinde bir kez tanımlayın. Metinsiz bırakılan öğe ekran okuyucuda adsız kalır.`)),""},Le=(e,s,...t)=>s?s(...t):N(e),Be="ui-thread-R1LCJ",Ue="ui-thread__scroll-37EaI",Fe="ui-thread__column-57FQh",Ze="ui-thread__dock-y0Tt9",qe="ui-thread__latest-ZNmqY",L={thread:Be,thread__scroll:Ue,thread__column:Fe,thread__dock:Ze,thread__latest:qe},Ge=({children:e,dock:s,isStreaming:t,label:
|
|
2
|
-
${xt.repeat(t)}`;for(let o=0;o<e.length;o++){const r=e[o];if(r==='"'){const a=wt(e,o);s+=e.slice(o,a),o=a-1}else if(r==="{"||r==="["){const a=vt(e,o+1);e[a]===(r==="{"?"}":"]")?(s+=r+e[a],o=a):(t++,s+=r+i())}else r==="}"||r==="]"?(t--,s+=i()+r):r===","?s+=`,${i()}`:r===":"?s+=": ":/\s/.test(r)||(s+=r)}return s},Nt=(e,s)=>{const t=e.replace(gt,"").trimEnd();return kt(s)?jt(t):t},b=e=>new Set(e.split(" ")),C=/"(?:[^"\\\n]|\\.)*"?/,F=/'(?:[^'\\\n]|\\.)*'?/,ze=/`(?:[^`\\]|\\[\s\S])*`?/,ie=/"""[\s\S]*?(?:"""|(?![\s\S]))/,St=/'''[\s\S]*?(?:'''|(?![\s\S]))/,Tt=/'(?:\\[^\n]{1,8}?|[^'\\\n])'/,V=/\/\/.*/,Z=/\/\*[\s\S]*?(?:\*\/|(?![\s\S]))/,$=/#.*/,I=/\b(?:0[xX][\dA-Fa-f_]+|0[bB][01_]+|0[oO][0-7_]+|\d[\d_]*(?:\.\d[\d_]*)?(?:[eE][+-]?\d+)?)[A-Za-z]*\b/,O=/[A-Za-z_]\w*/,ee=/[{}[\]();,.:]/,oe=/@[A-Za-z_][\w.]*/,At=/[\w$)\]]/,ue=/\S/,_e="break case catch class const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield async await of static get set as from",Ct="type interface enum implements namespace declare abstract private protected public readonly keyof infer is satisfies override module asserts unique",Et="true false null undefined NaN Infinity",Rt="string number boolean any unknown never object symbol bigint",$t="int long short char float double bool boolean byte void unsigned signed string str usize isize u8 u16 u32 u64 u128 i8 i16 i32 i64 i128 f32 f64 rune uint uint8 uint16 uint32 uint64 int8 int16 int32 int64 float32 float64 error any decimal size_t",Ot="true false null nil nullptr NULL",Ie="auto break case const continue default do else enum extern for goto if inline register restrict return sizeof static struct switch typedef union volatile while",Lt=`${Ie} alignas alignof catch class constexpr consteval const_cast decltype delete dynamic_cast explicit export friend mutable namespace new noexcept operator private protected public reinterpret_cast static_assert static_cast template this thread_local throw try typeid typename using virtual override final concept requires co_await co_return co_yield`,zt="abstract as async await base break case catch checked class const continue default delegate do dynamic else enum event explicit extern finally fixed for foreach get goto if implicit in init interface internal is lock namespace new operator out override params partial private protected public readonly record ref return sealed set sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using var virtual volatile when where while yield",It="abstract assert break case catch class const continue default do else enum extends final finally for goto if implements import instanceof interface native new package permits private protected public record return sealed static strictfp super switch synchronized this throw throws transient try var volatile while yield",Dt="abstract annotation as break by catch class companion const constructor continue crossinline data do else enum external final finally for fun get if import in infix init inline inner interface internal is lateinit noinline object open operator out override package private protected public reified return sealed set super suspend this throw try typealias val var vararg when where while",Mt="actor as associatedtype async await break case catch class continue default defer deinit do else enum extension fallthrough fileprivate final for func guard if import in init inout internal is lazy let mutating open operator override private protocol public repeat rethrows return self Self some static struct subscript super switch throw throws try typealias var weak where while",Pt="break case chan const continue default defer else fallthrough for func go goto if import interface map package range return select struct switch type var",Kt="as async await break const continue crate dyn else enum extern fn for if impl in let loop match mod move mut pub ref return self Self static struct super trait type unsafe use where while",Bt="abstract and array as break callable case catch class clone const continue declare default do echo else elseif empty extends final finally fn for foreach function global goto if implements include include_once instanceof insteadof interface isset list match namespace new or print private protected public readonly require require_once return static switch throw trait try unset use var while xor yield",Ut="if then else elif fi for while until do done case esac in function return local export select time break continue declare readonly unset shift source alias exit",Ft="FROM AS RUN CMD LABEL EXPOSE ENV ADD COPY ENTRYPOINT VOLUME USER WORKDIR ARG ONBUILD STOPSIGNAL HEALTHCHECK SHELL MAINTAINER",te=(e,s)=>({rules:[["comment",V],["comment",Z],["string",C],["string",F],["string",ze],["regex",/\/(?![*/])(?:\\.|\[(?:\\.|[^\]\\\n])*\]|[^/\\\n[])+\/[dgimsuvy]*/],["regex",/\/(?![*/])(?:\\.|\[(?:\\.|[^\]\\\n])*\]?|[^/\\\n[])*/],...s?[["tag",/<\/[A-Za-z][\w.:-]*/],["tag",/<[A-Za-z][\w.:-]*/,At]]:[],["name",oe],["number",I],["word",/[A-Za-z_$][\w$]*/],["punctuation",ee]],keywords:b(e?`${_e} ${Ct}`:_e),literals:b(Et),types:e?b(Rt):void 0,hasCapitalTypes:!0}),T=(e,s=[])=>({rules:[...s,["comment",V],["comment",Z],["keyword",/^[ \t]*#[ \t]*[a-z]+|#!?\[[^\]\n]*\]/],["string",ie],["string",C],["string",Tt],["string",ze],["name",oe],["number",I],["word",O],["punctuation",ee]],keywords:b(e),literals:b(Ot),types:b($t),hasCapitalTypes:!0}),me=()=>({rules:[["comment",$],["string",/(?:\b[rRbBuUfF]{1,2})?(?:"""[\s\S]*?(?:"""|(?![\s\S]))|'''[\s\S]*?(?:'''|(?![\s\S])))/],["string",/(?:\b[rRbBuUfF]{1,2})?(?:"(?:[^"\\\n]|\\.)*"?|'(?:[^'\\\n]|\\.)*'?)/],["name",oe],["number",I],["word",O],["punctuation",ee]],keywords:b("and as assert async await break class continue def del elif else except finally for from global if import in is lambda nonlocal not or pass raise return try while with yield match case"),literals:b("True False None"),types:b("int float str bool list dict set tuple bytes object"),hasCapitalTypes:!0}),pe=()=>({rules:[["comment",$],["string",C],["string",F],["number",/:[A-Za-z_]\w*[?!]?/,/[\w:]/],["name",/@{1,2}[A-Za-z_]\w*/],["number",I],["word",/[A-Za-z_]\w*[?!]?/],["punctuation",ee]],keywords:b("alias and begin break case class def defined? do else elsif end ensure for if in module next not or redo rescue retry return self super then undef unless until when while yield require require_relative attr_accessor attr_reader attr_writer private protected public raise"),literals:b("true false nil"),hasCapitalTypes:!0}),De=e=>({rules:[["comment",$,/[^\s;|&(]/],["string",/"(?:[^"\\]|\\[\s\S])*"?/],["string",/'[^']*'?/],["name",/\$(?:\{[^}\n]*\}?|[A-Za-z_]\w*|[@#?$!*\d-])/],["number",/\b\d+\b/],["word",/[A-Za-z_][\w-]*/],["punctuation",/[{}[\]();|&]/]],keywords:b(e)}),he=()=>({rules:[["comment",V],["comment",Z],["name",/"(?:[^"\\\n]|\\.)*"(?=\s*:)/],["string",C],["number",/-?\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b/],["word",O],["punctuation",/[{}[\],:]/]],literals:b("true false null")}),be=()=>({rules:[["comment",$,ue],["name",/(?:"(?:[^"\\\n]|\\.)*"|'[^'\n]*'|[\w$./][\w$./-]*(?:[ \t]+[\w$./-]+)*)(?=[ \t]*:(?:[ \t]|$))/],["string",C],["string",F],["type",/[&*][\w-]+|!!?[\w-]+/,ue],["punctuation",/^[ \t]*-(?=[ \t]|$)|[{}[\],]|[|>][-+]?(?=[ \t]*$)/],["number",/[-+]?\b\d[\d_]*(?:\.\d+)?(?:[eE][+-]?\d+)?\b/],["word",O]],literals:b("true false null True False Null TRUE FALSE NULL")}),Zt=()=>({rules:[["comment",$],["type",/^[ \t]*\[\[?[^\]\n]*\]\]?/],["name",/(?:"[^"\n]*"|[\w.-]+)(?=[ \t]*=)/],["string",ie],["string",St],["string",C],["string",/'[^'\n]*'?/],["number",/\b\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?)?\b|[-+]?\b\d[\d_]*(?:\.\d+)?(?:[eE][+-]?\d+)?\b/],["word",O],["punctuation",/[{}[\],=]/]],literals:b("true false inf nan")}),se=()=>({rules:[["comment",Z],["comment",V,/:/],["string",C],["string",F],["keyword",/@[\w-]+|!important\b/],["name",/-{0,2}[A-Za-z][\w-]*(?=\s*:[^;{}]*[;}])/],["name",/\$[\w-]+/],["number",/#[\dA-Fa-f]{3,8}\b|-?(?:\b\d+(?:\.\d+)?|\.\d+)(?:%|[A-Za-z]+\b)?/],["word",/-?[A-Za-z_][\w-]*/],["punctuation",/[{}();:,]/]]}),G=()=>({rules:[["comment",/<!--[\s\S]*?(?:-->|(?![\s\S]))/],["keyword",/<![A-Za-z][^>]*>?|<\?[\s\S]*?(?:\?>|(?![\s\S]))/],["markup",/<\/?[A-Za-z][\w:.-]*(?:"[^"]*"?|'[^']*'?|[^'">])*>?/],["number",/&#?\w+;/]]}),fe=()=>({rules:[["string",/^[ \t]*```[\s\S]*?(?:^[ \t]*```|(?![\s\S]))|^[ \t]*~~~[\s\S]*?(?:^[ \t]*~~~|(?![\s\S]))/],["keyword",/^#{1,6}[ \t].*/],["punctuation",/^[ \t]*(?:[-*+]|\d+[.)])(?=[ \t])|^[ \t]*>/],["string",/`[^`\n]+`/],["name",/!?\[[^\]\n]*\]\([^)\n]*\)/]]}),qt=()=>({rules:[["comment",/--.*/],["comment",Z],["string",/'(?:[^']|'')*'?/],["name",/"[^"\n]*"?|`[^`\n]*`?/],["number",I],["word",O],["punctuation",/[(),;.]/]],keywords:b("select from where and or not insert values into update set delete create table alter drop index view join inner left right full outer cross on as group by order having limit offset union all distinct case when then else end is in exists between like ilike primary key foreign references default unique constraint returning with asc desc begin commit rollback transaction if replace check cascade grant revoke add column database schema trigger procedure function declare"),literals:b("null true false"),types:b("int integer bigint smallint serial bigserial text varchar char boolean bool date time timestamp timestamptz interval numeric decimal real float double json jsonb uuid bytea"),isCaseInsensitive:!0}),ye=()=>({rules:[["keyword",/^(?:diff|index|\+\+\+|---)(?: .*|$)/],["name",/^@@.*/],["inserted",/^\+.*/],["deleted",/^-.*/]]}),ge=()=>({rules:[["comment",$],["string",ie],["string",C],["name",/\$\w+/],["name",/@\w+/],["number",I],["word",O],["punctuation",/[{}[\]():,!=|]/]],keywords:b("query mutation subscription fragment on type input enum interface union scalar schema extend directive implements"),literals:b("true false null"),types:b("ID"),hasCapitalTypes:!0}),Gt=()=>({rules:[["tag",/<\/?[A-Za-z][\w:.-]*/],["string",/"[^"]*"?|'[^']*'?/],["name",/[^\s"'<>/=]+/],["punctuation",/\/?>|=/]]}),H=()=>te(!1,!1),Ht=()=>te(!1,!0),Y=()=>te(!0,!1),Yt=()=>te(!0,!0),M=()=>De(Ut),xe=()=>De(Ft),ke=()=>T(Ie),ne=()=>T(Lt),we=()=>T(zt),ve=()=>T(Dt),je=()=>T(Pt),Ne=()=>T(Kt),Wt=()=>T(Bt,[["comment",$],["name",/\$[A-Za-z_]\w*/],["string",F]]),Se={javascript:H,js:H,mjs:H,cjs:H,jsx:Ht,typescript:Y,ts:Y,mts:Y,cts:Y,tsx:Yt,json:he,jsonc:he,bash:M,sh:M,shell:M,zsh:M,console:M,dockerfile:xe,docker:xe,python:me,py:me,ruby:pe,rb:pe,yaml:be,yml:be,toml:Zt,css:se,scss:se,less:se,html:G,xml:G,svg:G,vue:G,markdown:fe,md:fe,sql:qt,diff:ye,patch:ye,graphql:ge,gql:ge,c:ke,h:ke,cpp:ne,"c++":ne,hpp:ne,csharp:we,cs:we,java:()=>T(It),kotlin:ve,kt:ve,swift:()=>T(Mt),go:je,golang:je,rust:Ne,rs:Ne,php:Wt},Xt=2e4,Te=/!?[ \t]*\(/y,Jt=/^[A-Z][A-Z\d_]+$/,Qt=/[(,=:[!&|?{};~+\-*%<>^]/,Vt=new Set(["return","typeof","case","do","else","in","of","new","delete","void","throw","yield","await"]),Ae=new Map,Me=e=>{const s=Ae.get(e);if(s)return s;const t=e(),o={pattern:new RegExp(t.rules.map(([,r])=>`(${r.source})`).join("|"),"gm"),grammar:t};return Ae.set(e,o),o},es=e=>{const s=e==null?void 0:e.trim().toLowerCase();return s&&Object.hasOwn(Se,s)?Se[s]:void 0},ts=(e,s)=>{let t=s-1;for(;t>=0&&/\s/.test(e[t]);)t--;if(t<0||Qt.test(e[t]))return!0;const i=t+1;for(;t>=0&&/[\w$]/.test(e[t]);)t--;return Vt.has(e.slice(t+1,i))},ss=(e,s,t,i,o)=>{var l,c,u;Te.lastIndex=o;const r=Te.test(t);if(t[i-1]===".")return r?"name":void 0;const a=e.isCaseInsensitive?s.toLowerCase():s;if((l=e.keywords)!=null&&l.has(a))return"keyword";if((c=e.literals)!=null&&c.has(a))return"number";if((u=e.types)!=null&&u.has(a))return"type";if(r)return"name";if(e.hasCapitalTypes&&/^[A-Z]/.test(s))return Jt.test(s)?"number":"type"},Pe=({pattern:e,grammar:s},t)=>{const i=[],o=(a,l)=>{if(!a)return;const c=i.at(-1);c&&c.type===l?c.text+=a:i.push({text:a,type:l})};let r=0;e.lastIndex=0;for(let a=e.exec(t);a;a=e.exec(t)){const[l]=a,{index:c}=a,u=c+l.length;if(u===c){e.lastIndex=c+1;continue}const[d,,m]=s.rules[a.indexOf(l,1)-1];if(m!==void 0&&c>0&&m.test(t[c-1])||d==="regex"&&!ts(t,c)){e.lastIndex=c+1;continue}if(o(t.slice(r,c)),r=u,d==="word")o(l,ss(s,l,t,c,u));else if(d==="regex")o(l,"string");else if(d==="tag"){const f=l[1]==="/"?2:1,g=l.slice(f);o(l.slice(0,f),"punctuation"),o(g,/^[A-Z]/.test(g)||g.includes(".")?"type":"keyword")}else if(d==="markup")for(const f of Pe(Me(Gt),l))o(f.text,f.type);else o(l,d)}return o(t.slice(r)),i},ns=(e,s)=>{const t=es(s);return t&&e.length<=Xt?Pe(Me(t),e):[{text:e}]},as="ui-block-M1yL9",is="ui-block__header-F2iBP",os="ui-block__language-lmdS9",rs="ui-block__body-wDCJ2",cs="ui-block__pre--EERi",ls="ui-block__highlighted-JK1Yj",R={block:as,block__header:is,block__language:os,block__body:rs,block__pre:cs,block__highlighted:ls,"block__token--comment":"ui-block__token--comment-eFTyh","block__token--keyword":"ui-block__token--keyword-qQpj9","block__token--string":"ui-block__token--string-4onwX","block__token--number":"ui-block__token--number-DThtL","block__token--name":"ui-block__token--name-283C9","block__token--type":"ui-block__token--type-cNUbM","block__token--punctuation":"ui-block__token--punctuation-Te2u8","block__token--inserted":"ui-block__token--inserted-sUKnQ","block__token--deleted":"ui-block__token--deleted-s74a-"},ds=1600,us=({code:e,language:s,html:t,maxHeight:i,className:o,testId:r})=>{var w;const{labels:a}=h.useUi(),l=h.useAnnounce(),[c,u]=_.useState(!1),d=_.useRef(void 0),m=_.useMemo(()=>t?e:Nt(e,s),[e,t,s]),y=_.useMemo(()=>t?[]:ns(m,s),[m,t,s]);_.useEffect(()=>()=>window.clearTimeout(d.current),[]);const f=async()=>{var k;try{await navigator.clipboard.writeText(m)}catch{return}u(!0),l(N("CodeBlock.copied",(k=a==null?void 0:a.chat)==null?void 0:k.codeCopied)),window.clearTimeout(d.current),d.current=window.setTimeout(()=>u(!1),ds)},g=s??"";return n.jsxs("figure",{className:p(R.block,o),"data-testid":r,children:[n.jsxs("figcaption",{className:R.block__header,children:[n.jsx("span",{className:R.block__language,children:g}),n.jsx(h.IconButton,{icon:c?n.jsx(U.CheckLg,{"aria-hidden":!0}):n.jsx(U.ClipboardFill,{"aria-hidden":!0}),label:Le("CodeBlock.copy",(w=a==null?void 0:a.chat)==null?void 0:w.codeCopy,g),size:"sm",onClick:f})]}),n.jsx("div",{className:R.block__body,style:i===void 0?void 0:{maxBlockSize:i},tabIndex:0,role:g?"region":void 0,"aria-label":g||void 0,children:t?n.jsx("div",{className:R.block__highlighted,dangerouslySetInnerHTML:{__html:t}}):n.jsx("pre",{className:R.block__pre,children:n.jsx("code",{children:y.map((k,D)=>k.type?n.jsx("span",{className:R[`block__token--${k.type}`],children:k.text},D):n.jsx(_.Fragment,{children:k.text},D))})})})]})},_s=_.memo(x(us,"CodeBlock")),ms="ui-block-zqPjp",ps="ui-block__summary-Kkp-X",hs="ui-block__indicator-GuJMa",bs="ui-block__body-mDvrV",W={block:ms,block__summary:ps,block__indicator:hs,block__body:bs},fs=({summary:e,isRunning:s=!1,indicator:t,isDefaultOpen:i=!1,children:o,className:r,testId:a})=>{const[l,c]=_.useState(s||i),u=_.useRef(!1);return _.useEffect(()=>{u.current||c(s||i)},[s,i]),n.jsx(h.Disclosure,{variant:"plain",className:p(W.block,r),summary:n.jsxs("span",{className:W.block__summary,children:[s&&n.jsx("span",{className:W.block__indicator,children:t??n.jsx(h.Spinner,{size:"sm"})}),e]}),isOpen:l,onOpenChange:d=>{u.current=!0,c(d)},testId:a,children:n.jsx("div",{className:W.block__body,children:o})})},ys=_.memo(x(fs,"ReasoningBlock")),gs="ui-text-WKVxU",xs="ui-text__body--uP0k",Ce={text:gs,text__body:xs},ks=({text:e,label:s,maxHeight:t=180,className:i,testId:o})=>n.jsx(h.ScrollArea,{className:p(Ce.text,i),label:s,maxHeight:t,hasFade:!0,isFollowingEnd:!0,testId:o,children:n.jsx("p",{className:Ce.text__body,children:e})}),ws=_.memo(x(ks,"ReasoningText")),vs="ui-call-tV2P8",js="ui-call__header-8Tw7m",Ns="ui-call__icon-TLzwf",Ss="ui-call__name-EHz6G",Ts="ui-call__summary-M4sLU",As="ui-call__meta-bvpp7",Cs="ui-call__body-nFK-C",Es="ui-section-TjSGF",Rs="ui-section__label-UrgqM",$s="ui-section__body-Dy1PX",v={call:vs,"call--static":"ui-call--static-Nldru",call__header:js,call__icon:Ns,"call__icon--running":"ui-call__icon--running-Mx1XK",call__name:Ss,call__summary:Ts,call__meta:As,call__body:Cs,section:Es,section__label:Rs,section__body:$s},Os={running:"neutral",ok:"info",error:"danger",aborted:"ink",interrupted:"danger"},Ls=({icon:e,name:s,summary:t,status:i,meta:o,isDefaultOpen:r,isOpen:a,onOpenChange:l,children:c,className:u,testId:d})=>{var g,w;const{labels:m}=h.useUi(),y=N(`ToolCall.status.${i}`,(w=(g=m==null?void 0:m.chat)==null?void 0:g.toolStatus)==null?void 0:w[i]),f=n.jsxs("span",{className:v.call__header,children:[e!==void 0&&n.jsx("span",{className:p(v.call__icon,i==="running"&&v["call__icon--running"]),"aria-hidden":!0,children:e}),n.jsx("span",{className:v.call__name,children:s}),t!==void 0&&n.jsx("span",{className:v.call__summary,children:t}),n.jsx(h.StatusDot,{tone:Os[i],label:y,isPulsing:i==="running"})]});return c===void 0?n.jsxs("div",{className:p(v.call,v["call--static"],u),"data-testid":d,children:[f,o!==void 0&&n.jsx("span",{className:v.call__meta,children:o})]}):n.jsx(h.Disclosure,{className:p(v.call,u),summary:f,meta:o,isDefaultOpen:r,isOpen:a,onOpenChange:l,testId:d,children:n.jsx("div",{className:v.call__body,children:c})})},zs=({label:e,children:s,className:t})=>n.jsxs("div",{className:p(v.section,t),children:[n.jsx("span",{className:v.section__label,children:e}),n.jsx("div",{className:v.section__body,children:s})]}),Is=_.memo(x(Ls,"ToolCall")),Ds="ui-terminal-D4Bz8",Ms="ui-terminal__command-A7PG2",Ps="ui-terminal__prompt-9N1g2",Ks="ui-terminal__stderr-qCNFe",Bs="ui-terminal__srOnly-2pmQA",P={terminal:Ds,terminal__command:Ms,terminal__prompt:Ps,terminal__stderr:Ks,terminal__srOnly:Bs},Us=({command:e,chunks:s,label:t,maxHeight:i=300,className:o,testId:r})=>{var u;const{labels:a}=h.useUi(),l=_.useRef(null);h.useStickToBottom(l);const c=N("TerminalOutput.stderr",(u=a==null?void 0:a.chat)==null?void 0:u.stderr);return n.jsxs("pre",{ref:l,className:p(P.terminal,o),style:{maxBlockSize:i},tabIndex:0,role:"region","aria-label":t,"data-testid":r,children:[e!==void 0&&n.jsxs("span",{className:P.terminal__command,children:[n.jsxs("span",{className:P.terminal__prompt,"aria-hidden":!0,children:["$"," "]}),e,`
|
|
3
|
-
`]}),s.map((d,m)=>d.stream==="stderr"?n.jsxs("span",{className:
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),_=require("react"),U=require("react-bootstrap-icons"),h=require("@handijitcom/ui"),Oe=require("@handijitcom/ui/design"),p=(...e)=>{let s="";for(const t of e)t&&(s=s===""?t:`${s} ${t}`);return s},x=(e,s)=>Object.assign(e,{displayName:s}),de=new Set,N=(e,...s)=>{for(const t of s)if(t!==void 0)return t;return process.env.NODE_ENV!=="production"&&!de.has(e)&&(de.add(e),console.error(`[@handijitcom/ui] Eksik metin: ${e}. Prop olarak geçin ya da <UiProvider labels={…}> içinde bir kez tanımlayın. Metinsiz bırakılan öğe ekran okuyucuda adsız kalır.`)),""},Le=(e,s,...t)=>s?s(...t):N(e),Be="ui-thread-R1LCJ",Ue="ui-thread__scroll-37EaI",Fe="ui-thread__column-57FQh",Ze="ui-thread__dock-y0Tt9",qe="ui-thread__latest-ZNmqY",L={thread:Be,thread__scroll:Ue,thread__column:Fe,thread__dock:Ze,thread__latest:qe},Ge=({children:e,dock:s,isStreaming:t,label:r,className:i,testId:o})=>{var y,f,g;const{labels:a}=h.useUi(),l=h.useAnnounce(),c=_.useRef(null),{isAtEnd:u,scrollToEnd:d}=h.useStickToBottom(c),m=_.useRef(t);return _.useEffect(()=>{var w;m.current&&!t&&l(N("ChatThread.replyReady",(w=a==null?void 0:a.chat)==null?void 0:w.replyReady)),m.current=t},[l,t,(y=a==null?void 0:a.chat)==null?void 0:y.replyReady]),n.jsxs("div",{className:p(L.thread,i),"data-testid":o,children:[n.jsx("div",{ref:c,className:L.thread__scroll,role:"region","aria-label":N("ChatThread.label",r,(f=a==null?void 0:a.chat)==null?void 0:f.thread),tabIndex:0,children:n.jsx("div",{className:L.thread__column,children:e})}),n.jsxs("div",{className:L.thread__dock,children:[!u&&n.jsx(h.IconButton,{className:L.thread__latest,icon:n.jsx(U.ArrowDown,{"aria-hidden":!0}),label:N("ChatThread.scrollToLatest",(g=a==null?void 0:a.chat)==null?void 0:g.scrollToLatest),variant:"secondary",shape:"round",size:"sm",onClick:d}),s!==void 0&&n.jsx("div",{className:L.thread__column,children:s})]})]})},He=_.memo(x(Ge,"ChatThread")),Ye="ui-message-z5uVx",We="ui-message__avatar-QzWck",Xe="ui-message__main-1rh-A",Je="ui-message__body-Ngiqq",Qe="ui-message__actions-dQ0Fn",z={message:Ye,"message--user":"ui-message--user-Mq6gb",message__avatar:We,message__main:Xe,"message--assistant":"ui-message--assistant-ndkmH",message__body:Je,message__actions:Qe},Ve=({author:e,children:s,avatar:t,actions:r,isStreaming:i,className:o,testId:a})=>n.jsxs("article",{className:p(z.message,z[`message--${e}`],o),"aria-busy":i||void 0,"data-testid":a,children:[e==="assistant"&&t!==void 0&&n.jsx("div",{className:z.message__avatar,children:t}),n.jsxs("div",{className:z.message__main,children:[n.jsx("div",{className:z.message__body,children:s}),r!==void 0&&n.jsx("div",{className:z.message__actions,children:r})]})]}),et=_.memo(x(Ve,"ChatMessage")),tt="ui-prompt-qHV1e",st="ui-prompt__box-sUQDu",nt="ui-prompt__field-EmvTZ",at="ui-prompt__start-2tqre",it="ui-prompt__end-Zp7fi",ot="ui-prompt__hint-4TpeC",E={prompt:tt,prompt__box:st,"prompt__box--disabled":"ui-prompt__box--disabled-xu-Yk",prompt__field:nt,prompt__start:at,prompt__end:it,prompt__hint:ot},rt=_.forwardRef(({value:e,onChange:s,onSubmit:t,onStop:r,isBusy:i,isDisabled:o,isSubmitDisabled:a,placeholder:l,label:c,maxRows:u=8,hint:d,start:m,end:y,className:f,testId:g},w)=>{var re,ce;const{labels:k}=h.useUi(),M=e.trim()==="";_.useEffect(()=>{if(!i||!r)return;const S=le=>{le.key!=="Escape"||le.defaultPrevented||h.hasOpenSurface({includeTransient:!0})||r()};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[i,r]);const Ke=S=>{S.key!=="Enter"||S.shiftKey||S.nativeEvent.isComposing||(S.preventDefault(),!M&&!i&&!o&&!a&&t())};return n.jsxs("div",{className:p(E.prompt,f),"data-testid":g,children:[n.jsxs("div",{className:p(E.prompt__box,o&&E["prompt__box--disabled"]),children:[m!==void 0&&n.jsx("div",{className:E.prompt__start,children:m}),n.jsx(h.Textarea,{ref:w,className:E.prompt__field,variant:"bare",rows:1,isAutoSize:!0,maxRows:u,value:e,placeholder:l,"aria-label":c??l,disabled:o,onChange:S=>s(S.target.value),onKeyDown:Ke}),y!==void 0&&n.jsx("div",{className:E.prompt__end,children:y}),i?n.jsx(h.IconButton,{icon:n.jsx(U.StopFill,{"aria-hidden":!0}),label:N("PromptInput.stop",(re=k==null?void 0:k.chat)==null?void 0:re.stop),variant:"secondary",shape:"round",onClick:r,disabled:!r}):n.jsx(h.IconButton,{icon:n.jsx(U.ArrowUp,{"aria-hidden":!0}),label:N("PromptInput.send",(ce=k==null?void 0:k.chat)==null?void 0:ce.send),variant:"solid",shape:"round",onClick:t,disabled:M||o||a})]}),d!==void 0&&n.jsx("div",{className:E.prompt__hint,children:d})]})}),ct=_.memo(x(rt,"PromptInput")),lt="ui-grid-4EfQ-",dt="ui-card-KTt0-",ut="ui-card__label-LNLTF",_t="ui-card__description-eIx-0",q={grid:lt,card:dt,card__label:ut,card__description:_t},mt=({label:e,items:s,onPick:t,className:r,testId:i})=>n.jsx("div",{role:"group","aria-label":e,className:p(q.grid,r),"data-testid":i,children:s.map(o=>n.jsxs("button",{type:"button",className:q.card,onClick:()=>t(o),children:[n.jsx("span",{className:q.card__label,children:o.label}),o.description&&n.jsx("span",{className:q.card__description,children:o.description})]},o.id))}),pt=_.memo(x(mt,"PromptSuggestions")),ht="ui-prose-kAp6f",bt={prose:ht},ft=({className:e,testId:s,...t})=>n.jsx("div",{className:p(bt.prose,e),"data-testid":s,...t}),yt=_.memo(x(ft,"Prose")),gt=/^(?:[ \t]*\r?\n)+/,xt=" ",kt=e=>(e==null?void 0:e.trim().toLowerCase())==="json",wt=(e,s)=>{let t=s+1;for(;t<e.length&&e[t]!=='"';)t+=e[t]==="\\"?2:1;return t+1},vt=(e,s)=>{let t=s;for(;t<e.length&&/\s/.test(e[t]);)t++;return t},jt=e=>{try{JSON.parse(e)}catch{return e}let s="",t=0;const r=()=>`
|
|
2
|
+
${xt.repeat(t)}`;for(let i=0;i<e.length;i++){const o=e[i];if(o==='"'){const a=wt(e,i);s+=e.slice(i,a),i=a-1}else if(o==="{"||o==="["){const a=vt(e,i+1);e[a]===(o==="{"?"}":"]")?(s+=o+e[a],i=a):(t++,s+=o+r())}else o==="}"||o==="]"?(t--,s+=r()+o):o===","?s+=`,${r()}`:o===":"?s+=": ":/\s/.test(o)||(s+=o)}return s},Nt=(e,s)=>{const t=e.replace(gt,"").trimEnd();return kt(s)?jt(t):t},b=e=>new Set(e.split(" ")),C=/"(?:[^"\\\n]|\\.)*"?/,F=/'(?:[^'\\\n]|\\.)*'?/,ze=/`(?:[^`\\]|\\[\s\S])*`?/,ie=/"""[\s\S]*?(?:"""|(?![\s\S]))/,St=/'''[\s\S]*?(?:'''|(?![\s\S]))/,Tt=/'(?:\\[^\n]{1,8}?|[^'\\\n])'/,V=/\/\/.*/,Z=/\/\*[\s\S]*?(?:\*\/|(?![\s\S]))/,$=/#.*/,D=/\b(?:0[xX][\dA-Fa-f_]+|0[bB][01_]+|0[oO][0-7_]+|\d[\d_]*(?:\.\d[\d_]*)?(?:[eE][+-]?\d+)?)[A-Za-z]*\b/,O=/[A-Za-z_]\w*/,ee=/[{}[\]();,.:]/,oe=/@[A-Za-z_][\w.]*/,At=/[\w$)\]]/,ue=/\S/,_e="break case catch class const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield async await of static get set as from",Ct="type interface enum implements namespace declare abstract private protected public readonly keyof infer is satisfies override module asserts unique",Et="true false null undefined NaN Infinity",Rt="string number boolean any unknown never object symbol bigint",$t="int long short char float double bool boolean byte void unsigned signed string str usize isize u8 u16 u32 u64 u128 i8 i16 i32 i64 i128 f32 f64 rune uint uint8 uint16 uint32 uint64 int8 int16 int32 int64 float32 float64 error any decimal size_t",Ot="true false null nil nullptr NULL",Ie="auto break case const continue default do else enum extern for goto if inline register restrict return sizeof static struct switch typedef union volatile while",Lt=`${Ie} alignas alignof catch class constexpr consteval const_cast decltype delete dynamic_cast explicit export friend mutable namespace new noexcept operator private protected public reinterpret_cast static_assert static_cast template this thread_local throw try typeid typename using virtual override final concept requires co_await co_return co_yield`,zt="abstract as async await base break case catch checked class const continue default delegate do dynamic else enum event explicit extern finally fixed for foreach get goto if implicit in init interface internal is lock namespace new operator out override params partial private protected public readonly record ref return sealed set sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using var virtual volatile when where while yield",It="abstract assert break case catch class const continue default do else enum extends final finally for goto if implements import instanceof interface native new package permits private protected public record return sealed static strictfp super switch synchronized this throw throws transient try var volatile while yield",Dt="abstract annotation as break by catch class companion const constructor continue crossinline data do else enum external final finally for fun get if import in infix init inline inner interface internal is lateinit noinline object open operator out override package private protected public reified return sealed set super suspend this throw try typealias val var vararg when where while",Mt="actor as associatedtype async await break case catch class continue default defer deinit do else enum extension fallthrough fileprivate final for func guard if import in init inout internal is lazy let mutating open operator override private protocol public repeat rethrows return self Self some static struct subscript super switch throw throws try typealias var weak where while",Pt="break case chan const continue default defer else fallthrough for func go goto if import interface map package range return select struct switch type var",Kt="as async await break const continue crate dyn else enum extern fn for if impl in let loop match mod move mut pub ref return self Self static struct super trait type unsafe use where while",Bt="abstract and array as break callable case catch class clone const continue declare default do echo else elseif empty extends final finally fn for foreach function global goto if implements include include_once instanceof insteadof interface isset list match namespace new or print private protected public readonly require require_once return static switch throw trait try unset use var while xor yield",Ut="if then else elif fi for while until do done case esac in function return local export select time break continue declare readonly unset shift source alias exit",Ft="FROM AS RUN CMD LABEL EXPOSE ENV ADD COPY ENTRYPOINT VOLUME USER WORKDIR ARG ONBUILD STOPSIGNAL HEALTHCHECK SHELL MAINTAINER",te=(e,s)=>({rules:[["comment",V],["comment",Z],["string",C],["string",F],["string",ze],["regex",/\/(?![*/])(?:\\.|\[(?:\\.|[^\]\\\n])*\]|[^/\\\n[])+\/[dgimsuvy]*/],["regex",/\/(?![*/])(?:\\.|\[(?:\\.|[^\]\\\n])*\]?|[^/\\\n[])*/],...s?[["tag",/<\/[A-Za-z][\w.:-]*/],["tag",/<[A-Za-z][\w.:-]*/,At]]:[],["name",oe],["number",D],["word",/[A-Za-z_$][\w$]*/],["punctuation",ee]],keywords:b(e?`${_e} ${Ct}`:_e),literals:b(Et),types:e?b(Rt):void 0,hasCapitalTypes:!0}),T=(e,s=[])=>({rules:[...s,["comment",V],["comment",Z],["keyword",/^[ \t]*#[ \t]*[a-z]+|#!?\[[^\]\n]*\]/],["string",ie],["string",C],["string",Tt],["string",ze],["name",oe],["number",D],["word",O],["punctuation",ee]],keywords:b(e),literals:b(Ot),types:b($t),hasCapitalTypes:!0}),me=()=>({rules:[["comment",$],["string",/(?:\b[rRbBuUfF]{1,2})?(?:"""[\s\S]*?(?:"""|(?![\s\S]))|'''[\s\S]*?(?:'''|(?![\s\S])))/],["string",/(?:\b[rRbBuUfF]{1,2})?(?:"(?:[^"\\\n]|\\.)*"?|'(?:[^'\\\n]|\\.)*'?)/],["name",oe],["number",D],["word",O],["punctuation",ee]],keywords:b("and as assert async await break class continue def del elif else except finally for from global if import in is lambda nonlocal not or pass raise return try while with yield match case"),literals:b("True False None"),types:b("int float str bool list dict set tuple bytes object"),hasCapitalTypes:!0}),pe=()=>({rules:[["comment",$],["string",C],["string",F],["number",/:[A-Za-z_]\w*[?!]?/,/[\w:]/],["name",/@{1,2}[A-Za-z_]\w*/],["number",D],["word",/[A-Za-z_]\w*[?!]?/],["punctuation",ee]],keywords:b("alias and begin break case class def defined? do else elsif end ensure for if in module next not or redo rescue retry return self super then undef unless until when while yield require require_relative attr_accessor attr_reader attr_writer private protected public raise"),literals:b("true false nil"),hasCapitalTypes:!0}),De=e=>({rules:[["comment",$,/[^\s;|&(]/],["string",/"(?:[^"\\]|\\[\s\S])*"?/],["string",/'[^']*'?/],["name",/\$(?:\{[^}\n]*\}?|[A-Za-z_]\w*|[@#?$!*\d-])/],["number",/\b\d+\b/],["word",/[A-Za-z_][\w-]*/],["punctuation",/[{}[\]();|&]/]],keywords:b(e)}),he=()=>({rules:[["comment",V],["comment",Z],["name",/"(?:[^"\\\n]|\\.)*"(?=\s*:)/],["string",C],["number",/-?\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b/],["word",O],["punctuation",/[{}[\],:]/]],literals:b("true false null")}),be=()=>({rules:[["comment",$,ue],["name",/(?:"(?:[^"\\\n]|\\.)*"|'[^'\n]*'|[\w$./][\w$./-]*(?:[ \t]+[\w$./-]+)*)(?=[ \t]*:(?:[ \t]|$))/],["string",C],["string",F],["type",/[&*][\w-]+|!!?[\w-]+/,ue],["punctuation",/^[ \t]*-(?=[ \t]|$)|[{}[\],]|[|>][-+]?(?=[ \t]*$)/],["number",/[-+]?\b\d[\d_]*(?:\.\d+)?(?:[eE][+-]?\d+)?\b/],["word",O]],literals:b("true false null True False Null TRUE FALSE NULL")}),Zt=()=>({rules:[["comment",$],["type",/^[ \t]*\[\[?[^\]\n]*\]\]?/],["name",/(?:"[^"\n]*"|[\w.-]+)(?=[ \t]*=)/],["string",ie],["string",St],["string",C],["string",/'[^'\n]*'?/],["number",/\b\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?)?\b|[-+]?\b\d[\d_]*(?:\.\d+)?(?:[eE][+-]?\d+)?\b/],["word",O],["punctuation",/[{}[\],=]/]],literals:b("true false inf nan")}),se=()=>({rules:[["comment",Z],["comment",V,/:/],["string",C],["string",F],["keyword",/@[\w-]+|!important\b/],["name",/-{0,2}[A-Za-z][\w-]*(?=\s*:[^;{}]*[;}])/],["name",/\$[\w-]+/],["number",/#[\dA-Fa-f]{3,8}\b|-?(?:\b\d+(?:\.\d+)?|\.\d+)(?:%|[A-Za-z]+\b)?/],["word",/-?[A-Za-z_][\w-]*/],["punctuation",/[{}();:,]/]]}),G=()=>({rules:[["comment",/<!--[\s\S]*?(?:-->|(?![\s\S]))/],["keyword",/<![A-Za-z][^>]*>?|<\?[\s\S]*?(?:\?>|(?![\s\S]))/],["markup",/<\/?[A-Za-z][\w:.-]*(?:"[^"]*"?|'[^']*'?|[^'">])*>?/],["number",/&#?\w+;/]]}),fe=()=>({rules:[["string",/^[ \t]*```[\s\S]*?(?:^[ \t]*```|(?![\s\S]))|^[ \t]*~~~[\s\S]*?(?:^[ \t]*~~~|(?![\s\S]))/],["keyword",/^#{1,6}[ \t].*/],["punctuation",/^[ \t]*(?:[-*+]|\d+[.)])(?=[ \t])|^[ \t]*>/],["string",/`[^`\n]+`/],["name",/!?\[[^\]\n]*\]\([^)\n]*\)/]]}),qt=()=>({rules:[["comment",/--.*/],["comment",Z],["string",/'(?:[^']|'')*'?/],["name",/"[^"\n]*"?|`[^`\n]*`?/],["number",D],["word",O],["punctuation",/[(),;.]/]],keywords:b("select from where and or not insert values into update set delete create table alter drop index view join inner left right full outer cross on as group by order having limit offset union all distinct case when then else end is in exists between like ilike primary key foreign references default unique constraint returning with asc desc begin commit rollback transaction if replace check cascade grant revoke add column database schema trigger procedure function declare"),literals:b("null true false"),types:b("int integer bigint smallint serial bigserial text varchar char boolean bool date time timestamp timestamptz interval numeric decimal real float double json jsonb uuid bytea"),isCaseInsensitive:!0}),ye=()=>({rules:[["keyword",/^(?:diff|index|\+\+\+|---)(?: .*|$)/],["name",/^@@.*/],["inserted",/^\+.*/],["deleted",/^-.*/]]}),ge=()=>({rules:[["comment",$],["string",ie],["string",C],["name",/\$\w+/],["name",/@\w+/],["number",D],["word",O],["punctuation",/[{}[\]():,!=|]/]],keywords:b("query mutation subscription fragment on type input enum interface union scalar schema extend directive implements"),literals:b("true false null"),types:b("ID"),hasCapitalTypes:!0}),Gt=()=>({rules:[["tag",/<\/?[A-Za-z][\w:.-]*/],["string",/"[^"]*"?|'[^']*'?/],["name",/[^\s"'<>/=]+/],["punctuation",/\/?>|=/]]}),H=()=>te(!1,!1),Ht=()=>te(!1,!0),Y=()=>te(!0,!1),Yt=()=>te(!0,!0),P=()=>De(Ut),xe=()=>De(Ft),ke=()=>T(Ie),ne=()=>T(Lt),we=()=>T(zt),ve=()=>T(Dt),je=()=>T(Pt),Ne=()=>T(Kt),Wt=()=>T(Bt,[["comment",$],["name",/\$[A-Za-z_]\w*/],["string",F]]),Se={javascript:H,js:H,mjs:H,cjs:H,jsx:Ht,typescript:Y,ts:Y,mts:Y,cts:Y,tsx:Yt,json:he,jsonc:he,bash:P,sh:P,shell:P,zsh:P,console:P,dockerfile:xe,docker:xe,python:me,py:me,ruby:pe,rb:pe,yaml:be,yml:be,toml:Zt,css:se,scss:se,less:se,html:G,xml:G,svg:G,vue:G,markdown:fe,md:fe,sql:qt,diff:ye,patch:ye,graphql:ge,gql:ge,c:ke,h:ke,cpp:ne,"c++":ne,hpp:ne,csharp:we,cs:we,java:()=>T(It),kotlin:ve,kt:ve,swift:()=>T(Mt),go:je,golang:je,rust:Ne,rs:Ne,php:Wt},Xt=2e4,Te=/!?[ \t]*\(/y,Jt=/^[A-Z][A-Z\d_]+$/,Qt=/[(,=:[!&|?{};~+\-*%<>^]/,Vt=new Set(["return","typeof","case","do","else","in","of","new","delete","void","throw","yield","await"]),Ae=new Map,Me=e=>{const s=Ae.get(e);if(s)return s;const t=e(),i={pattern:new RegExp(t.rules.map(([,o])=>`(${o.source})`).join("|"),"gm"),grammar:t};return Ae.set(e,i),i},es=e=>{const s=e==null?void 0:e.trim().toLowerCase();return s&&Object.hasOwn(Se,s)?Se[s]:void 0},ts=(e,s)=>{let t=s-1;for(;t>=0&&/\s/.test(e[t]);)t--;if(t<0||Qt.test(e[t]))return!0;const r=t+1;for(;t>=0&&/[\w$]/.test(e[t]);)t--;return Vt.has(e.slice(t+1,r))},ss=(e,s,t,r,i)=>{var l,c,u;Te.lastIndex=i;const o=Te.test(t);if(t[r-1]===".")return o?"name":void 0;const a=e.isCaseInsensitive?s.toLowerCase():s;if((l=e.keywords)!=null&&l.has(a))return"keyword";if((c=e.literals)!=null&&c.has(a))return"number";if((u=e.types)!=null&&u.has(a))return"type";if(o)return"name";if(e.hasCapitalTypes&&/^[A-Z]/.test(s))return Jt.test(s)?"number":"type"},Pe=({pattern:e,grammar:s},t)=>{const r=[],i=(a,l)=>{if(!a)return;const c=r.at(-1);c&&c.type===l?c.text+=a:r.push({text:a,type:l})};let o=0;e.lastIndex=0;for(let a=e.exec(t);a;a=e.exec(t)){const[l]=a,{index:c}=a,u=c+l.length;if(u===c){e.lastIndex=c+1;continue}const[d,,m]=s.rules[a.indexOf(l,1)-1];if(m!==void 0&&c>0&&m.test(t[c-1])||d==="regex"&&!ts(t,c)){e.lastIndex=c+1;continue}if(i(t.slice(o,c)),o=u,d==="word")i(l,ss(s,l,t,c,u));else if(d==="regex")i(l,"string");else if(d==="tag"){const f=l[1]==="/"?2:1,g=l.slice(f);i(l.slice(0,f),"punctuation"),i(g,/^[A-Z]/.test(g)||g.includes(".")?"type":"keyword")}else if(d==="markup")for(const f of Pe(Me(Gt),l))i(f.text,f.type);else i(l,d)}return i(t.slice(o)),r},ns=(e,s)=>{const t=es(s);return t&&e.length<=Xt?Pe(Me(t),e):[{text:e}]},as="ui-block-M1yL9",is="ui-block__header-F2iBP",os="ui-block__language-lmdS9",rs="ui-block__body-wDCJ2",cs="ui-block__pre--EERi",ls="ui-block__highlighted-JK1Yj",R={block:as,block__header:is,block__language:os,block__body:rs,block__pre:cs,block__highlighted:ls,"block__token--comment":"ui-block__token--comment-eFTyh","block__token--keyword":"ui-block__token--keyword-qQpj9","block__token--string":"ui-block__token--string-4onwX","block__token--number":"ui-block__token--number-DThtL","block__token--name":"ui-block__token--name-283C9","block__token--type":"ui-block__token--type-cNUbM","block__token--punctuation":"ui-block__token--punctuation-Te2u8","block__token--inserted":"ui-block__token--inserted-sUKnQ","block__token--deleted":"ui-block__token--deleted-s74a-"},ds=1600,us=({code:e,language:s,html:t,maxHeight:r,className:i,testId:o})=>{var w;const{labels:a}=h.useUi(),l=h.useAnnounce(),[c,u]=_.useState(!1),d=_.useRef(void 0),m=_.useMemo(()=>t?e:Nt(e,s),[e,t,s]),y=_.useMemo(()=>t?[]:ns(m,s),[m,t,s]);_.useEffect(()=>()=>window.clearTimeout(d.current),[]);const f=async()=>{var k;try{await navigator.clipboard.writeText(m)}catch{return}u(!0),l(N("CodeBlock.copied",(k=a==null?void 0:a.chat)==null?void 0:k.codeCopied)),window.clearTimeout(d.current),d.current=window.setTimeout(()=>u(!1),ds)},g=s??"";return n.jsxs("figure",{className:p(R.block,i),"data-testid":o,children:[n.jsxs("figcaption",{className:R.block__header,children:[n.jsx("span",{className:R.block__language,children:g}),n.jsx(h.IconButton,{icon:c?n.jsx(U.CheckLg,{"aria-hidden":!0}):n.jsx(U.ClipboardFill,{"aria-hidden":!0}),label:Le("CodeBlock.copy",(w=a==null?void 0:a.chat)==null?void 0:w.codeCopy,g),size:"sm",onClick:f})]}),n.jsx("div",{className:R.block__body,style:r===void 0?void 0:{maxBlockSize:r},tabIndex:0,role:g?"region":void 0,"aria-label":g||void 0,children:t?n.jsx("div",{className:R.block__highlighted,dangerouslySetInnerHTML:{__html:t}}):n.jsx("pre",{className:R.block__pre,children:n.jsx("code",{children:y.map((k,M)=>k.type?n.jsx("span",{className:R[`block__token--${k.type}`],children:k.text},M):n.jsx(_.Fragment,{children:k.text},M))})})})]})},_s=_.memo(x(us,"CodeBlock")),ms="ui-block-zqPjp",ps="ui-block__summary-Kkp-X",hs="ui-block__indicator-GuJMa",bs="ui-block__body-mDvrV",W={block:ms,block__summary:ps,block__indicator:hs,block__body:bs},fs=({summary:e,isRunning:s=!1,indicator:t,isDefaultOpen:r=!1,children:i,className:o,testId:a})=>{const[l,c]=_.useState(s||r),u=_.useRef(!1);return _.useEffect(()=>{u.current||c(s||r)},[s,r]),n.jsx(h.Disclosure,{variant:"plain",className:p(W.block,o),summary:n.jsxs("span",{className:W.block__summary,children:[s&&n.jsx("span",{className:W.block__indicator,children:t??n.jsx(h.Spinner,{size:"sm"})}),e]}),isOpen:l,onOpenChange:d=>{u.current=!0,c(d)},testId:a,children:n.jsx("div",{className:W.block__body,children:i})})},ys=_.memo(x(fs,"ReasoningBlock")),gs="ui-text-WKVxU",xs="ui-text__body--uP0k",Ce={text:gs,text__body:xs},ks=({text:e,label:s,maxHeight:t=180,className:r,testId:i})=>n.jsx(h.ScrollArea,{className:p(Ce.text,r),label:s,maxHeight:t,hasFade:!0,isFollowingEnd:!0,testId:i,children:n.jsx("p",{className:Ce.text__body,children:e})}),ws=_.memo(x(ks,"ReasoningText")),vs="ui-call-tV2P8",js="ui-call__header-8Tw7m",Ns="ui-call__icon-TLzwf",Ss="ui-call__name-EHz6G",Ts="ui-call__summary-M4sLU",As="ui-call__meta-bvpp7",Cs="ui-call__body-nFK-C",Es="ui-section-TjSGF",Rs="ui-section__label-UrgqM",$s="ui-section__body-Dy1PX",v={call:vs,"call--static":"ui-call--static-Nldru",call__header:js,call__icon:Ns,"call__icon--running":"ui-call__icon--running-Mx1XK",call__name:Ss,call__summary:Ts,call__meta:As,call__body:Cs,section:Es,section__label:Rs,section__body:$s},Os={running:"neutral",ok:"info",error:"danger",aborted:"ink",interrupted:"danger"},Ls=({icon:e,name:s,summary:t,status:r,meta:i,isDefaultOpen:o,isOpen:a,onOpenChange:l,children:c,className:u,testId:d})=>{var g,w;const{labels:m}=h.useUi(),y=N(`ToolCall.status.${r}`,(w=(g=m==null?void 0:m.chat)==null?void 0:g.toolStatus)==null?void 0:w[r]),f=n.jsxs("span",{className:v.call__header,children:[e!==void 0&&n.jsx("span",{className:p(v.call__icon,r==="running"&&v["call__icon--running"]),"aria-hidden":!0,children:e}),n.jsx("span",{className:v.call__name,children:s}),t!==void 0&&n.jsx("span",{className:v.call__summary,children:t}),n.jsx(h.StatusDot,{tone:Os[r],label:y,isPulsing:r==="running"})]});return c===void 0?n.jsxs("div",{className:p(v.call,v["call--static"],u),"data-testid":d,children:[f,i!==void 0&&n.jsx("span",{className:v.call__meta,children:i})]}):n.jsx(h.Disclosure,{className:p(v.call,u),summary:f,meta:i,isDefaultOpen:o,isOpen:a,onOpenChange:l,testId:d,children:n.jsx("div",{className:v.call__body,children:c})})},zs=({label:e,children:s,className:t})=>n.jsxs("div",{className:p(v.section,t),children:[n.jsx("span",{className:v.section__label,children:e}),n.jsx("div",{className:v.section__body,children:s})]}),Is=_.memo(x(Ls,"ToolCall")),Ds="ui-terminal-D4Bz8",Ms="ui-terminal__command-A7PG2",Ps="ui-terminal__prompt-9N1g2",Ks="ui-terminal__stderr-qCNFe",Bs="ui-terminal__srOnly-2pmQA",K={terminal:Ds,terminal__command:Ms,terminal__prompt:Ps,terminal__stderr:Ks,terminal__srOnly:Bs},Us=({command:e,chunks:s,label:t,maxHeight:r=300,className:i,testId:o})=>{var u;const{labels:a}=h.useUi(),l=_.useRef(null);h.useStickToBottom(l);const c=N("TerminalOutput.stderr",(u=a==null?void 0:a.chat)==null?void 0:u.stderr);return n.jsxs("pre",{ref:l,className:p(K.terminal,i),style:{maxBlockSize:r},tabIndex:0,role:"region","aria-label":t,"data-testid":o,children:[e!==void 0&&n.jsxs("span",{className:K.terminal__command,children:[n.jsxs("span",{className:K.terminal__prompt,"aria-hidden":!0,children:["$"," "]}),e,`
|
|
3
|
+
`]}),s.map((d,m)=>d.stream==="stderr"?n.jsxs("span",{className:K.terminal__stderr,children:[n.jsx("span",{className:K.terminal__srOnly,children:`${c}: `}),d.text]},m):n.jsx("span",{children:d.text},m))]})},Fs=_.memo(x(Us,"TerminalOutput")),Zs="ui-list-GC4NK",qs="ui-list__item-N8DAn",Gs="ui-list__index-VrSMs",Hs="ui-list__text-4tll-",Ys="ui-list__title-seHfJ",Ws="ui-list__plain-ZcCvx",Xs="ui-list__domain-sJLI7",A={list:Zs,list__item:qs,list__index:Gs,list__text:Hs,list__title:Ys,list__plain:Ws,list__domain:Xs},Js=({items:e,label:s,className:t,testId:r})=>{var o;const{labels:i}=h.useUi();return n.jsx("ol",{className:p(A.list,t),"aria-label":N("SourceList.label",s,(o=i==null?void 0:i.chat)==null?void 0:o.sources),"data-testid":r,children:e.map((a,l)=>n.jsxs("li",{className:A.list__item,children:[n.jsx("span",{className:A.list__index,"aria-hidden":!0,children:l+1}),n.jsxs("span",{className:A.list__text,children:[a.url?n.jsx("a",{className:A.list__title,href:a.url,target:"_blank",rel:"noopener noreferrer",children:a.title}):a.onSelect?n.jsx("button",{type:"button",className:A.list__title,onClick:a.onSelect,children:a.title}):n.jsx("span",{className:A.list__plain,children:a.title}),a.domain&&n.jsx("span",{className:A.list__domain,children:a.domain})]})]},a.id))})},Qs=_.memo(x(Js,"SourceList")),Vs="ui-citation-XrGMb",en="ui-citation__srOnly-GnMQp",B={citation:Vs,citation__srOnly:en,"citation--static":"ui-citation--static-8gXHs"},tn=({index:e,href:s,onClick:t,className:r})=>{var a;const{labels:i}=h.useUi(),o=Le("Citation.label",(a=i==null?void 0:i.chat)==null?void 0:a.citation,e);return s?n.jsx("a",{className:p(B.citation,r),href:s,"aria-label":o,children:e}):t?n.jsx("button",{type:"button",className:p(B.citation,r),onClick:t,"aria-label":o,children:e}):n.jsxs("span",{className:p(B.citation,B["citation--static"],r),children:[n.jsx("span",{"aria-hidden":!0,children:e}),n.jsx("span",{className:B.citation__srOnly,children:o})]})},sn=_.memo(x(tn,"Citation")),nn="ui-actions-c8XlJ",an="ui-actions__meta-j-X3I",Ee={actions:nn,actions__meta:an},on="button:not(:disabled), a[href]",rn=({children:e,meta:s,label:t,className:r,testId:i})=>{var c;const{labels:o}=h.useUi(),a=_.useRef(null),l=u=>{var k;const d=[...((k=a.current)==null?void 0:k.querySelectorAll(on))??[]],m=d.indexOf(document.activeElement);if(m<0||d.length===0)return;const y=getComputedStyle(u.currentTarget).direction==="rtl",f=y?"ArrowLeft":"ArrowRight",g=y?"ArrowRight":"ArrowLeft",w=u.key===f?d[(m+1)%d.length]:u.key===g?d[(m-1+d.length)%d.length]:u.key==="Home"?d[0]:u.key==="End"?d[d.length-1]:null;w&&(u.preventDefault(),w.focus())};return n.jsxs("div",{ref:a,role:"toolbar","aria-label":N("MessageActions.label",t,(c=o==null?void 0:o.chat)==null?void 0:c.messageActions),className:p(Ee.actions,r),onKeyDown:l,"data-testid":i,children:[e,s!==void 0&&n.jsx("span",{className:Ee.actions__meta,children:s})]})},cn=_.memo(x(rn,"MessageActions")),ln="ui-bar-UJGDL",dn="ui-bar__brand-ZUcIw",un="ui-bar__start-nvmHH",_n="ui-bar__end-NNQve",X={bar:ln,bar__brand:dn,bar__start:un,bar__end:_n},Re="--ui-header-height",mn=({brand:e,start:s,end:t,className:r,testId:i})=>{const o=_.useRef(null);return _.useEffect(()=>{const a=o.current;if(!a||typeof ResizeObserver>"u")return;const l=document.documentElement,c=new ResizeObserver(([u])=>{var d,m;return l.style.setProperty(Re,`${Math.round(((m=(d=u.borderBoxSize)==null?void 0:d[0])==null?void 0:m.blockSize)??a.offsetHeight)}px`)});return c.observe(a),()=>{c.disconnect(),l.style.removeProperty(Re)}},[]),n.jsxs("header",{ref:o,className:p(X.bar,r),"data-testid":i,children:[n.jsx("div",{className:X.bar__brand,children:e}),s!==void 0&&n.jsx("div",{className:X.bar__start,children:s}),t!==void 0&&n.jsx("div",{className:X.bar__end,children:t})]})},pn=_.memo(x(mn,"AppBar")),hn="ui-list-e54gu",bn="ui-list__window-ESrZX",fn="ui-list__slot-DxSnX",yn="ui-item-DKEGh",gn="ui-item__start-Yb3xf",xn="ui-item__body-kD4Qk",kn="ui-item__end-3SCT-",j={list:hn,"list--virtual":"ui-list--virtual-zxqy5",list__window:bn,list__slot:fn,item:yn,"item--selected":"ui-item--selected-AMl3I","item--muted":"ui-item--muted-XBeA3",item__start:gn,item__body:xn,item__end:kn},$e=6,wn=({label:e,children:s,rowHeight:t,maxHeight:r=320,className:i,testId:o})=>{const a=_.Children.toArray(s).filter(_.isValidElement),[l,c]=_.useState(0);if(!t)return n.jsx("ul",{className:p(j.list,i),"aria-label":e,"data-testid":o,children:a});const u=Math.max(0,Math.floor(l/t)-$e),d=Math.min(a.length,Math.ceil((l+r)/t)+$e);return n.jsx("div",{className:p(j.list,j["list--virtual"],i),style:{maxBlockSize:r,"--ui-row-height":`${t}px`},onScroll:m=>c(m.currentTarget.scrollTop),"data-testid":o,children:n.jsx("ul",{"aria-label":e,className:j.list__window,style:{blockSize:a.length*t,paddingBlockStart:u*t},children:a.slice(u,d).map((m,y)=>_.cloneElement(m,{"aria-posinset":u+y+1,"aria-setsize":a.length}))})})},vn=({children:e,start:s,end:t,onClick:r,href:i,isSelected:o,isMuted:a,testId:l,"aria-posinset":c,"aria-setsize":u})=>{const{linkComponent:d}=h.useUi(),m=p(j.item,o&&j["item--selected"],a&&j["item--muted"]),y=n.jsxs(n.Fragment,{children:[s!==void 0&&n.jsx("span",{className:j.item__start,children:s}),n.jsx("span",{className:j.item__body,children:e}),t!==void 0&&n.jsx("span",{className:j.item__end,children:t})]}),f=d??"a";return n.jsx("li",{className:j.list__slot,"aria-posinset":c,"aria-setsize":u,children:i?n.jsx(f,{href:i,className:m,"data-testid":l,children:y}):n.jsx("button",{type:"button",className:m,onClick:r,"aria-pressed":o,"data-testid":l,children:y})})},jn=_.memo(x(wn,"ActionList")),Nn="ui-bar-OZjXz",Sn="ui-bar__segment-hexbp",Tn="ui-bar__marker-E0FeF",J={bar:Nn,bar__segment:Sn,bar__marker:Tn,"bar__marker--danger":"ui-bar__marker--danger-245FK"},Q=(e,s)=>s<=0?0:Math.min(100,Math.max(0,e/s*100)),An=e=>Oe.cssVar(e==="muted"?"text-3":e),Cn=({label:e,max:s,segments:t,markers:r=[],className:i,testId:o})=>{const a=[...t.map(c=>c.label),...r.map(c=>c.label)];let l=0;return n.jsxs("div",{role:"img","aria-label":`${e}: ${a.join(", ")}`,className:p(J.bar,i),"data-testid":o,children:[t.map(c=>{const u=c.from??l,d=c.to??u+(c.value??0);return l=d,n.jsx("span",{className:J.bar__segment,title:c.label,style:{insetInlineStart:`${Q(u,s)}%`,inlineSize:`${Q(d,s)-Q(u,s)}%`,backgroundColor:An(c.tone)}},c.id)}),r.map(c=>n.jsx("span",{className:p(J.bar__marker,c.tone==="danger"&&J["bar__marker--danger"]),title:c.label,style:{insetInlineStart:`${Q(c.at,s)}%`}},c.id))]})},En=_.memo(x(Cn,"SegmentBar")),Rn="ui-legend-zryov",$n="ui-legend__item-GGrR-",On="ui-legend__swatch-2MkAR",ae={legend:Rn,legend__item:$n,legend__swatch:On},Ln=e=>Oe.cssVar(e==="muted"?"text-3":e),zn=({items:e,className:s,testId:t})=>n.jsx("ul",{className:p(ae.legend,s),"data-testid":t,children:e.map(r=>n.jsxs("li",{className:ae.legend__item,children:[n.jsx("span",{"aria-hidden":!0,className:ae.legend__swatch,style:{backgroundColor:Ln(r.tone)}}),r.label]},r.id))}),In=_.memo(x(zn,"Legend")),Dn="ui-list-KSLu5",Mn="ui-list__row-k7aHp",Pn="ui-list__term-vsD5B",Kn="ui-list__value-6GY6z",I={list:Dn,"list--end":"ui-list--end-sf2sW",list__row:Mn,list__term:Pn,list__value:Kn,"list__value--technical":"ui-list__value--technical-I-UYE"},Bn=({items:e,valueAlign:s="start",className:t,testId:r})=>n.jsx("dl",{className:p(I.list,s==="end"&&I["list--end"],t),"data-testid":r,children:e.map((i,o)=>n.jsxs("div",{className:I.list__row,children:[n.jsx("dt",{className:I.list__term,children:i.term}),n.jsx("dd",{className:p(I.list__value,i.isTechnical&&I["list__value--technical"]),children:i.description})]},o))}),Un=_.memo(x(Bn,"DescriptionList"));exports.ActionList=jn;exports.ActionListItem=vn;exports.AppBar=pn;exports.ChatMessage=et;exports.ChatThread=He;exports.Citation=sn;exports.CodeBlock=_s;exports.DescriptionList=Un;exports.Legend=In;exports.MessageActions=cn;exports.PromptInput=ct;exports.PromptSuggestions=pt;exports.Prose=yt;exports.ReasoningBlock=ys;exports.ReasoningText=ws;exports.SegmentBar=En;exports.SourceList=Qs;exports.TerminalOutput=Fs;exports.ToolCall=Is;exports.ToolCallSection=zs;
|
|
4
4
|
//# sourceMappingURL=chat.cjs.map
|