@getflip/swirl-components-react 0.9.0 → 0.11.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/file-manager.entry.7f94c2d2.js +58 -0
- package/dist/{index-6d2e18c6.289636d4.js → index-c3028f7d.557956d2.js} +0 -0
- package/dist/index.9489626d.js +1393 -0
- package/dist/stencil-generated/index.d.ts +168 -147
- package/dist/swirl-action-list-item.entry.447b2688.js +34 -0
- package/dist/swirl-action-list-section.entry.e84808c9.js +15 -0
- package/dist/{flip-action-list.entry.6018f4b6.js → swirl-action-list.entry.2fb802dc.js} +3 -3
- package/dist/{flip-app-layout_5.entry.3d4528f7.js → swirl-app-layout_5.entry.875542b9.js} +27 -23
- package/dist/swirl-autocomplete.entry.7be53f33.js +70 -0
- package/dist/{flip-avatar-group.entry.80f797ba.js → swirl-avatar-group.entry.38bafbf0.js} +7 -7
- package/dist/{flip-avatar.entry.19eb0d66.js → swirl-avatar.entry.6107d926.js} +7 -7
- package/dist/swirl-badge.entry.1f4d89cf.js +20 -0
- package/dist/swirl-banner.entry.2d29edfc.js +49 -0
- package/dist/swirl-button-group.entry.8ce93c3c.js +20 -0
- package/dist/swirl-button.entry.42b57f80.js +52 -0
- package/dist/{flip-card.entry.3a6a8462.js → swirl-card.entry.a09d5cdf.js} +3 -3
- package/dist/swirl-checkbox.entry.58064458.js +30 -0
- package/dist/{flip-chip.entry.fcfecaac.js → swirl-chip.entry.b6b676d6.js} +22 -14
- package/dist/swirl-components-react.js +170 -149
- package/dist/swirl-components-react.umd.cjs +69 -46
- package/dist/{flip-console-layout.entry.1df3e6c4.js → swirl-console-layout.entry.88cca8db.js} +21 -21
- package/dist/{flip-date-input.entry.672a5f90.js → swirl-date-input.entry.1ff3f34d.js} +680 -673
- package/dist/{flip-date-picker_2.entry.e34761be.js → swirl-date-picker_2.entry.e9905308.js} +79 -77
- package/dist/{flip-description-list-item.entry.2038c81f.js → swirl-description-list-item.entry.e5e7327a.js} +18 -3
- package/dist/{flip-description-list.entry.1fd450a5.js → swirl-description-list.entry.b451e1b2.js} +5 -5
- package/dist/swirl-dialog.entry.27d08ab3.js +45 -0
- package/dist/swirl-file-uploader.entry.6c075751.js +32 -0
- package/dist/{flip-file-viewer_7.entry.64afff8f.js → swirl-file-viewer_7.entry.2d664fd5.js} +19 -19
- package/dist/swirl-form-control.entry.89293c5d.js +65 -0
- package/dist/swirl-form-group.entry.f58b5fda.js +18 -0
- package/dist/swirl-heading.entry.1761ccaf.js +18 -0
- package/dist/swirl-icon-add-photo.entry.2be32855.js +18 -0
- package/dist/swirl-icon-add_4.entry.54bb7e89.js +51 -0
- package/dist/swirl-icon-admin-panel-settings.entry.a43bcc7d.js +18 -0
- package/dist/swirl-icon-arrow-back.entry.ee4ddf1e.js +18 -0
- package/dist/swirl-icon-arrow-downward_2.entry.74231d7a.js +29 -0
- package/dist/swirl-icon-arrow-forward.entry.a895e898.js +18 -0
- package/dist/swirl-icon-arrow-left_3.entry.6ea8dad5.js +40 -0
- package/dist/swirl-icon-arrow-right-small.entry.daf39424.js +18 -0
- package/dist/swirl-icon-attachment.entry.2cb8c35f.js +18 -0
- package/dist/swirl-icon-block.entry.0d7f0e2b.js +18 -0
- package/dist/swirl-icon-cancel_4.entry.2943f0c0.js +51 -0
- package/dist/swirl-icon-chat-bubble.entry.66624624.js +18 -0
- package/dist/swirl-icon-chats-filled.entry.83e0eeb7.js +18 -0
- package/dist/swirl-icon-chats-outlined.entry.f768aca8.js +18 -0
- package/dist/swirl-icon-check-circle.entry.03a596c7.js +18 -0
- package/dist/swirl-icon-check-small_3.entry.b2362b00.js +153 -0
- package/dist/swirl-icon-check-strong.entry.88cfb7b3.js +18 -0
- package/dist/swirl-icon-check.entry.360c5b8c.js +18 -0
- package/dist/swirl-icon-chevron-left.entry.d6f5077d.js +18 -0
- package/dist/swirl-icon-chevron-right.entry.4cbdaed5.js +18 -0
- package/dist/swirl-icon-close-small.entry.d223e192.js +18 -0
- package/dist/swirl-icon-close.entry.eee59783.js +18 -0
- package/dist/swirl-icon-cloud-upload.entry.b50d30c3.js +18 -0
- package/dist/swirl-icon-column.entry.07e869e3.js +18 -0
- package/dist/swirl-icon-comment.entry.221fe61a.js +18 -0
- package/dist/swirl-icon-copy.entry.d113e5bb.js +18 -0
- package/dist/swirl-icon-date-range.entry.a1eb0554.js +18 -0
- package/dist/swirl-icon-delete.entry.ebcf7073.js +18 -0
- package/dist/swirl-icon-description.entry.fb0d88a1.js +18 -0
- package/dist/swirl-icon-edit.entry.c6cf867f.js +18 -0
- package/dist/swirl-icon-emoji-mood.entry.bf9ee6c2.js +18 -0
- package/dist/swirl-icon-emoji-satisfied.entry.df8c1d60.js +18 -0
- package/dist/swirl-icon-error_3.entry.c21fbb54.js +58 -0
- package/dist/swirl-icon-expand-more.entry.bbde4949.js +18 -0
- package/dist/swirl-icon-file.entry.7ab04321.js +18 -0
- package/dist/swirl-icon-filter.entry.95211f5f.js +18 -0
- package/dist/swirl-icon-folder-shared.entry.052229e9.js +18 -0
- package/dist/swirl-icon-group-assign.entry.bb3ba16d.js +18 -0
- package/dist/swirl-icon-groups-custom.entry.89cb31bf.js +18 -0
- package/dist/swirl-icon-groups-filled.entry.8e4dd776.js +18 -0
- package/dist/swirl-icon-groups-outlined.entry.d257fa35.js +18 -0
- package/dist/swirl-icon-groups.entry.eb164fa2.js +18 -0
- package/dist/swirl-icon-help.entry.95af80fe.js +18 -0
- package/dist/swirl-icon-image.entry.ac7fce8a.js +18 -0
- package/dist/swirl-icon-info.entry.7bea6932.js +18 -0
- package/dist/swirl-icon-inventory.entry.7bb8c552.js +18 -0
- package/dist/swirl-icon-like.entry.ec92b9fd.js +18 -0
- package/dist/swirl-icon-link.entry.f3d5937c.js +18 -0
- package/dist/swirl-icon-lock.entry.807d8a95.js +18 -0
- package/dist/swirl-icon-logout.entry.4f31d257.js +18 -0
- package/dist/swirl-icon-mail.entry.54c49af9.js +18 -0
- package/dist/swirl-icon-manage-accounts.entry.8bc3721c.js +18 -0
- package/dist/swirl-icon-mention.entry.5cf61986.js +18 -0
- package/dist/swirl-icon-menu-filled.entry.1597fcdc.js +18 -0
- package/dist/swirl-icon-menu-outlined.entry.05c230c7.js +18 -0
- package/dist/swirl-icon-menu.entry.eb38317a.js +18 -0
- package/dist/swirl-icon-message.entry.3f3b0ee6.js +18 -0
- package/dist/swirl-icon-more-horizontal.entry.746bde39.js +18 -0
- package/dist/swirl-icon-more-vertikal.entry.bf9342ef.js +18 -0
- package/dist/swirl-icon-news-filled.entry.1c1d78f8.js +18 -0
- package/dist/swirl-icon-news-outlined.entry.76c94ea9.js +18 -0
- package/dist/swirl-icon-notifications-active.entry.d8c49de6.js +18 -0
- package/dist/swirl-icon-notifications-off.entry.2c8866a8.js +18 -0
- package/dist/swirl-icon-notifications.entry.a5c7b275.js +18 -0
- package/dist/swirl-icon-open-in-new.entry.128350f5.js +18 -0
- package/dist/swirl-icon-people-alt.entry.7ac6d23a.js +18 -0
- package/dist/swirl-icon-person-off.entry.fda1c4d4.js +18 -0
- package/dist/swirl-icon-person.entry.19fc5367.js +18 -0
- package/dist/swirl-icon-phone.entry.73cfee35.js +18 -0
- package/dist/swirl-icon-poll.entry.4ab05380.js +18 -0
- package/dist/swirl-icon-print.entry.cd89ebc5.js +18 -0
- package/dist/swirl-icon-recieved.entry.56d93432.js +18 -0
- package/dist/swirl-icon-search-strong.entry.904a6694.js +18 -0
- package/dist/swirl-icon-search.entry.cf65f83f.js +18 -0
- package/dist/swirl-icon-send.entry.56297757.js +18 -0
- package/dist/swirl-icon-settings.entry.1c988cf1.js +18 -0
- package/dist/swirl-icon-sync.entry.b88dd7b8.js +18 -0
- package/dist/swirl-icon-tasks-filled.entry.b2bf1c6e.js +18 -0
- package/dist/swirl-icon-tasks-outlined.entry.09551261.js +18 -0
- package/dist/swirl-icon-time-filled.entry.4954d002.js +18 -0
- package/dist/swirl-icon-time-outlined.entry.697e9656.js +18 -0
- package/dist/swirl-icon-user-assign.entry.fe5b582b.js +18 -0
- package/dist/swirl-icon-video-camera.entry.d4707dde.js +18 -0
- package/dist/swirl-icon-warning.entry.69762f5b.js +18 -0
- package/dist/{flip-lightbox.entry.f625cb0b.js → swirl-lightbox.entry.bae60d38.js} +12 -12
- package/dist/swirl-link.entry.3d52e8ef.js +15 -0
- package/dist/swirl-list.entry.53688da6.js +18 -0
- package/dist/swirl-modal.entry.4bf5e6c3.js +63 -0
- package/dist/swirl-option-list-section.entry.898ea907.js +15 -0
- package/dist/swirl-pagination.entry.b892dbdb.js +27 -0
- package/dist/{flip-pdf-reader.entry.7b555d84.js → swirl-pdf-reader.entry.28aa5b27.js} +7 -7
- package/dist/{flip-popover.entry.8e6f4db6.js → swirl-popover.entry.3e96f1d7.js} +8 -8
- package/dist/{flip-progress-indicator.entry.854165f5.js → swirl-progress-indicator.entry.30f3d224.js} +3 -3
- package/dist/swirl-radio-group.entry.9cbdf732.js +35 -0
- package/dist/swirl-radio.entry.7a24ed80.js +29 -0
- package/dist/swirl-resource-list-file-item.entry.c7c3d567.js +37 -0
- package/dist/swirl-search.entry.19702179.js +48 -0
- package/dist/swirl-select.entry.3ff36072.js +48 -0
- package/dist/swirl-separator.entry.6dfbb1a4.js +15 -0
- package/dist/{flip-stack.entry.a2f43d7d.js → swirl-stack.entry.43f00bc0.js} +3 -3
- package/dist/swirl-switch.entry.eaba1cc3.js +56 -0
- package/dist/swirl-tab.entry.982c6bc3.js +18 -0
- package/dist/swirl-table-cell.entry.5cacafda.js +15 -0
- package/dist/swirl-table-column.entry.d66cfcf5.js +23 -0
- package/dist/swirl-table-row-group.entry.4273e651.js +19 -0
- package/dist/swirl-table-row.entry.1f98e36b.js +20 -0
- package/dist/swirl-table.entry.5a37f233.js +141 -0
- package/dist/{flip-tabs.entry.6c282205.js → swirl-tabs.entry.a932c6b9.js} +7 -7
- package/dist/swirl-tag.entry.2fd7c670.js +21 -0
- package/dist/swirl-text-input.entry.c1eb2d9c.js +74 -0
- package/dist/swirl-text.entry.ec8c8813.js +18 -0
- package/dist/{flip-theme-provider.entry.22f08b73.js → swirl-theme-provider.entry.5bf11693.js} +18 -18
- package/dist/swirl-thumbnail.entry.3b230d52.js +18 -0
- package/dist/{flip-toast-provider.entry.dd3a0d33.js → swirl-toast-provider.entry.da18eaab.js} +3 -3
- package/dist/swirl-toast.entry.d0f32449.js +52 -0
- package/dist/{flip-tooltip.entry.abe84c62.js → swirl-tooltip.entry.e444ef8c.js} +7 -7
- package/dist/{flip-tree-navigation-item.entry.a16661ed.js → swirl-tree-navigation-item.entry.49118257.js} +3 -3
- package/dist/{flip-video-thumbnail.entry.d79c4343.js → swirl-video-thumbnail.entry.786a3d11.js} +3 -3
- package/dist/{flip-visually-hidden.entry.08ca947f.js → swirl-visually-hidden.entry.1da622ab.js} +4 -4
- package/dist/utils-7efaa1c6.4a9c3721.js +42 -0
- package/package.json +2 -2
- package/dist/file-manager.entry.bede5c37.js +0 -58
- package/dist/flip-action-list-item.entry.41c8d63b.js +0 -18
- package/dist/flip-action-list-section.entry.6e34b5f7.js +0 -15
- package/dist/flip-autocomplete.entry.d20013f6.js +0 -70
- package/dist/flip-badge.entry.a59ca5a5.js +0 -20
- package/dist/flip-banner.entry.c3203c46.js +0 -33
- package/dist/flip-button-group.entry.3d29e0ac.js +0 -20
- package/dist/flip-button.entry.33e2201f.js +0 -41
- package/dist/flip-checkbox.entry.ddf308bf.js +0 -30
- package/dist/flip-dialog.entry.7f4c27e9.js +0 -45
- package/dist/flip-file-uploader.entry.e8da0073.js +0 -32
- package/dist/flip-form-control.entry.ff10d48c.js +0 -65
- package/dist/flip-form-group.entry.4c6ac05a.js +0 -18
- package/dist/flip-heading_2.entry.f760c2b5.js +0 -29
- package/dist/flip-icon-add-photo.entry.de2582b9.js +0 -15
- package/dist/flip-icon-add_4.entry.cce36b0c.js +0 -45
- package/dist/flip-icon-admin-panel-settings.entry.6bc9a42f.js +0 -15
- package/dist/flip-icon-arrow-back.entry.916b0e36.js +0 -15
- package/dist/flip-icon-arrow-forward.entry.39ab6142.js +0 -15
- package/dist/flip-icon-arrow-left_3.entry.310686ac.js +0 -35
- package/dist/flip-icon-arrow-right-small.entry.c4e9e875.js +0 -15
- package/dist/flip-icon-attachment.entry.3848b7a4.js +0 -15
- package/dist/flip-icon-block.entry.389473d7.js +0 -15
- package/dist/flip-icon-cancel_4.entry.a4bbda31.js +0 -45
- package/dist/flip-icon-chat-bubble.entry.0d4b3747.js +0 -15
- package/dist/flip-icon-check-circle.entry.3428bc41.js +0 -15
- package/dist/flip-icon-check-small_3.entry.eb576a3d.js +0 -143
- package/dist/flip-icon-check-strong.entry.97f4349e.js +0 -15
- package/dist/flip-icon-check.entry.1a597b0d.js +0 -15
- package/dist/flip-icon-chevron-left.entry.00896455.js +0 -15
- package/dist/flip-icon-chevron-right.entry.dcdcbee6.js +0 -15
- package/dist/flip-icon-close-small.entry.c2355ce0.js +0 -15
- package/dist/flip-icon-close.entry.d2aec443.js +0 -15
- package/dist/flip-icon-cloud-upload.entry.3272f7e8.js +0 -15
- package/dist/flip-icon-comment.entry.a28d8cc2.js +0 -15
- package/dist/flip-icon-copy.entry.c41f3167.js +0 -15
- package/dist/flip-icon-date-range.entry.4efa4fa3.js +0 -15
- package/dist/flip-icon-delete.entry.6fa067d1.js +0 -15
- package/dist/flip-icon-description.entry.a039a26d.js +0 -15
- package/dist/flip-icon-edit.entry.917df1fe.js +0 -15
- package/dist/flip-icon-emoji-mood.entry.65524fcf.js +0 -15
- package/dist/flip-icon-emoji-satisfied.entry.d9f472ec.js +0 -15
- package/dist/flip-icon-error_3.entry.215b6df6.js +0 -39
- package/dist/flip-icon-expand-more.entry.51dd745e.js +0 -15
- package/dist/flip-icon-file.entry.38f93b79.js +0 -15
- package/dist/flip-icon-folder-shared.entry.8e9ea6e2.js +0 -15
- package/dist/flip-icon-group-assign.entry.9d1eedd9.js +0 -15
- package/dist/flip-icon-groups-custom.entry.2d3148a4.js +0 -15
- package/dist/flip-icon-groups.entry.5c6b5c95.js +0 -15
- package/dist/flip-icon-help.entry.dcdc07dc.js +0 -15
- package/dist/flip-icon-image.entry.5b1fa36d.js +0 -15
- package/dist/flip-icon-info.entry.545e2af7.js +0 -15
- package/dist/flip-icon-inventory.entry.0e96ffdc.js +0 -15
- package/dist/flip-icon-like.entry.87e16892.js +0 -15
- package/dist/flip-icon-link.entry.7f3e7c44.js +0 -15
- package/dist/flip-icon-lock.entry.9e57f50a.js +0 -15
- package/dist/flip-icon-logout.entry.c397765a.js +0 -15
- package/dist/flip-icon-mail.entry.9bc58364.js +0 -15
- package/dist/flip-icon-manage-accounts.entry.301e10da.js +0 -15
- package/dist/flip-icon-mention.entry.19eb1429.js +0 -15
- package/dist/flip-icon-menu.entry.ff9a123c.js +0 -15
- package/dist/flip-icon-message.entry.c12b6d91.js +0 -15
- package/dist/flip-icon-more-horizontal.entry.fb3132c1.js +0 -15
- package/dist/flip-icon-more-vertikal.entry.b87650d8.js +0 -15
- package/dist/flip-icon-notifications-active.entry.1ab05b95.js +0 -15
- package/dist/flip-icon-notifications-off.entry.e981e732.js +0 -15
- package/dist/flip-icon-notifications.entry.f8debc87.js +0 -15
- package/dist/flip-icon-open-in-new.entry.38a8052c.js +0 -15
- package/dist/flip-icon-people-alt.entry.f1202425.js +0 -15
- package/dist/flip-icon-person-off.entry.e45593d5.js +0 -15
- package/dist/flip-icon-person.entry.44a57c3c.js +0 -15
- package/dist/flip-icon-phone.entry.ca432695.js +0 -15
- package/dist/flip-icon-poll.entry.610041fd.js +0 -15
- package/dist/flip-icon-print.entry.9581b90b.js +0 -15
- package/dist/flip-icon-recieved.entry.b9ca0680.js +0 -15
- package/dist/flip-icon-search-strong.entry.aef21ad5.js +0 -15
- package/dist/flip-icon-search.entry.e3a7afd0.js +0 -15
- package/dist/flip-icon-send.entry.6341b770.js +0 -15
- package/dist/flip-icon-settings.entry.0b198166.js +0 -15
- package/dist/flip-icon-time-filled.entry.7d79933a.js +0 -15
- package/dist/flip-icon-time-outlined.entry.bb5da3a9.js +0 -15
- package/dist/flip-icon-user-assign.entry.b680ffd6.js +0 -15
- package/dist/flip-icon-video-camera.entry.88264d49.js +0 -15
- package/dist/flip-icon-warning.entry.cb35b329.js +0 -15
- package/dist/flip-link.entry.1cd804c2.js +0 -15
- package/dist/flip-list.entry.914a8023.js +0 -18
- package/dist/flip-modal.entry.816373ed.js +0 -63
- package/dist/flip-option-list-section.entry.b40143ef.js +0 -15
- package/dist/flip-pagination.entry.0d081e12.js +0 -27
- package/dist/flip-radio-group.entry.0d83a19b.js +0 -35
- package/dist/flip-radio.entry.e10201cd.js +0 -29
- package/dist/flip-resource-list-file-item.entry.73fd8ba3.js +0 -20
- package/dist/flip-search.entry.365ec7f8.js +0 -31
- package/dist/flip-select.entry.0f48829d.js +0 -48
- package/dist/flip-switch.entry.3d9906ae.js +0 -56
- package/dist/flip-tab.entry.42e1241c.js +0 -18
- package/dist/flip-tag.entry.ae1b5da7.js +0 -21
- package/dist/flip-text-input.entry.50675c4c.js +0 -60
- package/dist/flip-thumbnail.entry.d4e5fe61.js +0 -18
- package/dist/flip-toast.entry.f193091c.js +0 -39
- package/dist/index.bf386a84.js +0 -1372
- package/dist/utils-39b2afe8.37b54ba4.js +0 -40
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { r, h as t, H as e, g as i } from "./index.9489626d.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import "react-dom";
|
|
4
|
+
const o = ":host{display:flex;overflow:hidden;padding-top:var(--s-space-12);padding-right:var(--s-space-16);padding-bottom:var(--s-space-12);padding-left:var(--s-space-16);flex-basis:0;flex-grow:1;flex-shrink:1;align-items:center;border-top:var(--s-border-width-default) solid var(--s-border-default);border-bottom:var(--s-border-width-default) solid var(--s-border-default);color:var(--s-text-subdued);background-color:var(--s-background-default);font-size:var(--s-font-size-sm);font-weight:var(--s-font-weight-medium);line-height:var(--s-line-height-sm);white-space:nowrap;letter-spacing:var(--s-letter-spacing-tighter);text-overflow:ellipsis;transition:box-shadow 0.15s;gap:var(--s-space-8)}:host(:first-child){border-left:var(--s-border-width-default) solid var(--s-border-default)}:host(:last-child){border-right:var(--s-border-width-default) solid var(--s-border-default)}:host(.table-column--has-shadow-right){box-shadow:var(--swirl-table-sticky-right-shadow)}:host(.table-column--has-shadow-left){box-shadow:var(--swirl-table-sticky-left-shadow)}:host *{box-sizing:border-box}.table-column__sort-indicator{display:inline-flex;width:1.25rem;height:1.25rem;flex-grow:0;flex-shrink:0}", a = class {
|
|
5
|
+
constructor(s) {
|
|
6
|
+
r(this, s), this.minWidth = "fit-content";
|
|
7
|
+
}
|
|
8
|
+
render() {
|
|
9
|
+
const s = {
|
|
10
|
+
flex: Boolean(this.width) ? `0 0 ${this.width}` : "",
|
|
11
|
+
maxWidth: this.maxWidth || "",
|
|
12
|
+
minWidth: this.minWidth || ""
|
|
13
|
+
};
|
|
14
|
+
return t(e, { "aria-sort": this.sort, class: "table-column", role: "columnheader", style: s }, t("span", null, t("slot", null)), this.sortable && t("span", { class: "table-column__sort-indicator" }, this.sort === "ascending" && t("swirl-icon-arrow-upward", { "aria-hidden": "true", size: 20 }), this.sort === "descending" && t("swirl-icon-arrow-downward", { "aria-hidden": "true", size: 20 }), !Boolean(this.sort) && " "));
|
|
15
|
+
}
|
|
16
|
+
get el() {
|
|
17
|
+
return i(this);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
a.style = o;
|
|
21
|
+
export {
|
|
22
|
+
a as swirl_table_column
|
|
23
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { r as o, h as r, H as s, g as t } from "./index.9489626d.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import "react-dom";
|
|
4
|
+
const a = ":host{position:relative;z-index:1;display:block}:host *{box-sizing:border-box}.table-row-group__header-row{padding:var(--s-space-12) var(--s-space-16);border-bottom:var(--s-border-width-default) solid var(--s-border-default);background-color:var(--s-surface-raised-default);font-size:var(--s-font-size-sm);font-weight:var(--s-font-weight-medium);line-height:var(--s-line-height-sm)}@media (min-width: 768px){.table-row-group__label{position:sticky;left:var(--s-space-16)}}", l = class {
|
|
5
|
+
constructor(e) {
|
|
6
|
+
o(this, e);
|
|
7
|
+
}
|
|
8
|
+
render() {
|
|
9
|
+
const e = this.el.querySelectorAll("swirl-table-row").length;
|
|
10
|
+
return r(s, { class: "table-row-group", role: "rowgroup" }, r("div", { class: "table-row-group__header-row", role: "row" }, r("span", { "aria-rowspan": e, class: "table-row-group__label", role: "rowheader" }, this.label)), r("slot", null));
|
|
11
|
+
}
|
|
12
|
+
get el() {
|
|
13
|
+
return t(this);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
l.style = a;
|
|
17
|
+
export {
|
|
18
|
+
l as swirl_table_row_group
|
|
19
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { r, h as o, H as s } from "./index.9489626d.js";
|
|
2
|
+
import { c as e } from "./index-c3028f7d.557956d2.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import "react-dom";
|
|
5
|
+
import "./_commonjsHelpers-44457d8d.ba94af77.js";
|
|
6
|
+
const l = ":host{display:flex}:host(.table-row--highlighted){--swirl-ghost-button-background-default:transparent}:host(.table-row--highlighted) ::slotted(.table-cell){background-color:rgba(240, 242, 255, 1);}:host ::slotted(.table-cell){border-bottom:var(--s-border-width-default) solid var(--s-border-default)}:host *{box-sizing:border-box}", a = class {
|
|
7
|
+
constructor(t) {
|
|
8
|
+
r(this, t);
|
|
9
|
+
}
|
|
10
|
+
render() {
|
|
11
|
+
const t = e("table-row", {
|
|
12
|
+
"table-row--highlighted": this.highlighted
|
|
13
|
+
});
|
|
14
|
+
return o(s, { "aria-rowindex": this.index, class: t, role: "row" }, o("slot", null));
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
a.style = l;
|
|
18
|
+
export {
|
|
19
|
+
a as swirl_table_row
|
|
20
|
+
};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { r as g, h as i, H as _, g as S } from "./index.9489626d.js";
|
|
2
|
+
import { i as v } from "./utils-7efaa1c6.4a9c3721.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import "react-dom";
|
|
5
|
+
var C = function(e) {
|
|
6
|
+
var a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, n = void 0, r = void 0, c = void 0, o = [];
|
|
7
|
+
return function() {
|
|
8
|
+
var w = x(a), h = new Date().getTime(), y = !n || h - n > w;
|
|
9
|
+
n = h;
|
|
10
|
+
for (var l = arguments.length, u = Array(l), b = 0; b < l; b++)
|
|
11
|
+
u[b] = arguments[b];
|
|
12
|
+
if (y && s.leading)
|
|
13
|
+
return s.accumulate ? Promise.resolve(e.call(this, [u])).then(function(f) {
|
|
14
|
+
return f[0];
|
|
15
|
+
}) : Promise.resolve(e.call.apply(e, [this].concat(u)));
|
|
16
|
+
if (r ? clearTimeout(c) : r = L(), o.push(u), c = setTimeout(m.bind(this), w), s.accumulate) {
|
|
17
|
+
var p = o.length - 1;
|
|
18
|
+
return r.promise.then(function(f) {
|
|
19
|
+
return f[p];
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return r.promise;
|
|
23
|
+
};
|
|
24
|
+
function m() {
|
|
25
|
+
var d = r;
|
|
26
|
+
clearTimeout(c), Promise.resolve(s.accumulate ? e.call(this, o) : e.apply(this, o[o.length - 1])).then(d.resolve, d.reject), o = [], r = null;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
function x(t) {
|
|
30
|
+
return typeof t == "function" ? t() : t;
|
|
31
|
+
}
|
|
32
|
+
function L() {
|
|
33
|
+
var t = {};
|
|
34
|
+
return t.promise = new Promise(function(e, a) {
|
|
35
|
+
t.resolve = e, t.reject = a;
|
|
36
|
+
}), t;
|
|
37
|
+
}
|
|
38
|
+
const R = `:host{position:relative;display:block}:host *{box-sizing:border-box}.table__container{position:relative;overflow:auto;width:100%}.table__container--scrolled{--swirl-table-sticky-right-shadow:0.0625rem 0 0 0 var(--s-border-default),
|
|
39
|
+
-0.0625rem 0 0 0 var(--s-border-default),
|
|
40
|
+
0 0.25rem 1rem rgba(25, 26, 28, 0.04),
|
|
41
|
+
0 0.0625rem 0.25rem rgba(25, 26, 28, 0.16)}.table__container--scrollable:not(.table__container--scrolled-to-end){--swirl-table-sticky-left-shadow:0.0625rem 0 0 0 var(--s-border-default),
|
|
42
|
+
-0.0625rem 0 0 0 var(--s-border-default),
|
|
43
|
+
0 0.25rem 1rem rgba(25, 26, 28, 0.04),
|
|
44
|
+
0 0.0625rem 0.25rem rgba(25, 26, 28, 0.16)}.table__table{width:-webkit-max-content;width:-moz-max-content;width:max-content;min-width:max(20rem, 100%)}.table__header ::slotted(*){display:flex}.table__empty-row{display:flex}.table__empty-row-cell{display:flex;overflow:auto;padding-top:var(--s-space-8);padding-right:var(--s-space-16);padding-bottom:var(--s-space-8);padding-left:var(--s-space-16);flex-basis:0;flex-grow:1;flex-shrink:1;align-items:center;border-right:var(--s-border-width-default) solid var(--s-border-default);border-bottom:var(--s-border-width-default) solid var(--s-border-default);border-left:var(--s-border-width-default) solid var(--s-border-default);background-color:var(--s-background-default)}.table__empty-row-cell>*{flex-grow:1}`, T = class {
|
|
45
|
+
constructor(t) {
|
|
46
|
+
g(this, t), this.emptyStateLabel = "No results found.", this.updateLayout = C(async () => {
|
|
47
|
+
await this.resetEmptyRowStyles(), await this.resetRowGroupStyles(), await this.resetCellStyles(), await this.resetColumnStyles(), await this.layoutEmptyRow(), await this.layoutRowGroups(), await this.layOutColumns(), this.layOutCells();
|
|
48
|
+
}, 100), this.onScroll = () => {
|
|
49
|
+
this.updateScrolledState();
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
async componentDidRender() {
|
|
53
|
+
await this.updateLayout(), this.updateScrolledState(), this.updateEmptyState();
|
|
54
|
+
}
|
|
55
|
+
async onWindowResize() {
|
|
56
|
+
await this.updateLayout(), this.updateScrolledState();
|
|
57
|
+
}
|
|
58
|
+
updateScrolledState() {
|
|
59
|
+
const t = v(), e = this.container.scrollWidth > this.container.clientWidth, a = this.container.scrollLeft > 0, s = Math.ceil(this.container.clientWidth + this.container.scrollLeft) >= Math.floor(this.container.scrollWidth);
|
|
60
|
+
e !== this.scrollable && (e && !t ? this.container.classList.add("table__container--scrollable") : this.container.classList.remove("table__container--scrollable")), a !== this.scrolled && (a && !t ? this.container.classList.add("table__container--scrolled") : this.container.classList.remove("table__container--scrolled")), s !== this.scrolledToEnd && (s && !t ? this.container.classList.add("table__container--scrolled-to-end") : this.container.classList.remove("table__container--scrolled-to-end"));
|
|
61
|
+
}
|
|
62
|
+
getColumns() {
|
|
63
|
+
return Array.from(this.el.querySelectorAll("swirl-table-column"));
|
|
64
|
+
}
|
|
65
|
+
getCells() {
|
|
66
|
+
return Array.from(this.el.querySelectorAll("swirl-table-cell"));
|
|
67
|
+
}
|
|
68
|
+
async resetEmptyRowStyles() {
|
|
69
|
+
const t = this.el.shadowRoot.querySelector(".table__empty-row");
|
|
70
|
+
!Boolean(t) || (t.style.width = "", await new Promise((e) => setTimeout(e)));
|
|
71
|
+
}
|
|
72
|
+
async resetRowGroupStyles() {
|
|
73
|
+
Array.from(this.el.querySelectorAll("swirl-table-row-group")).forEach((e) => {
|
|
74
|
+
e.shadowRoot.querySelector(".table-row-group__header-row").style.width = "";
|
|
75
|
+
}), await new Promise((e) => setTimeout(e));
|
|
76
|
+
}
|
|
77
|
+
async resetColumnStyles() {
|
|
78
|
+
this.getColumns().forEach((e) => {
|
|
79
|
+
e.classList.remove("table-column--has-shadow"), e.style.right = "", e.style.left = "", e.style.position = "", e.style.zIndex = "";
|
|
80
|
+
}), await new Promise((e) => setTimeout(e));
|
|
81
|
+
}
|
|
82
|
+
async resetCellStyles() {
|
|
83
|
+
this.getCells().forEach((e) => {
|
|
84
|
+
e.classList.remove("table-cell--has-shadow"), e.style.flex = "", e.style.left = "", e.style.right = "", e.style.position = "", e.style.zIndex = "";
|
|
85
|
+
}), await new Promise((e) => setTimeout(e));
|
|
86
|
+
}
|
|
87
|
+
async layoutEmptyRow() {
|
|
88
|
+
const t = this.el.shadowRoot.querySelector(".table__empty-row");
|
|
89
|
+
if (!Boolean(t))
|
|
90
|
+
return;
|
|
91
|
+
const e = `${this.el.shadowRoot.querySelector(".table__container").scrollWidth}px`;
|
|
92
|
+
t.style.width = e;
|
|
93
|
+
}
|
|
94
|
+
async layoutRowGroups() {
|
|
95
|
+
const t = Array.from(this.el.querySelectorAll("swirl-table-row-group")), e = `${this.el.shadowRoot.querySelector(".table__container").scrollWidth}px`;
|
|
96
|
+
t.forEach((a) => {
|
|
97
|
+
a.shadowRoot.querySelector(".table-row-group__header-row").style.width = e;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
async layOutColumns() {
|
|
101
|
+
const t = this.getColumns(), a = this.container.clientWidth;
|
|
102
|
+
t.forEach((s, n) => {
|
|
103
|
+
var r, c;
|
|
104
|
+
if (!s.sticky || v())
|
|
105
|
+
return;
|
|
106
|
+
const o = n <= Math.floor(t.length / 2), m = (r = t[n + 1]) === null || r === void 0 ? void 0 : r.sticky, d = (c = t[n - 1]) === null || c === void 0 ? void 0 : c.sticky, w = o && m;
|
|
107
|
+
s.style.zIndex = w ? "1" : "", o && !m || !o && !d ? s.classList.add(o ? "table-column--has-shadow-right" : "table-column--has-shadow-left") : (s.classList.remove("table-column--has-shadow-right"), s.classList.remove("table-column--has-shadow-left"));
|
|
108
|
+
const y = o ? s.offsetLeft : Math.max(0, a - (s.offsetLeft + s.getBoundingClientRect().width));
|
|
109
|
+
s.style.position = "sticky", o ? s.style.left = `${y}px` : s.style.right = `${y}px`;
|
|
110
|
+
}), await new Promise((s) => setTimeout(s));
|
|
111
|
+
}
|
|
112
|
+
layOutCells() {
|
|
113
|
+
const t = this.getColumns(), e = this.getCells();
|
|
114
|
+
t.forEach((a, s) => {
|
|
115
|
+
var n, r;
|
|
116
|
+
const c = e.filter((l, u) => (s - u) % t.length === 0), o = s <= Math.floor(t.length / 2), m = o ? window.getComputedStyle(a).left : window.getComputedStyle(a).right, d = (n = t[s + 1]) === null || n === void 0 ? void 0 : n.sticky, w = (r = t[s - 1]) === null || r === void 0 ? void 0 : r.sticky, h = a.sticky, y = a.width || `${a.getBoundingClientRect().width}px`;
|
|
117
|
+
c.forEach((l) => {
|
|
118
|
+
const u = h && o, b = h && !o, p = o && d;
|
|
119
|
+
if (l.style.flex = Boolean(y) ? `0 0 ${y}` : "", v()) {
|
|
120
|
+
l.classList.remove("table-cell--has-shadow"), l.style.left = "", l.style.right = "", l.style.position = "", l.style.zIndex = "";
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
l.style.left = u ? m : "", l.style.right = b ? m : "", l.style.position = h ? "sticky" : "", l.style.zIndex = p ? "1" : "", h && (o && !d || !o && !w) ? l.classList.add(o ? "table-cell--has-shadow-right" : "table-cell--has-shadow-left") : (l.classList.remove("table-cell--has-shadow-right"), l.classList.remove("table-cell--has-shadow-left"));
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
updateEmptyState() {
|
|
128
|
+
const t = this.el.querySelector('[slot="rows"]');
|
|
129
|
+
this.empty = !Boolean(t) || t.children.length === 0;
|
|
130
|
+
}
|
|
131
|
+
render() {
|
|
132
|
+
return i(_, null, i("div", { class: "table" }, i("div", { class: "table__container", onScroll: this.onScroll, ref: (t) => this.container = t }, i("div", { "aria-describedby": Boolean(this.caption) ? "caption" : void 0, "aria-label": this.label, role: "table", class: "table__table" }, this.caption && i("swirl-visually-hidden", null, i("div", { id: "caption" }, this.caption)), i("div", { role: "rowgroup" }, i("div", { class: "table__header", role: "row" }, i("slot", { name: "columns" }))), i("div", { class: "table__body" }, i("slot", { name: "rows" }), this.empty && i("div", { class: "table__empty-row", role: "row" }, i("div", { "aria-colspan": this.getColumns().length, class: "table__empty-row-cell", role: "cell" }, i("swirl-text", { align: "center", size: "sm" }, this.emptyStateLabel))))))));
|
|
133
|
+
}
|
|
134
|
+
get el() {
|
|
135
|
+
return S(this);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
T.style = R;
|
|
139
|
+
export {
|
|
140
|
+
T as swirl_table
|
|
141
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { r as i, c as r, h as e, H as o, g as b } from "./index.
|
|
2
|
-
import { c as
|
|
1
|
+
import { r as i, c as r, h as e, H as o, g as b } from "./index.9489626d.js";
|
|
2
|
+
import { c as n } from "./index-c3028f7d.557956d2.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "react-dom";
|
|
5
5
|
import "./_commonjsHelpers-44457d8d.ba94af77.js";
|
|
6
|
-
const
|
|
6
|
+
const l = '.sc-swirl-tabs-h{display:block;width:100%}.sc-swirl-tabs-h *.sc-swirl-tabs{box-sizing:border-box}.tabs.sc-swirl-tabs{width:100%}.tabs__tab-bar.sc-swirl-tabs{position:relative;display:flex;width:100%;justify-content:flex-start;border-bottom:var(--s-border-width-default) solid var(--s-border-default)}.tabs__tab.sc-swirl-tabs{position:relative;display:block;min-width:0;margin:0;padding:var(--s-space-4) var(--s-space-8);border:none;background-color:transparent;font:inherit;font-weight:var(--s-font-weight-medium);line-height:var(--s-line-height-base);cursor:pointer}.tabs__tab.sc-swirl-tabs:focus{outline:none}.tabs__tab.sc-swirl-tabs:focus-visible .tabs__tab-label.sc-swirl-tabs{border-radius:var(--s-border-radius-s);box-shadow:inset 0 0 0 0.125rem var(--s-focus-default)}.tabs__tab.sc-swirl-tabs:not(.tabs__tab--active):hover:after{position:absolute;bottom:0;left:50%;width:calc(100% - var(--s-space-8));height:0.1875rem;border-radius:0.125rem;background-color:var(--s-border-default);content:"";transform:translateX(-50%);pointer-events:none}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.tabs__tab.sc-swirl-tabs{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.tabs__tab-label.sc-swirl-tabs{display:block;overflow:hidden;width:100%;padding:var(--s-space-8) var(--s-space-8);text-align:center;white-space:nowrap;text-overflow:ellipsis}.tabs__tab--active.sc-swirl-tabs{color:var(--s-text-highlight)}.tabs__tab--active.sc-swirl-tabs:after{position:absolute;bottom:0;left:50%;width:calc(100% - var(--s-space-8));height:0.1875rem;border-radius:0.125rem;background-color:var(--s-border-highlight);content:"";transform:translateX(-50%);pointer-events:none}', c = class {
|
|
7
7
|
constructor(t) {
|
|
8
8
|
i(this, t), this.tabActivated = r(this, "tabActivated", 7), this.tabs = [], this.onKeyDown = (a) => {
|
|
9
9
|
a.code === "ArrowLeft" ? (a.preventDefault(), this.activatePreviousTab()) : a.code === "ArrowRight" && (a.preventDefault(), this.activateNextTab());
|
|
@@ -34,14 +34,14 @@ const n = '.sc-flip-tabs-h{display:block;width:100%}.sc-flip-tabs-h *.sc-flip-ta
|
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
collectTabs() {
|
|
37
|
-
if (this.tabs = Array.from(this.el.querySelectorAll("
|
|
37
|
+
if (this.tabs = Array.from(this.el.querySelectorAll("swirl-tab")), this.tabs.length === 0)
|
|
38
38
|
return;
|
|
39
39
|
const t = this.tabs.find((a) => a.tabId === this.initialTab);
|
|
40
40
|
this.activateTab(Boolean(t) ? t.tabId : this.tabs[0].tabId);
|
|
41
41
|
}
|
|
42
42
|
render() {
|
|
43
43
|
return e(o, null, e("div", { class: "tabs" }, e("div", { "aria-label": this.label, class: "tabs__tab-bar", onKeyDown: this.onKeyDown, role: "tablist" }, this.tabs.map((t) => {
|
|
44
|
-
const a = t.tabId === this.activeTab, s =
|
|
44
|
+
const a = t.tabId === this.activeTab, s = n("tabs__tab", {
|
|
45
45
|
"tabs__tab--active": a
|
|
46
46
|
});
|
|
47
47
|
return e("button", {
|
|
@@ -61,7 +61,7 @@ const n = '.sc-flip-tabs-h{display:block;width:100%}.sc-flip-tabs-h *.sc-flip-ta
|
|
|
61
61
|
return b(this);
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
|
-
c.style =
|
|
64
|
+
c.style = l;
|
|
65
65
|
export {
|
|
66
|
-
c as
|
|
66
|
+
c as swirl_tabs
|
|
67
67
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { r as s, c as e, h as t, H as n } from "./index.9489626d.js";
|
|
2
|
+
import { c as i } from "./index-c3028f7d.557956d2.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import "react-dom";
|
|
5
|
+
import "./_commonjsHelpers-44457d8d.ba94af77.js";
|
|
6
|
+
const c = ":host{display:inline-flex}:host *{box-sizing:border-box}.tag{display:inline-flex;padding:var(--s-space-2) var(--s-space-8);align-items:center;border-radius:var(--s-border-radius-s);color:var(--s-text-default);background-color:var(--s-surface-neutral-subdued);font-size:var(--s-font-size-sm);font-weight:var(--s-font-weight-medium);line-height:var(--s-line-height-sm);white-space:nowrap;gap:var(--s-space-4)}.tag--intent-info{color:var(--s-text-info);background-color:var(--s-surface-info-subdued)}.tag--intent-info .tag__removal-button{color:var(--icon-info)}.tag--intent-critical{color:var(--s-text-critical);background-color:var(--s-surface-critical-subdued)}.tag--intent-critical .tag__removal-button{color:var(--icon-critical)}.tag--intent-warning{color:var(--s-text-warning);background-color:var(--s-surface-warning-subdued)}.tag--intent-warning .tag__removal-button{color:var(--icon-warning)}.tag--intent-success{color:var(--s-text-success);background-color:var(--s-surface-success-subdued)}.tag--intent-success .tag__removal-button{color:var(--icon-success)}.tag__removal-button{display:inline-flex;margin-right:calc(-1 * var(--s-space-4));padding:0;border:none;color:var(--s-icon-strong);background-color:transparent;cursor:pointer}.tag__removal-button:focus:not(:focus-visible){outline:none}.tag__removal-button:focus-visible{outline-color:var(--s-focus-default)}", l = class {
|
|
7
|
+
constructor(o) {
|
|
8
|
+
s(this, o), this.remove = e(this, "remove", 7), this.intent = "default", this.removalButtonLabel = "Remove", this.onRemove = (r) => {
|
|
9
|
+
var a;
|
|
10
|
+
(a = this.remove) === null || a === void 0 || a.emit(r);
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
const o = i("tag", `tag--intent-${this.intent}`);
|
|
15
|
+
return t(n, null, t("span", { class: o }, this.label, this.removable && t("button", { "aria-label": this.removalButtonLabel, class: "tag__removal-button", onClick: this.onRemove, type: "button" }, t("swirl-icon-close", { size: 16 }))));
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
l.style = c;
|
|
19
|
+
export {
|
|
20
|
+
l as swirl_tag
|
|
21
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { r as h, c as n, h as i, H as d } from "./index.9489626d.js";
|
|
2
|
+
import { c } from "./index-c3028f7d.557956d2.js";
|
|
3
|
+
import { g as x } from "./utils-7efaa1c6.4a9c3721.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "react-dom";
|
|
6
|
+
import "./_commonjsHelpers-44457d8d.ba94af77.js";
|
|
7
|
+
const w = '.sc-swirl-text-input-h{display:block;width:100%}.sc-swirl-text-input-h *.sc-swirl-text-input{box-sizing:border-box}.text-input.sc-swirl-text-input{position:relative;display:flex;width:100%;align-items:center;color:var(--s-text-default);font:inherit;line-height:var(--s-line-height-sm)}.text-input--clearable.sc-swirl-text-input,.text-input--type-number.sc-swirl-text-input,.text-input--type-password.sc-swirl-text-input{padding-right:calc(1.5rem + var(--s-space-8))}.text-input--show-password.sc-swirl-text-input .text-input__input.sc-swirl-text-input{width:100%}.text-input--disabled.sc-swirl-text-input .text-input__character-counter.sc-swirl-text-input{color:var(--s-text-disabled)}.text-input__input.sc-swirl-text-input{display:inline-flex;width:100%;max-height:13.75rem;margin:0;padding:0;border:none;color:var(--s-text-default);background-color:transparent;font:inherit;font-size:var(--s-font-size-base);line-height:var(--s-line-height-base);resize:none;caret-color:var(--s-border-highlight)}.text-input__input.sc-swirl-text-input:focus{outline:none}.text-input__input.sc-swirl-text-input:disabled{color:var(--s-text-disabled);background-color:transparent}.text-input__input.sc-swirl-text-input::-webkit-outer-spin-button,.text-input__input.sc-swirl-text-input::-webkit-inner-spin-button{margin:0;-webkit-appearance:none}.text-input__input[type="number"].sc-swirl-text-input{-moz-appearance:textfield}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.text-input__input.sc-swirl-text-input{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}input.text-input__input.sc-swirl-text-input:not([type="password"]){width:0.25rem;min-width:0.25rem}.text-input--disable-dynamic-width.sc-swirl-text-input input.text-input__input.sc-swirl-text-input:not([type="password"]){width:100%;min-width:0}.text-input__clear-button.sc-swirl-text-input,.text-input__password-toggle.sc-swirl-text-input{position:absolute;top:calc(-1 * var(--s-space-12));right:0;display:inline-flex;margin:0;padding:0;border:none;color:var(--s-icon-default);background-color:transparent;cursor:pointer}.text-input__clear-button.sc-swirl-text-input:focus:not(:focus-visible),.text-input__password-toggle.sc-swirl-text-input:focus:not(:focus-visible){outline:none}.text-input__clear-button.sc-swirl-text-input:focus-visible,.text-input__password-toggle.sc-swirl-text-input:focus-visible{outline-color:var(--s-focus-default)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.text-input__clear-button.sc-swirl-text-input,.text-input__password-toggle.sc-swirl-text-input{top:-0.625rem}}.text-input__stepper.sc-swirl-text-input{position:absolute;top:-1.4375rem;right:0;display:flex;flex-direction:column}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.text-input__stepper.sc-swirl-text-input{top:-1.25rem}}.text-input__step-button.sc-swirl-text-input{display:inline-flex;margin:0;padding:0;border:none;color:var(--s-icon-default);background-color:transparent;cursor:pointer}.text-input__step-button.sc-swirl-text-input:focus:not(:focus-visible){outline:none}.text-input__step-button.sc-swirl-text-input:focus-visible{outline-color:var(--s-focus-default)}.text-input__character-counter.sc-swirl-text-input{position:absolute;top:-1.375rem;right:0;display:flex;color:var(--s-text-subdued);line-height:var(--s-line-height-sm);flex-direction:column}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.text-input__character-counter.sc-swirl-text-input{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.text-input__prefix.sc-swirl-text-input{padding-right:var(--s-space-4);color:var(--s-text-subdued);font-size:var(--s-font-size-base)}.text-input__suffix.sc-swirl-text-input{padding-left:var(--s-space-4);color:var(--s-text-subdued);font-size:var(--s-font-size-base)}', b = class {
|
|
8
|
+
constructor(e) {
|
|
9
|
+
h(this, e), this.inputBlur = n(this, "inputBlur", 7), this.inputFocus = n(this, "inputFocus", 7), this.valueChange = n(this, "valueChange", 7), this.autoComplete = "on", this.clearButtonLabel = "Clear input", this.rows = 1, this.passwordToggleLabel = "Toggle password display", this.type = "text", this.iconSize = 24, this.showPassword = !1, this.desktopMediaQuery = x(), this.desktopMediaQueryHandler = (t) => {
|
|
10
|
+
this.updateIconSize(t.matches);
|
|
11
|
+
}, this.clear = () => {
|
|
12
|
+
this.inputEl.value = "", this.value = "", this.valueChange.emit(""), this.inputEl.focus();
|
|
13
|
+
}, this.onChange = (t) => {
|
|
14
|
+
const s = t.target;
|
|
15
|
+
this.value = s.value, this.valueChange.emit(s.value);
|
|
16
|
+
}, this.onBlur = (t) => {
|
|
17
|
+
this.inputBlur.emit(t);
|
|
18
|
+
}, this.onFocus = (t) => {
|
|
19
|
+
this.inputFocus.emit(t), this.handleAutoSelect(t);
|
|
20
|
+
}, this.onInput = (t) => {
|
|
21
|
+
this.onChange(t);
|
|
22
|
+
}, this.onKeyPress = (t) => {
|
|
23
|
+
this.type === "number" && ["+", "-", "e"].includes(t.key) && t.preventDefault();
|
|
24
|
+
}, this.decreaseValue = () => {
|
|
25
|
+
if (this.type !== "number")
|
|
26
|
+
return;
|
|
27
|
+
const t = this.step || 1;
|
|
28
|
+
let s = this.inputEl.valueAsNumber;
|
|
29
|
+
isNaN(this.inputEl.valueAsNumber) && (s = this.min !== void 0 ? this.min + 1 : 1), this.value = String(Math.max(this.min || -1 / 0, s - t)), this.valueChange.emit(this.value);
|
|
30
|
+
}, this.increaseValue = () => {
|
|
31
|
+
if (this.type !== "number")
|
|
32
|
+
return;
|
|
33
|
+
const t = this.step || 1;
|
|
34
|
+
let s = this.inputEl.valueAsNumber;
|
|
35
|
+
isNaN(this.inputEl.valueAsNumber) && (s = this.min !== void 0 ? this.min - 1 : -1), this.value = String(Math.min(this.max || 1 / 0, s + t)), this.valueChange.emit(this.value);
|
|
36
|
+
}, this.togglePassword = () => {
|
|
37
|
+
this.type === "password" && (this.showPassword = !this.showPassword);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
componentDidLoad() {
|
|
41
|
+
var e, t;
|
|
42
|
+
this.updateIconSize(this.desktopMediaQuery.matches), (t = (e = this.desktopMediaQuery).addEventListener) === null || t === void 0 || t.call(e, "change", this.desktopMediaQueryHandler);
|
|
43
|
+
}
|
|
44
|
+
componentDidRender() {
|
|
45
|
+
this.adjustInputSize();
|
|
46
|
+
}
|
|
47
|
+
disconnectedCallback() {
|
|
48
|
+
var e, t;
|
|
49
|
+
(t = (e = this.desktopMediaQuery).removeEventListener) === null || t === void 0 || t.call(e, "change", this.desktopMediaQueryHandler);
|
|
50
|
+
}
|
|
51
|
+
updateIconSize(e) {
|
|
52
|
+
this.iconSize = e ? 20 : 24;
|
|
53
|
+
}
|
|
54
|
+
adjustInputSize() {
|
|
55
|
+
this.rows > 1 && (this.inputEl.style.width = "", this.inputEl.style.height = "", this.inputEl.style.height = this.inputEl.scrollHeight / 16 + "rem"), this.rows === 1 && (this.inputEl.style.height = "", this.inputEl.style.width = "", this.type !== "password" && !this.disableDynamicWidth && (this.inputEl.style.width = this.inputEl.scrollWidth / 16 + "rem"));
|
|
56
|
+
}
|
|
57
|
+
handleAutoSelect(e) {
|
|
58
|
+
!this.autoSelect || e.target.select();
|
|
59
|
+
}
|
|
60
|
+
render() {
|
|
61
|
+
var e;
|
|
62
|
+
const t = this.rows === 1 ? "input" : "textarea", s = this.invalid === !0 || this.invalid === !1 ? String(this.invalid) : void 0, a = this.type === "number" && !this.disabled, r = this.type === "password" && !this.disabled, o = this.clearable && !this.disabled && Boolean(this.value) && !r && !a && !this.showCharacterCounter, l = this.type === "password" && this.showPassword ? "text" : this.type, u = c("text-input", `text-input--type-${this.type}`, {
|
|
63
|
+
"text-input--clearable": this.clearable,
|
|
64
|
+
"text-input--disabled": this.disabled,
|
|
65
|
+
"text-input--disable-dynamic-width": this.disableDynamicWidth,
|
|
66
|
+
"text-input--show-password": this.type === "password" && this.showPassword
|
|
67
|
+
});
|
|
68
|
+
return i(d, null, i("div", { class: u }, this.prefixLabel && i("span", { class: "text-input__prefix" }, this.prefixLabel), i(t, { "aria-autocomplete": this.swirlAriaAutocomplete, "aria-controls": this.swirlAriaControls, "aria-describedby": this.swirlAriaDescribedby, "aria-disabled": this.disabled ? "true" : void 0, "aria-expanded": this.swirlAriaExpanded, "aria-invalid": s, autoComplete: this.autoComplete, autoFocus: this.autoFocus, class: "text-input__input", disabled: this.disabled, inputMode: this.mode, maxLength: this.maxLength, max: this.type === "number" ? this.max : void 0, min: this.type === "number" ? this.min : void 0, onBlur: this.onBlur, onFocus: this.onFocus, onInput: this.onInput, onKeyPress: this.onKeyPress, ref: (p) => this.inputEl = p, required: this.required, role: this.swirlRole, rows: this.rows > 1 ? this.rows : void 0, spellcheck: this.spellCheck, step: this.type === "number" ? this.step : void 0, type: l, value: this.rows === 1 ? this.value : void 0 }, this.rows > 1 && this.value), this.suffixLabel && i("span", { class: "text-input__suffix" }, this.suffixLabel), o && i("button", { "aria-label": this.clearButtonLabel, class: "text-input__clear-button", onClick: this.clear, type: "button" }, i("swirl-icon-cancel", { size: this.iconSize })), r && i("button", { "aria-label": this.passwordToggleLabel, class: "text-input__password-toggle", onClick: this.togglePassword, type: "button" }, this.showPassword ? i("swirl-icon-visibility-off", { size: this.iconSize }) : i("swirl-icon-visibility", { size: this.iconSize })), a && i("span", { class: "text-input__stepper" }, i("button", { "aria-hidden": "true", class: "text-input__step-button", onClick: this.increaseValue, tabIndex: -1, type: "button" }, i("swirl-icon-expand-less", { size: this.iconSize })), i("button", { "aria-hidden": "true", class: "text-input__step-button", onClick: this.decreaseValue, tabIndex: -1, type: "button" }, i("swirl-icon-expand-more", { size: this.iconSize }))), this.showCharacterCounter && i("span", { class: "text-input__character-counter" }, ((e = this.value) === null || e === void 0 ? void 0 : e.length) || 0, " ", Boolean(this.maxLength) ? `/ ${this.maxLength}` : "")));
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
b.style = w;
|
|
72
|
+
export {
|
|
73
|
+
b as swirl_text_input
|
|
74
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { r as s, h as e, H as o } from "./index.9489626d.js";
|
|
2
|
+
import { c as n } from "./index-c3028f7d.557956d2.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import "react-dom";
|
|
5
|
+
import "./_commonjsHelpers-44457d8d.ba94af77.js";
|
|
6
|
+
const a = ":host{display:block;max-width:100%}:host *{box-sizing:border-box}.text{margin:0;padding:0}.text--align-start{text-align:start}.text--align-center{text-align:center}.text--align-end{text-align:end}.text--color-default{color:var(--s-text-default)}.text--color-subdued{color:var(--s-text-subdued)}.text--color-critical{color:var(--s-text-critical)}.text--color-success{color:var(--s-text-success)}.text--color-warning{color:var(--s-text-warning)}.text--size-sm{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}.text--size-base{font-size:var(--s-font-size-base);line-height:var(--s-line-height-base)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.text--size-base{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.text--size-lg{font-size:var(--s-font-size-lg);line-height:var(--s-line-height-lg)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.text--size-lg{font-size:var(--s-font-size-base);line-height:var(--s-line-height-base)}}.text--weight-normal{font-weight:var(--s-font-weight-normal)}.text--weight-medium{font-weight:var(--s-font-weight-medium)}.text--weight-semibold{font-weight:var(--s-font-weight-semibold)}.text--weight-bold{font-weight:var(--s-font-weight-bold)}.text--font-style-normal{font-style:normal}.text--font-style-italic{font-style:italic}.text--truncate{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}", r = class {
|
|
7
|
+
constructor(t) {
|
|
8
|
+
s(this, t), this.align = "start", this.as = "p", this.color = "default", this.fontStyle = "normal", this.size = "base", this.weight = "normal";
|
|
9
|
+
}
|
|
10
|
+
render() {
|
|
11
|
+
const t = this.as, i = n("text", `text--align-${this.align}`, `text--color-${this.color}`, `text--font-style-${this.fontStyle}`, `text--size-${this.size}`, `text--weight-${this.weight}`, { "text--truncate": this.truncate });
|
|
12
|
+
return e(o, null, e(t, { class: i, part: i }, e("slot", null)));
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
r.style = a;
|
|
16
|
+
export {
|
|
17
|
+
r as swirl_text
|
|
18
|
+
};
|
package/dist/{flip-theme-provider.entry.22f08b73.js → swirl-theme-provider.entry.5bf11693.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as j, c as E, h as w, H } from "./index.
|
|
1
|
+
import { r as j, c as E, h as w, H } from "./index.9489626d.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "react-dom";
|
|
4
4
|
function d(e, t, o) {
|
|
@@ -9,10 +9,10 @@ class P extends Error {
|
|
|
9
9
|
super(`Failed to parse color: "${t}"`);
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
var
|
|
12
|
+
var f = P;
|
|
13
13
|
function C(e) {
|
|
14
14
|
if (typeof e != "string")
|
|
15
|
-
throw new
|
|
15
|
+
throw new f(e);
|
|
16
16
|
if (e.trim().toLowerCase() === "transparent")
|
|
17
17
|
return [0, 0, 0, 0];
|
|
18
18
|
let t = e.trim();
|
|
@@ -36,12 +36,12 @@ function C(e) {
|
|
|
36
36
|
if (s) {
|
|
37
37
|
const [a, i, h, c] = Array.from(s).slice(1).map(parseFloat);
|
|
38
38
|
if (d(0, 100, i) !== i)
|
|
39
|
-
throw new
|
|
39
|
+
throw new f(e);
|
|
40
40
|
if (d(0, 100, h) !== h)
|
|
41
|
-
throw new
|
|
41
|
+
throw new f(e);
|
|
42
42
|
return [...L(a, i, h), c || 1];
|
|
43
43
|
}
|
|
44
|
-
throw new
|
|
44
|
+
throw new f(e);
|
|
45
45
|
}
|
|
46
46
|
function $(e) {
|
|
47
47
|
let t = 5381, o = e.length;
|
|
@@ -59,7 +59,7 @@ const b = (e) => parseInt(e.replace(/_/g, ""), 36), q = "1q29ehhb 1n09sgk7 1kl1e
|
|
|
59
59
|
function M(e) {
|
|
60
60
|
const t = e.toLowerCase().trim(), o = q[$(t)];
|
|
61
61
|
if (!o)
|
|
62
|
-
throw new
|
|
62
|
+
throw new f(e);
|
|
63
63
|
return `#${o}`;
|
|
64
64
|
}
|
|
65
65
|
const u = (e, t) => Array.from(Array(t)).map(() => e).join(""), A = new RegExp(`^#${u("([a-f0-9])", 3)}([a-f0-9])?$`, "i"), F = new RegExp(`^#${u("([a-f0-9]{2})", 3)}([a-f0-9]{2})?$`, "i"), R = new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${u(",\\s*(\\d+)\\s*", 2)}(?:,\\s*([\\d.]+))?\\s*\\)$`, "i"), I = /^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i, O = /^[a-z]+$/i, z = (e) => Math.round(e * 255), L = (e, t, o) => {
|
|
@@ -69,11 +69,11 @@ const u = (e, t) => Array.from(Array(t)).map(() => e).join(""), A = new RegExp(`
|
|
|
69
69
|
const r = (e % 360 + 360) % 360 / 60, s = (1 - Math.abs(2 * n - 1)) * (t / 100), a = s * (1 - Math.abs(r % 2 - 1));
|
|
70
70
|
let i = 0, h = 0, c = 0;
|
|
71
71
|
r >= 0 && r < 1 ? (i = s, h = a) : r >= 1 && r < 2 ? (i = a, h = s) : r >= 2 && r < 3 ? (h = s, c = a) : r >= 3 && r < 4 ? (h = a, c = s) : r >= 4 && r < 5 ? (i = a, c = s) : r >= 5 && r < 6 && (i = s, c = a);
|
|
72
|
-
const l = n - s / 2, m = i + l,
|
|
73
|
-
return [m,
|
|
72
|
+
const l = n - s / 2, m = i + l, p = h + l, v = c + l;
|
|
73
|
+
return [m, p, v].map(z);
|
|
74
74
|
};
|
|
75
75
|
function y(e) {
|
|
76
|
-
const [t, o, n, r] = C(e).map((m,
|
|
76
|
+
const [t, o, n, r] = C(e).map((m, p) => p === 3 ? m : m / 255), s = Math.max(t, o, n), a = Math.min(t, o, n), i = (s + a) / 2;
|
|
77
77
|
if (s === a)
|
|
78
78
|
return [0, 0, i, r];
|
|
79
79
|
const h = s - a, c = i > 0.5 ? h / (2 - s - a) : h / (s + a);
|
|
@@ -82,13 +82,13 @@ function y(e) {
|
|
|
82
82
|
function g(e, t, o, n) {
|
|
83
83
|
return `hsla(${(e % 360).toFixed()}, ${d(0, 100, t * 100).toFixed()}%, ${d(0, 100, o * 100).toFixed()}%, ${parseFloat(d(0, 1, n).toFixed(3))})`;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function S(e, t, o, n) {
|
|
86
86
|
return `rgba(${d(0, 255, e).toFixed()}, ${d(0, 255, t).toFixed()}, ${d(0, 255, o).toFixed()}, ${parseFloat(d(0, 1, n).toFixed(3))})`;
|
|
87
87
|
}
|
|
88
|
-
function
|
|
89
|
-
return
|
|
88
|
+
function _(e) {
|
|
89
|
+
return S(...C(e));
|
|
90
90
|
}
|
|
91
|
-
const
|
|
91
|
+
const B = ".sc-swirl-theme-provider-h{display:block}", x = "swirl-preferred-theme", T = {
|
|
92
92
|
"--s-action-primary-default": "primary",
|
|
93
93
|
"--s-action-primary-hovered": "primaryHovered",
|
|
94
94
|
"--s-action-primary-pressed": "primaryPressed",
|
|
@@ -156,8 +156,8 @@ const S = ".sc-flip-theme-provider-h{display:block}", x = "flip-preferred-theme"
|
|
|
156
156
|
this.resetTenantVariables();
|
|
157
157
|
return;
|
|
158
158
|
}
|
|
159
|
-
const o = this.resolvedConfig.rootElement, n = y(t.primary), r = y(t.secondary), s = y(t.text), a =
|
|
160
|
-
Object.entries(T).forEach(([v, k]) => o.style.setProperty(v,
|
|
159
|
+
const o = this.resolvedConfig.rootElement, n = y(t.primary), r = y(t.secondary), s = y(t.text), a = _(g(n[0], n[1] - 0.21, n[2] + 0.09, 1)), i = _(g(n[0], n[1] - 0.2, n[2] + 0.17, 1)), h = _(g(r[0], r[1], r[2] + 0.07, 1)), c = _(g(r[0], r[1], r[2] + 0.15, 1)), l = _(g(s[0], s[1] - 0.34, s[2] + 0.1, 1)), m = _(g(s[0], s[1] - 0.48, s[2] + 0.2, 1)), p = Object.assign(Object.assign({}, t), { primaryHovered: a, primaryPressed: i, secondaryHovered: h, secondaryPressed: c, textHovered: l, textPressed: m });
|
|
160
|
+
Object.entries(T).forEach(([v, k]) => o.style.setProperty(v, p[k]));
|
|
161
161
|
}
|
|
162
162
|
resetTenantVariables() {
|
|
163
163
|
const e = this.resolvedConfig.rootElement;
|
|
@@ -180,7 +180,7 @@ const S = ".sc-flip-theme-provider-h{display:block}", x = "flip-preferred-theme"
|
|
|
180
180
|
};
|
|
181
181
|
}
|
|
182
182
|
};
|
|
183
|
-
D.style =
|
|
183
|
+
D.style = B;
|
|
184
184
|
export {
|
|
185
|
-
D as
|
|
185
|
+
D as swirl_theme_provider
|
|
186
186
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { r as t, h as a, H as s } from "./index.9489626d.js";
|
|
2
|
+
import { c as r } from "./index-c3028f7d.557956d2.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import "react-dom";
|
|
5
|
+
import "./_commonjsHelpers-44457d8d.ba94af77.js";
|
|
6
|
+
const l = ":host{display:inline-flex}:host *{box-sizing:border-box}.thumbnail{position:relative;display:inline-flex;overflow:hidden;border-radius:var(--s-border-radius-s);box-shadow:inset 0 0 0 0.03125rem rgba(0, 0, 0, 0.1)}.thumbnail--size-s{--swirl-thumbnail-size:2.5rem}.thumbnail--size-m{--swirl-thumbnail-size:3rem}.thumbnail--size-l{--swirl-thumbnail-size:4rem}.thumbnail--format-landscape{width:var(--swirl-thumbnail-size);aspect-ratio:4 / 3}.thumbnail--format-landscape .thumbnail__image{width:100%}.thumbnail--format-portrait{height:var(--swirl-thumbnail-size);aspect-ratio:3 / 4}.thumbnail--format-portrait .thumbnail__image{height:100%}.thumbnail--format-square{width:var(--swirl-thumbnail-size);height:var(--swirl-thumbnail-size)}.thumbnail--format-square .thumbnail__image{width:100%}.thumbnail__image{position:absolute;top:50%;left:50%;transform:translate3d(-50%, -50%, 0)}", m = class {
|
|
7
|
+
constructor(i) {
|
|
8
|
+
t(this, i), this.format = "landscape", this.size = "m";
|
|
9
|
+
}
|
|
10
|
+
render() {
|
|
11
|
+
const i = r("thumbnail", `thumbnail--format-${this.format}`, `thumbnail--size-${this.size}`);
|
|
12
|
+
return a(s, null, a("span", { class: i }, a("img", { alt: this.alt, class: "thumbnail__image", loading: "lazy", src: this.src })));
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
m.style = l;
|
|
16
|
+
export {
|
|
17
|
+
m as swirl_thumbnail
|
|
18
|
+
};
|
package/dist/{flip-toast-provider.entry.dd3a0d33.js → swirl-toast-provider.entry.da18eaab.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r, h as a, H as e } from "./index.
|
|
1
|
+
import { r, h as a, H as e } from "./index.9489626d.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "react-dom";
|
|
4
4
|
const l = class {
|
|
@@ -22,9 +22,9 @@ const l = class {
|
|
|
22
22
|
return this.toasts = [...this.toasts, i], i;
|
|
23
23
|
}
|
|
24
24
|
render() {
|
|
25
|
-
return a(e, { role: "status" }, a("
|
|
25
|
+
return a(e, { role: "status" }, a("swirl-stack", { spacing: "12" }, this.toasts.map((t) => a("swirl-toast", Object.assign({ key: t.toastId, onDismiss: this.onDismiss }, t)))));
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
export {
|
|
29
|
-
l as
|
|
29
|
+
l as swirl_toast_provider
|
|
30
30
|
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { r as a, c as n, h as i, H as r } from "./index.9489626d.js";
|
|
2
|
+
import { c } from "./index-c3028f7d.557956d2.js";
|
|
3
|
+
import { g as d } from "./utils-7efaa1c6.4a9c3721.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "react-dom";
|
|
6
|
+
import "./_commonjsHelpers-44457d8d.ba94af77.js";
|
|
7
|
+
const l = ":host{display:flex}:host *{box-sizing:border-box}.toast{display:flex;width:100%;max-width:28rem;padding:var(--s-space-16);border-radius:var(--s-border-radius-sm);color:var(--s-text-on-status);background-color:var(--s-surface-neutral-default);box-shadow:var(--s-shadow-level-2)}.toast--intent-critical{background-color:var(--s-surface-critical-default)}.toast--intent-success{background-color:var(--s-surface-success-default)}.toast__icon{display:inline-flex;margin-top:calc(-1 * var(--s-space-2));margin-right:0.625rem;flex-shrink:0}.toast__icon ::part(icon){color:var(--s-icon-on-status)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.toast__icon{margin-top:0}}.toast__content{flex-grow:1;line-height:var(--s-line-height-base);text-align:left;align-self:flex-start}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.toast__content{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.toast__dismiss-button{display:inline-flex;min-width:1.5rem;height:1.5rem;margin-top:calc(-1 * var(--s-space-2));margin-left:var(--s-space-16);padding:0;flex-shrink:0;justify-content:center;align-items:center;border:none;color:var(--s-text-on-status);background-color:transparent;font:inherit;font-weight:var(--s-font-weight-semibold);cursor:pointer}.toast__dismiss-button ::part(icon){color:var(--s-icon-on-status)}", h = class {
|
|
8
|
+
constructor(s) {
|
|
9
|
+
a(this, s), this.dismiss = n(this, "dismiss", 7), this.accessibleDismissLabel = "Dismiss", this.intent = "default", this.desktopMediaQuery = d(), this.desktopMediaQueryHandler = (t) => {
|
|
10
|
+
this.forceIconProps(t.matches);
|
|
11
|
+
}, this.onDismiss = () => {
|
|
12
|
+
this.dismiss.emit(this.toastId);
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
watchDuration() {
|
|
16
|
+
this.startTimer();
|
|
17
|
+
}
|
|
18
|
+
componentDidLoad() {
|
|
19
|
+
var s, t;
|
|
20
|
+
this.startTimer(), this.forceIconProps(this.desktopMediaQuery.matches), (t = (s = this.desktopMediaQuery).addEventListener) === null || t === void 0 || t.call(s, "change", this.desktopMediaQueryHandler);
|
|
21
|
+
}
|
|
22
|
+
disconnectedCallback() {
|
|
23
|
+
var s, t;
|
|
24
|
+
(t = (s = this.desktopMediaQuery).removeEventListener) === null || t === void 0 || t.call(s, "change", this.desktopMediaQueryHandler);
|
|
25
|
+
}
|
|
26
|
+
forceIconProps(s) {
|
|
27
|
+
var t;
|
|
28
|
+
const e = (t = this.iconEl) === null || t === void 0 ? void 0 : t.children[0], o = this.dismissIconEl;
|
|
29
|
+
e == null || e.setAttribute("size", s ? "20" : "24"), o == null || o.setAttribute("size", s ? "20" : "24");
|
|
30
|
+
}
|
|
31
|
+
startTimer() {
|
|
32
|
+
this.clearTimer(), this.duration !== void 0 && (this.timeout = setTimeout(() => {
|
|
33
|
+
this.dismiss.emit(this.toastId);
|
|
34
|
+
}, this.duration));
|
|
35
|
+
}
|
|
36
|
+
clearTimer() {
|
|
37
|
+
!Boolean(this.timeout) || (clearTimeout(this.timeout), this.timeout = void 0);
|
|
38
|
+
}
|
|
39
|
+
render() {
|
|
40
|
+
const s = c("toast", `toast--intent-${this.intent}`);
|
|
41
|
+
return i(r, null, i("div", { class: s }, this.icon && i("span", { class: "toast__icon", innerHTML: this.icon, part: "toast__icon", ref: (t) => this.iconEl = t }), i("span", { class: "toast__content", part: "toast__content" }, this.content), i("button", { "aria-label": this.dismissLabel || this.accessibleDismissLabel, class: "toast__dismiss-button", onClick: this.onDismiss, type: "button" }, this.dismissLabel, !Boolean(this.dismissLabel) && i("swirl-icon-close", { ref: (t) => this.dismissIconEl = t }))));
|
|
42
|
+
}
|
|
43
|
+
static get watchers() {
|
|
44
|
+
return {
|
|
45
|
+
duration: ["watchDuration"]
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
h.style = l;
|
|
50
|
+
export {
|
|
51
|
+
h as swirl_toast
|
|
52
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r as n, h as
|
|
1
|
+
import { r as n, h as i, H as l } from "./index.9489626d.js";
|
|
2
2
|
import { c as r, o as p, s as h, f as d } from "./floating-ui.dom.esm-1a4e8b8a.87557233.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "react-dom";
|
|
5
|
-
const c = ":host{display:inline-flex}:host *{box-sizing:border-box}.tooltip{display:inline-flex}.tooltip .tooltip__reference{display:inline-flex}.tooltip__popper{position:fixed;z-index:var(--s-z-40);max-width:17.5rem}.tooltip__bubble{position:relative;display:block;padding-top:var(--s-space-8);padding-right:var(--s-space-12);padding-bottom:var(--s-space-8);padding-left:var(--s-space-12);border-radius:var(--s-border-radius-sm);color:var(--s-text-on-status);background-color:var(--s-surface-neutral-default);line-height:var(--s-line-height-base);-webkit-animation:tooltip-fade-in 0.1s;animation:tooltip-fade-in 0.1s}.tooltip__arrow{position:absolute;width:0.5rem;height:0.5rem;background-color:var(--s-surface-neutral-default)}@-webkit-keyframes tooltip-fade-in{from{opacity:0}to{opacity:1}}@keyframes tooltip-fade-in{from{opacity:0}to{opacity:1}}", u = class {
|
|
5
|
+
const c = ":host{display:inline-flex}:host *{box-sizing:border-box}.tooltip{display:inline-flex}.tooltip .tooltip__reference{display:inline-flex}.tooltip__popper{position:fixed;z-index:var(--s-z-40);max-width:17.5rem}.tooltip__bubble{position:relative;display:block;padding-top:var(--s-space-8);padding-right:var(--s-space-12);padding-bottom:var(--s-space-8);padding-left:var(--s-space-12);border-radius:var(--s-border-radius-sm);color:var(--s-text-on-status);background-color:var(--s-surface-neutral-default);line-height:var(--s-line-height-base);-webkit-animation:tooltip-fade-in 0.1s;animation:tooltip-fade-in 0.1s}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.tooltip__bubble{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.tooltip__arrow{position:absolute;width:0.5rem;height:0.5rem;background-color:var(--s-surface-neutral-default)}@-webkit-keyframes tooltip-fade-in{from{opacity:0}to{opacity:1}}@keyframes tooltip-fade-in{from{opacity:0}to{opacity:1}}", u = class {
|
|
6
6
|
constructor(e) {
|
|
7
7
|
n(this, e), this.delay = 300, this.position = "top", this.visible = !1, this.onKeydown = (t) => {
|
|
8
8
|
t.code === "Escape" && this.hide();
|
|
@@ -26,7 +26,7 @@ const c = ":host{display:inline-flex}:host *{box-sizing:border-box}.tooltip{disp
|
|
|
26
26
|
strategy: "fixed"
|
|
27
27
|
};
|
|
28
28
|
}, this.getArrowStyles = () => {
|
|
29
|
-
var t, s,
|
|
29
|
+
var t, s, o, a;
|
|
30
30
|
if (((t = this.actualPosition) === null || t === void 0 ? void 0 : t.placement) === "top")
|
|
31
31
|
return {
|
|
32
32
|
top: "100%",
|
|
@@ -39,7 +39,7 @@ const c = ":host{display:inline-flex}:host *{box-sizing:border-box}.tooltip{disp
|
|
|
39
39
|
left: "50%",
|
|
40
40
|
transform: "translate3d(-50%, 50%, 0) rotate(45deg)"
|
|
41
41
|
};
|
|
42
|
-
if (((
|
|
42
|
+
if (((o = this.actualPosition) === null || o === void 0 ? void 0 : o.placement) === "right")
|
|
43
43
|
return {
|
|
44
44
|
top: "50%",
|
|
45
45
|
right: "100%",
|
|
@@ -77,10 +77,10 @@ const c = ":host{display:inline-flex}:host *{box-sizing:border-box}.tooltip{disp
|
|
|
77
77
|
render() {
|
|
78
78
|
var e, t;
|
|
79
79
|
const s = this.getArrowStyles();
|
|
80
|
-
return
|
|
80
|
+
return i(l, { onKeydown: this.onKeydown }, i("span", { class: "tooltip" }, i("span", { class: "tooltip__reference", "aria-describedby": "tooltip", onBlur: this.hide, onClick: this.hide, onFocus: this.show, ref: (o) => this.referenceEl = o, tabIndex: 0 }, i("slot", null)), i("span", { class: "tooltip__popper", ref: (o) => this.popperEl = o, style: {
|
|
81
81
|
top: Boolean(this.actualPosition) ? `${(e = this.actualPosition) === null || e === void 0 ? void 0 : e.y}px` : "",
|
|
82
82
|
left: Boolean(this.actualPosition) ? `${(t = this.actualPosition) === null || t === void 0 ? void 0 : t.x}px` : ""
|
|
83
|
-
} }, this.visible &&
|
|
83
|
+
} }, this.visible && i("span", { class: "tooltip__bubble", id: "tooltip", part: "tooltip__bubble", role: "tooltip" }, i("span", { class: "tooltip__content", innerHTML: this.content }), i("span", { class: "tooltip__arrow", style: s })))));
|
|
84
84
|
}
|
|
85
85
|
static get watchers() {
|
|
86
86
|
return {
|
|
@@ -90,5 +90,5 @@ const c = ":host{display:inline-flex}:host *{box-sizing:border-box}.tooltip{disp
|
|
|
90
90
|
};
|
|
91
91
|
u.style = c;
|
|
92
92
|
export {
|
|
93
|
-
u as
|
|
93
|
+
u as swirl_tooltip
|
|
94
94
|
};
|