@alfadocs/ui-kit 1.149.1 → 1.150.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{ai-summary-panel-Cdsve-XN.js → ai-summary-panel-D-RNe-_n.js} +3 -3
- package/dist/_chunks/{anamnesis-summary-rows-QCv6zW-J.js → anamnesis-summary-rows-CE-i9j-s.js} +2 -2
- package/dist/_chunks/{appointment-card-HOZrABrQ.js → appointment-card-BPZggqck.js} +2 -2
- package/dist/_chunks/{appointment-details-panel.history-BxNqcA-r.js → appointment-details-panel.history-BO31ZFQp.js} +2 -2
- package/dist/_chunks/{appointment-details-panel.identity--_j07UG1.js → appointment-details-panel.identity-C9kWtC6m.js} +90 -78
- package/dist/_chunks/appointment-peek-CGJ6kUvM.js +213 -0
- package/dist/_chunks/{appointment-timeline-CuZW-CGT.js → appointment-timeline-ynFqcw0S.js} +3 -3
- package/dist/_chunks/{appointment-tray-CFCxukwq.js → appointment-tray-Dx5VDREk.js} +2 -2
- package/dist/_chunks/{balance-badge-cell-BPz9bQAB.js → balance-badge-cell-DiyJQcmA.js} +2 -2
- package/dist/_chunks/{calendar-appointment-editor-dialog-fQleWmJE.js → calendar-appointment-editor-dialog-BfoEpFVx.js} +360 -356
- package/dist/_chunks/{calendar-editor-discard-host-DWS_kM-a.js → calendar-editor-discard-host-DO506cJu.js} +4 -4
- package/dist/_chunks/{calendar-waiting-list-panel-BKBHfBpn.js → calendar-waiting-list-panel-CyMTv2y3.js} +7 -7
- package/dist/_chunks/{calendar-workspace.model-4zmA3BFE.js → calendar-workspace.model-X3aXbDTo.js} +2 -2
- package/dist/_chunks/{calendar.sheets-lgAqJB34.js → calendar.sheets-C8x8kPb4.js} +10 -10
- package/dist/_chunks/{calls-panel-BTTfHnPD.js → calls-panel-Bpemmnpd.js} +4 -4
- package/dist/_chunks/{care-plan-card-2U2LuIJD.js → care-plan-card-DJXNWjKB.js} +3 -3
- package/dist/_chunks/{care-plan-entry-card-CUAlQv1c.js → care-plan-entry-card-W5QvNv8m.js} +2 -2
- package/dist/_chunks/{communications-panel-DDzUyoHi.js → communications-panel-Cd0TBEhL.js} +2 -2
- package/dist/_chunks/{control-room-rail-BQvaYowi.js → control-room-rail-4W1MFY-g.js} +3 -3
- package/dist/_chunks/{document-preview-oSuJsJ3k.js → document-preview-Zws6CHhK.js} +3 -3
- package/dist/_chunks/{editable-description-BsSjLnSx.js → editable-description-B2F54K4T.js} +34 -33
- package/dist/_chunks/{entity-summary-CZmGcWi2.js → entity-summary-BNnTP1F6.js} +62 -50
- package/dist/_chunks/feature-preview-switch-PKeLaFry.js +75 -0
- package/dist/_chunks/{file-manager-Cp3Z4VvM.js → file-manager-DzOCQBAO.js} +163 -178
- package/dist/_chunks/folder-CH9PJHou.js +36 -0
- package/dist/_chunks/{help-me-write-templates-DlA54nu5.js → help-me-write-templates-B_wMJ82X.js} +2 -2
- package/dist/_chunks/message-square-warning-DsGGfd0K.js +22 -0
- package/dist/_chunks/{notes-panel-Cw06dLDm.js → notes-panel-BguRX8VC.js} +374 -341
- package/dist/_chunks/{optical-prescription-DZvauMiM.js → optical-prescription-BzGnlIjq.js} +2 -2
- package/dist/_chunks/{panel-header-CbtlTe85.js → panel-header-DTc5OFUg.js} +78 -66
- package/dist/_chunks/{panel-subview-DjBwNV16.js → panel-subview-Om_yZvFG.js} +2 -2
- package/dist/_chunks/{patient-account-settings-Do0QbDJe.js → patient-account-settings-YKnBzmwE.js} +3 -3
- package/dist/_chunks/{patient-check-in-resume-Bxy1_Pfo.js → patient-check-in-resume-DERfQbp5.js} +5 -5
- package/dist/_chunks/{patient-details-Cj3dp9GB.js → patient-details-BUD0UbmT.js} +3 -3
- package/dist/_chunks/{patient-field-row-DDjsUsc_.js → patient-field-row-DytaHdGw.js} +201 -200
- package/dist/_chunks/{patient-summary-card-roM9Esfb.js → patient-summary-card-7Werxl48.js} +126 -139
- package/dist/_chunks/{payment-request-card-C9VglWsV.js → payment-request-card-BF3rakTQ.js} +2 -2
- package/dist/_chunks/{portal-details-CKF4yFHs.js → portal-details-C1QQGPQf.js} +3 -3
- package/dist/_chunks/{portal-documents-DvpAwmSI.js → portal-documents-CzEuCaqv.js} +3 -3
- package/dist/_chunks/{portal-parts-Cvu4PfIY.js → portal-parts-BMW4t57s.js} +2 -2
- package/dist/_chunks/{privacy-mask-zVh0ntm0.js → privacy-mask-CrjD5PYW.js} +2 -2
- package/dist/_chunks/{radiograph-panel.agent-BUZPsuSP.js → radiograph-panel.agent-Kl1M0dtT.js} +3 -3
- package/dist/_chunks/{registry-connection-panel-ACOsXu3F.js → registry-connection-panel-kdKbGQE6.js} +3 -3
- package/dist/_chunks/{reserved.agent-DjvapRF1.js → reserved.agent-CW0frsMv.js} +2 -2
- package/dist/_chunks/{reviews-panel-Cw5ygAxs.js → reviews-panel-54AFY6uy.js} +2 -2
- package/dist/_chunks/{rich-text-editor-eGdYDPK2.js → rich-text-editor-DCQEpaIv.js} +1398 -1280
- package/dist/_chunks/{task-editor-C-4I2sBa.js → task-editor-CIHQQRtP.js} +5 -5
- package/dist/_chunks/{tasks-panel-BDPQPOP6.js → tasks-panel-Bc_odkQN.js} +2 -2
- package/dist/_chunks/text-area-DbxGkpzE.js +269 -0
- package/dist/_chunks/{tool-rail-DjPEiBa2.js → tool-rail-CJBtqzMs.js} +337 -320
- package/dist/_chunks/{transaction-chip-CkYd-3ky.js → transaction-chip-6jToArJn.js} +45 -43
- package/dist/_chunks/{transcript-panel-Wr8e4Zgi.js → transcript-panel-Dc0fK4WO.js} +2 -2
- package/dist/_chunks/{treatment-receipt-BZzwvsnY.js → treatment-receipt-B6m47Jie.js} +44 -46
- package/dist/_chunks/{use-appointment-details-read-Bl1DHXQ2.js → use-appointment-details-read-HVHbR0Zl.js} +769 -745
- package/dist/agent-catalog.json +15 -1
- package/dist/appointment-editor-panel/index.js +4 -4
- package/dist/booking-tools-data/index.js +1 -1
- package/dist/browser-support.js +1 -1
- package/dist/calendar-action-buttons/index.js +1 -1
- package/dist/components/_shared/appointment-format.d.ts +4 -0
- package/dist/components/_shared/patient-field-row.d.ts +5 -1
- package/dist/components/ai-summary-panel/index.js +1 -1
- package/dist/components/appointment-card/index.js +2 -2
- package/dist/components/appointment-details-panel/appointment-details-panel.d.ts +5 -2
- package/dist/components/appointment-details-panel/appointment-details-panel.sections.d.ts +3 -1
- package/dist/components/appointment-details-panel/appointment-details-panel.types.d.ts +3 -0
- package/dist/components/appointment-details-panel/index.js +2 -2
- package/dist/components/appointment-peek/appointment-peek.d.ts +45 -1
- package/dist/components/appointment-peek/index.js +1 -1
- package/dist/components/appointment-timeline/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/calls-panel/index.js +1 -1
- package/dist/components/care-plan-card/index.js +1 -1
- package/dist/components/care-plan-entry-card/index.js +1 -1
- package/dist/components/communications-panel/index.js +1 -1
- package/dist/components/control-room-rail/index.js +1 -1
- package/dist/components/document-preview/index.js +1 -1
- package/dist/components/editable-description/editable-description.d.ts +7 -0
- package/dist/components/editable-description/index.js +1 -1
- package/dist/components/entity-summary/index.js +1 -1
- package/dist/components/feature-preview-switch/feature-preview-switch.d.ts +55 -0
- package/dist/components/feature-preview-switch/index.d.ts +2 -0
- package/dist/components/feature-preview-switch/index.js +5 -0
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/notes-panel/notes-panel.d.ts +20 -0
- package/dist/components/optical-prescription/index.js +1 -1
- package/dist/components/panel-header/index.js +1 -1
- package/dist/components/panel-header/panel-header.d.ts +8 -0
- package/dist/components/panel-subview/index.js +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/patient-summary-card/patient-summary-card.d.ts +9 -0
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/payment-card/index.js +1 -1
- package/dist/components/radiograph-panel/index.js +1 -1
- package/dist/components/registry-connection-panel/index.js +1 -1
- package/dist/components/reviews-panel/index.js +1 -1
- package/dist/components/rich-text-editor/editor-toolbar.d.ts +4 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/task-editor/index.js +1 -1
- package/dist/components/tasks-panel/index.js +1 -1
- package/dist/components/text-area/index.js +1 -1
- package/dist/components/text-area/text-area.d.ts +15 -0
- package/dist/components/tool-rail/index.js +1 -1
- package/dist/components/tool-rail/tool-rail.d.ts +12 -1
- package/dist/components/transaction-chip/index.js +1 -1
- package/dist/components/transaction-chip/transaction-chip.d.ts +7 -0
- package/dist/components/transcript-panel/index.js +1 -1
- package/dist/components/treatment-receipt/index.js +1 -1
- package/dist/core.css +1 -1
- package/dist/find-free-slots-panel/index.js +1 -1
- package/dist/host-legacy.css +51 -4
- package/dist/i18n/locales/ar.d.ts +9 -0
- package/dist/i18n/locales/ar.js +8 -2
- package/dist/i18n/locales/de.d.ts +9 -0
- package/dist/i18n/locales/de.js +8 -2
- package/dist/i18n/locales/el.d.ts +9 -0
- package/dist/i18n/locales/el.js +10 -1
- package/dist/i18n/locales/en.d.ts +9 -0
- package/dist/i18n/locales/en.js +11 -2
- package/dist/i18n/locales/es.d.ts +9 -0
- package/dist/i18n/locales/es.js +10 -1
- package/dist/i18n/locales/fr.d.ts +9 -0
- package/dist/i18n/locales/fr.js +10 -1
- package/dist/i18n/locales/hi.d.ts +9 -0
- package/dist/i18n/locales/hi.js +8 -2
- package/dist/i18n/locales/it.d.ts +19 -10
- package/dist/i18n/locales/it.js +20 -11
- package/dist/i18n/locales/ja.d.ts +9 -0
- package/dist/i18n/locales/ja.js +8 -2
- package/dist/i18n/locales/nl.d.ts +9 -0
- package/dist/i18n/locales/nl.js +8 -2
- package/dist/i18n/locales/pl.d.ts +9 -0
- package/dist/i18n/locales/pl.js +10 -1
- package/dist/i18n/locales/pt.d.ts +9 -0
- package/dist/i18n/locales/pt.js +10 -1
- package/dist/i18n/locales/ro.d.ts +9 -0
- package/dist/i18n/locales/ro.js +10 -1
- package/dist/i18n/locales/ru.d.ts +9 -0
- package/dist/i18n/locales/ru.js +8 -2
- package/dist/i18n/locales/sq.d.ts +9 -0
- package/dist/i18n/locales/sq.js +10 -1
- package/dist/i18n/locales/sv.d.ts +9 -0
- package/dist/i18n/locales/sv.js +8 -2
- package/dist/i18n/locales/tr.d.ts +9 -0
- package/dist/i18n/locales/tr.js +8 -2
- package/dist/i18n/locales/zh.d.ts +9 -0
- package/dist/i18n/locales/zh.js +8 -2
- package/dist/index.js +775 -773
- package/dist/locales/ar.json +10 -1
- package/dist/locales/de.json +10 -1
- package/dist/locales/el.json +10 -1
- package/dist/locales/en.json +11 -2
- package/dist/locales/es.json +10 -1
- package/dist/locales/fr.json +10 -1
- package/dist/locales/hi.json +10 -1
- package/dist/locales/it.json +20 -11
- package/dist/locales/ja.json +10 -1
- package/dist/locales/nl.json +10 -1
- package/dist/locales/pl.json +10 -1
- package/dist/locales/pt.json +10 -1
- package/dist/locales/ro.json +10 -1
- package/dist/locales/ru.json +10 -1
- package/dist/locales/sq.json +10 -1
- package/dist/locales/sv.json +10 -1
- package/dist/locales/tr.json +10 -1
- package/dist/locales/zh.json +10 -1
- package/dist/online-bookings-panel/index.js +2 -2
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/calendar/index.js +4 -4
- package/dist/patterns/help-me-write-templates/index.js +1 -1
- package/dist/patterns/patient-account-settings/index.js +1 -1
- package/dist/patterns/patient-check-in/index.js +1 -1
- package/dist/patterns/patient-portal/index.js +2 -2
- package/dist/tokens.css +1 -1
- package/dist/waiting-list-panel/index.js +3 -3
- package/package.json +5 -1
- package/dist/_chunks/appointment-peek-B3raO90X.js +0 -123
- package/dist/_chunks/contact-round-DiSvB3LP.js +0 -18
- package/dist/_chunks/folder-BghC8_S2.js +0 -20
- package/dist/_chunks/text-area-COMVJ1yE.js +0 -258
|
@@ -10,15 +10,15 @@ import { D as X } from "./dialog-239Geb7Z.js";
|
|
|
10
10
|
import { D as xt } from "./date-picker-CD-PBzXM.js";
|
|
11
11
|
import { F as B } from "./form-field-CyHfOVKF.js";
|
|
12
12
|
import { I as jt } from "./icon-button-group-DEAx9M5v.js";
|
|
13
|
-
import { P as $t } from "./panel-header-
|
|
14
|
-
import { P as Mt } from "./panel-subview-
|
|
13
|
+
import { P as $t } from "./panel-header-DTc5OFUg.js";
|
|
14
|
+
import { P as Mt } from "./panel-subview-Om_yZvFG.js";
|
|
15
15
|
import { R as Oe } from "./radio-BZQs6_36.js";
|
|
16
16
|
import { R as qt } from "./radio-group-ChIKyeSJ.js";
|
|
17
17
|
import { S as Vt } from "./scroll-area-CY5SLYNw.js";
|
|
18
18
|
import { S as Ge } from "./select-Bw5FvGJ7.js";
|
|
19
19
|
import { S as He } from "./skeleton-tTWJpvAq.js";
|
|
20
20
|
import { S as _t } from "./switch-DO6uC4HJ.js";
|
|
21
|
-
import { T as Wt } from "./text-area-
|
|
21
|
+
import { T as Wt } from "./text-area-DbxGkpzE.js";
|
|
22
22
|
import { T as Ue } from "./text-input-B6iAgCr3.js";
|
|
23
23
|
import { T as Kt } from "./time-picker-DDr5vhwQ.js";
|
|
24
24
|
import { u as Lt } from "./registry-DvAUVLHh.js";
|
|
@@ -26,7 +26,7 @@ import { u as zt } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
|
|
|
26
26
|
import { c as Gt } from "./compose-refs-C0k0tdqF.js";
|
|
27
27
|
import { E as Ht, a as Yt } from "./compact-editor-fields-cP6yh7xv.js";
|
|
28
28
|
import { P as Xt } from "./patient-picker-Dm74jHIk.js";
|
|
29
|
-
import { b as Jt } from "./privacy-mask-
|
|
29
|
+
import { b as Jt } from "./privacy-mask-CrjD5PYW.js";
|
|
30
30
|
import { isSaveOutcomeUnknownError as Pe, useSaveOutcomeUnknownMessage as Qt } from "../save-outcome/index.js";
|
|
31
31
|
import { g as Ye } from "./get-error-message-DbFUzuja.js";
|
|
32
32
|
import { h as Zt } from "./handled-rejection-C-6Dq0As.js";
|
|
@@ -1159,4 +1159,4 @@ export {
|
|
|
1159
1159
|
gn as T,
|
|
1160
1160
|
cn as t
|
|
1161
1161
|
};
|
|
1162
|
-
//# sourceMappingURL=task-editor-
|
|
1162
|
+
//# sourceMappingURL=task-editor-CIHQQRtP.js.map
|
|
@@ -8,7 +8,7 @@ import { B as Ws } from "./badge-BUk4RjTS.js";
|
|
|
8
8
|
import { B as Re } from "./button-Dp4j9ygh.js";
|
|
9
9
|
import { I as $e } from "./icon-button-u9VMQn3x.js";
|
|
10
10
|
import { B as Nt } from "./button-group-CHQD8GJ0.js";
|
|
11
|
-
import { P as Ks } from "./panel-header-
|
|
11
|
+
import { P as Ks } from "./panel-header-DTc5OFUg.js";
|
|
12
12
|
import { S as jt } from "./select-Bw5FvGJ7.js";
|
|
13
13
|
import { S as Vs } from "./switch-DO6uC4HJ.js";
|
|
14
14
|
import { S as Cs } from "./skeleton-tTWJpvAq.js";
|
|
@@ -1237,4 +1237,4 @@ export {
|
|
|
1237
1237
|
En as T,
|
|
1238
1238
|
dn as t
|
|
1239
1239
|
};
|
|
1240
|
-
//# sourceMappingURL=tasks-panel-
|
|
1240
|
+
//# sourceMappingURL=tasks-panel-Bc_odkQN.js.map
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { jsxs as E, jsx as D } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as ge, useRef as j, useCallback as z, useState as W, useMemo as be, useEffect as he } from "react";
|
|
3
|
+
import { c as ye } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as xe } from "react-i18next";
|
|
5
|
+
import { u as Te, a as we } from "./form-field-context-DtiROUJV.js";
|
|
6
|
+
import { u as Y } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
|
|
7
|
+
import { u as Ae } from "./use-dom-value-DTxHhQAN.js";
|
|
8
|
+
import { u as Ve } from "./registry-DvAUVLHh.js";
|
|
9
|
+
const Fe = {
|
|
10
|
+
id: "text-area",
|
|
11
|
+
capabilities: ["set_value", "edit_inline"],
|
|
12
|
+
state: {
|
|
13
|
+
value: {
|
|
14
|
+
type: "string",
|
|
15
|
+
descriptionKey: "ui.agent.textArea.state.value",
|
|
16
|
+
description: "Current value of the textarea.",
|
|
17
|
+
read: (t) => t.getValue()
|
|
18
|
+
},
|
|
19
|
+
isEmpty: {
|
|
20
|
+
type: "boolean",
|
|
21
|
+
descriptionKey: "ui.agent.textArea.state.isEmpty",
|
|
22
|
+
description: "Whether the textarea has no value.",
|
|
23
|
+
read: (t) => t.getValue() === ""
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
actions: {
|
|
27
|
+
set_value: {
|
|
28
|
+
safety: "write",
|
|
29
|
+
argsType: "{ value: string }",
|
|
30
|
+
argsSchema: {
|
|
31
|
+
type: "object",
|
|
32
|
+
properties: { value: { type: "string" } },
|
|
33
|
+
required: ["value"]
|
|
34
|
+
},
|
|
35
|
+
idempotent: !0,
|
|
36
|
+
descriptionKey: "ui.agent.textArea.actions.setValue",
|
|
37
|
+
description: "Replace the textarea value.",
|
|
38
|
+
invoke: (t, l) => {
|
|
39
|
+
t.setValue(l.value);
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
clear: {
|
|
43
|
+
safety: "destructive",
|
|
44
|
+
idempotent: !0,
|
|
45
|
+
descriptionKey: "ui.agent.textArea.actions.clear",
|
|
46
|
+
description: "Empty the textarea. Loses any typed value.",
|
|
47
|
+
invoke: (t) => {
|
|
48
|
+
t.clear();
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
focus: {
|
|
52
|
+
safety: "read",
|
|
53
|
+
descriptionKey: "ui.agent.textArea.actions.focus",
|
|
54
|
+
description: "Move keyboard focus to the textarea.",
|
|
55
|
+
invoke: (t) => {
|
|
56
|
+
t.focus();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
domHooks: {
|
|
61
|
+
root: {
|
|
62
|
+
attr: "data-component",
|
|
63
|
+
value: "text-area",
|
|
64
|
+
description: "Marks the TextArea wrapper."
|
|
65
|
+
},
|
|
66
|
+
instanceId: {
|
|
67
|
+
attr: "data-component-id",
|
|
68
|
+
sourceProp: "id",
|
|
69
|
+
description: "Sourced from the id prop."
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}, Ie = ye(
|
|
73
|
+
[
|
|
74
|
+
"ds:block ds:w-full ds:border ds:rounded-[var(--radius-sm)] ds:bg-input ds:text-foreground",
|
|
75
|
+
"ds:shadow-[var(--shadow-input)]",
|
|
76
|
+
"ds:leading-[var(--line-height-base)]",
|
|
77
|
+
"ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:py-[var(--spacing-xs)]",
|
|
78
|
+
"ds:focus:outline-none",
|
|
79
|
+
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
80
|
+
"ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
81
|
+
"ds:forced-colors:focus-visible:outline-[CanvasText]",
|
|
82
|
+
"ds:disabled:cursor-not-allowed ds:disabled:opacity-50",
|
|
83
|
+
"ds:read-only:bg-muted ds:read-only:cursor-default ds:read-only:shadow-none",
|
|
84
|
+
"ds:transition-[height,color,background-color,border-color,box-shadow] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
|
|
85
|
+
"ds:placeholder:text-muted-foreground"
|
|
86
|
+
].join(" "),
|
|
87
|
+
{
|
|
88
|
+
variants: {
|
|
89
|
+
size: {
|
|
90
|
+
sm: "ds:min-h-8 ds:text-[length:var(--font-size-sm)]",
|
|
91
|
+
md: "ds:min-h-[var(--min-target-size)] ds:text-[length:var(--font-size-base)]",
|
|
92
|
+
lg: "ds:min-h-[calc(var(--min-target-size)*1.5)] ds:text-[length:var(--font-size-lg)]"
|
|
93
|
+
},
|
|
94
|
+
tone: {
|
|
95
|
+
default: "ds:border-[color:var(--control-border)]",
|
|
96
|
+
error: "ds:border-destructive"
|
|
97
|
+
},
|
|
98
|
+
resize: {
|
|
99
|
+
auto: "ds:resize-none",
|
|
100
|
+
manual: "ds:resize-y"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
defaultVariants: { size: "md", tone: "default", resize: "manual" }
|
|
104
|
+
}
|
|
105
|
+
), Ne = (t, l) => (l ? t > 1 : t >= 1) ? "ds:text-destructive" : t >= 0.9 ? "ds:text-[color:var(--warning-foreground)]" : "ds:text-muted-foreground", ke = (t) => [...t].length, Ee = ge(
|
|
106
|
+
({
|
|
107
|
+
size: t = "md",
|
|
108
|
+
tone: l = "default",
|
|
109
|
+
autoResize: n = !1,
|
|
110
|
+
minRows: h = 2,
|
|
111
|
+
maxRows: y,
|
|
112
|
+
showCounter: G,
|
|
113
|
+
softMaxLength: x,
|
|
114
|
+
measureLength: J = ke,
|
|
115
|
+
className: Q,
|
|
116
|
+
id: T,
|
|
117
|
+
disabled: U,
|
|
118
|
+
value: B,
|
|
119
|
+
defaultValue: w,
|
|
120
|
+
maxLength: v,
|
|
121
|
+
rows: X,
|
|
122
|
+
onChange: i,
|
|
123
|
+
onCompositionStart: A,
|
|
124
|
+
onCompositionEnd: V,
|
|
125
|
+
onInput: Z,
|
|
126
|
+
...L
|
|
127
|
+
}, f) => {
|
|
128
|
+
const { t: H } = xe("ui"), d = Te(), S = we(d, T), R = d.disabled || U, C = d.invalid ? "error" : l, a = j(null), ee = z(
|
|
129
|
+
(e) => {
|
|
130
|
+
a.current = e, typeof f == "function" ? f(e) : f && (f.current = e);
|
|
131
|
+
},
|
|
132
|
+
[f]
|
|
133
|
+
), s = B !== void 0, [te, F] = W(
|
|
134
|
+
String(w ?? "")
|
|
135
|
+
), I = s ? String(B) : te, p = j(!1), K = Ae(
|
|
136
|
+
a,
|
|
137
|
+
s ? I : void 0,
|
|
138
|
+
p
|
|
139
|
+
), O = j(s);
|
|
140
|
+
Y(() => {
|
|
141
|
+
if (O.current === s || (O.current = s, s)) return;
|
|
142
|
+
const e = String(w ?? "");
|
|
143
|
+
a.current && (a.current.value = e), F(e);
|
|
144
|
+
});
|
|
145
|
+
const N = z(() => {
|
|
146
|
+
const e = a.current;
|
|
147
|
+
if (!e || !n) return;
|
|
148
|
+
const r = window.getComputedStyle(e), u = parseFloat(r.lineHeight), m = parseFloat(r.paddingTop), b = parseFloat(r.paddingBottom), le = parseFloat(r.borderTopWidth), fe = parseFloat(r.borderBottomWidth), q = m + b + le + fe, pe = (Number.isFinite(u) ? u : 24) * h + q, me = typeof y == "number" ? (Number.isFinite(u) ? u : 24) * y + q : Number.POSITIVE_INFINITY;
|
|
149
|
+
e.style.height = "auto";
|
|
150
|
+
const ve = Math.max(pe, Math.min(e.scrollHeight, me));
|
|
151
|
+
e.style.height = `${ve}px`;
|
|
152
|
+
}, [n, h, y]);
|
|
153
|
+
Y(() => {
|
|
154
|
+
n && N();
|
|
155
|
+
}, [n, N, I]);
|
|
156
|
+
const re = (e) => {
|
|
157
|
+
s || F(e.target.value), !p.current && (i == null || i(e), s && K());
|
|
158
|
+
}, se = (e) => {
|
|
159
|
+
p.current = !0, A == null || A(e);
|
|
160
|
+
}, oe = (e) => {
|
|
161
|
+
p.current = !1, V == null || V(e);
|
|
162
|
+
const r = e.currentTarget;
|
|
163
|
+
s || F(r.value), i == null || i({
|
|
164
|
+
...e,
|
|
165
|
+
target: r,
|
|
166
|
+
currentTarget: r
|
|
167
|
+
}), s && K(), n && N();
|
|
168
|
+
}, k = z((e) => {
|
|
169
|
+
var b;
|
|
170
|
+
const r = a.current;
|
|
171
|
+
if (!r) return;
|
|
172
|
+
const u = Object.getPrototypeOf(r), m = (b = Object.getOwnPropertyDescriptor(u, "value")) == null ? void 0 : b.set;
|
|
173
|
+
m == null || m.call(r, e), r.dispatchEvent(new Event("input", { bubbles: !0 })), r.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
174
|
+
}, []), ae = be(
|
|
175
|
+
() => ({
|
|
176
|
+
getValue: () => {
|
|
177
|
+
var e;
|
|
178
|
+
return ((e = a.current) == null ? void 0 : e.value) ?? "";
|
|
179
|
+
},
|
|
180
|
+
setValue: (e) => k(e),
|
|
181
|
+
clear: () => k(""),
|
|
182
|
+
focus: () => {
|
|
183
|
+
var e;
|
|
184
|
+
return (e = a.current) == null ? void 0 : e.focus();
|
|
185
|
+
}
|
|
186
|
+
}),
|
|
187
|
+
[k]
|
|
188
|
+
);
|
|
189
|
+
Ve(Fe, ae, T);
|
|
190
|
+
const P = typeof v == "number" && v > 0 ? v : void 0, o = P ?? (typeof x == "number" && x > 0 ? x : void 0), g = o !== void 0 && (G ?? !0), c = J(I), M = o !== void 0 ? Math.max(0, o - c) : 0, ne = o !== void 0 ? c / o : 0, _ = o !== void 0 && c > o, [ie, de] = W("");
|
|
191
|
+
he(() => {
|
|
192
|
+
if (!g) return;
|
|
193
|
+
const e = window.setTimeout(() => {
|
|
194
|
+
p.current || de(
|
|
195
|
+
// Past a soft limit "0 characters remaining" would read as full,
|
|
196
|
+
// not over: say the count itself, as the eye reads it.
|
|
197
|
+
_ ? `${c} / ${o}` : H("inputs.textarea.charactersRemaining", {
|
|
198
|
+
count: M,
|
|
199
|
+
defaultValue: "{{count}} characters remaining"
|
|
200
|
+
})
|
|
201
|
+
);
|
|
202
|
+
}, 500);
|
|
203
|
+
return () => window.clearTimeout(e);
|
|
204
|
+
}, [g, M, _, c, o, H]);
|
|
205
|
+
const $ = g ? `${S}-counter` : void 0, ce = [d.describedBy || void 0, $].filter(Boolean).join(" ") || void 0, ue = n ? "auto" : "manual";
|
|
206
|
+
return /* @__PURE__ */ E(
|
|
207
|
+
"div",
|
|
208
|
+
{
|
|
209
|
+
"data-component": "text-area",
|
|
210
|
+
"data-component-id": T,
|
|
211
|
+
className: "ds:flex ds:w-full ds:flex-col ds:gap-[var(--spacing-xs)]",
|
|
212
|
+
children: [
|
|
213
|
+
/* @__PURE__ */ D(
|
|
214
|
+
"textarea",
|
|
215
|
+
{
|
|
216
|
+
ref: ee,
|
|
217
|
+
id: S,
|
|
218
|
+
defaultValue: s ? void 0 : w,
|
|
219
|
+
disabled: R,
|
|
220
|
+
"aria-describedby": ce,
|
|
221
|
+
"aria-invalid": d.invalid || void 0,
|
|
222
|
+
"aria-required": d.required || void 0,
|
|
223
|
+
maxLength: v,
|
|
224
|
+
rows: n ? h : X,
|
|
225
|
+
onChange: re,
|
|
226
|
+
onCompositionStart: se,
|
|
227
|
+
onCompositionEnd: oe,
|
|
228
|
+
onInput: Z,
|
|
229
|
+
className: Ie({
|
|
230
|
+
size: t,
|
|
231
|
+
tone: C,
|
|
232
|
+
resize: ue,
|
|
233
|
+
className: Q
|
|
234
|
+
}),
|
|
235
|
+
...L
|
|
236
|
+
}
|
|
237
|
+
),
|
|
238
|
+
g ? /* @__PURE__ */ E(
|
|
239
|
+
"div",
|
|
240
|
+
{
|
|
241
|
+
id: $,
|
|
242
|
+
className: "ds:flex ds:justify-end type-meta ds:tabular-nums",
|
|
243
|
+
children: [
|
|
244
|
+
/* @__PURE__ */ E(
|
|
245
|
+
"span",
|
|
246
|
+
{
|
|
247
|
+
"aria-hidden": "true",
|
|
248
|
+
className: Ne(ne, P === void 0),
|
|
249
|
+
children: [
|
|
250
|
+
c,
|
|
251
|
+
" / ",
|
|
252
|
+
o
|
|
253
|
+
]
|
|
254
|
+
}
|
|
255
|
+
),
|
|
256
|
+
/* @__PURE__ */ D("span", { className: "ds:sr-only", "aria-live": "polite", children: ie })
|
|
257
|
+
]
|
|
258
|
+
}
|
|
259
|
+
) : null
|
|
260
|
+
]
|
|
261
|
+
}
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
);
|
|
265
|
+
Ee.displayName = "TextArea";
|
|
266
|
+
export {
|
|
267
|
+
Ee as T
|
|
268
|
+
};
|
|
269
|
+
//# sourceMappingURL=text-area-DbxGkpzE.js.map
|