@swan-io/lake 5.1.0 → 6.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swan-io/lake",
3
- "version": "5.1.0",
3
+ "version": "6.0.0",
4
4
  "engines": {
5
5
  "node": ">=18.0.0",
6
6
  "yarn": "^1.22.0"
@@ -164,6 +164,8 @@ declare const paths: {
164
164
  "paint-brush-regular": string;
165
165
  "panel-left-filled": string;
166
166
  "panel-left-regular": string;
167
+ "panel-left-contract-filled": string;
168
+ "panel-left-contract-regular": string;
167
169
  "panel-left-expand-filled": string;
168
170
  "panel-left-expand-regular": string;
169
171
  "pause-regular": string;
@@ -229,7 +229,7 @@ export declare const LakeTextInput: import("react").ForwardRefExoticComponent<{
229
229
  disabled?: boolean | undefined;
230
230
  color?: "gray" | "live" | "sandbox" | "positive" | "warning" | "negative" | "current" | "partner" | "swan" | "shakespear" | "darkPink" | "sunglow" | "mediumSladeBlue" | undefined;
231
231
  multiline?: boolean | undefined;
232
- icon?: "lake-building-bank" | "lake-calendar-arrow-swap" | "lake-call" | "lake-card" | "lake-card-add" | "lake-card-filled" | "lake-card-one-off" | "lake-card-physical" | "lake-card-recurring" | "lake-card-single-use" | "lake-card-virtual" | "lake-check" | "lake-chevron-double" | "lake-clipboard-bullet" | "lake-clock" | "lake-clock-arrow-swap" | "lake-close" | "lake-compass" | "lake-currencies" | "lake-delivery-grouped" | "lake-delivery-individual" | "lake-denied" | "lake-document-csv" | "lake-document-jpg" | "lake-document-pdf" | "lake-document-png" | "lake-document-xls" | "lake-email" | "lake-eraser" | "lake-error" | "lake-face-id" | "lake-fingerprint" | "lake-id-card" | "lake-inbox-empty" | "lake-key" | "lake-lock-closed" | "lake-menu" | "lake-people" | "lake-person-arrow-swap" | "lake-person-support" | "lake-phone" | "lake-receipt" | "lake-settings" | "lake-shield" | "lake-signature" | "lake-transfer" | "lake-warning" | "lake-world-map" | "add-circle-filled" | "add-circle-regular" | "add-filled" | "approvals-app-filled" | "apps-list-filled" | "apps-list-regular" | "arrow-counterclockwise-filled" | "arrow-clockwise-filled" | "arrow-down-filled" | "arrow-down-regular" | "arrow-download-filled" | "arrow-left-filled" | "arrow-left-regular" | "arrow-right-filled" | "arrow-right-regular" | "arrow-swap-filled" | "arrow-swap-regular" | "arrow-up-filled" | "arrow-up-regular" | "arrow-upload-filled" | "arrow-upload-regular" | "beaker-filled" | "beaker-regular" | "board-filled" | "board-regular" | "box-regular" | "building-bank-filled" | "building-bank-regular" | "building-filled" | "building-multiple-regular" | "building-regular" | "building-shop-regular" | "calendar-ltr-regular" | "cart-regular" | "chat-help-filled" | "chat-help-regular" | "check-filled" | "check-regular" | "checkmark-circle-regular" | "checkmark-filled" | "checkmark-starburst-regular" | "checkmark-starburst-filled" | "chevron-down-filled" | "chevron-left-filled" | "chevron-right-filled" | "chevron-up-down-regular" | "chevron-up-filled" | "clipboard-search-regular" | "clock-filled" | "clock-regular" | "cloud-sync-filled" | "cloud-sync-regular" | "code-filled" | "code-regular" | "color-regular" | "comment-note-regular" | "copy-filled" | "copy-regular" | "cursor-click-regular" | "database-filled" | "database-regular" | "delete-filled" | "delete-regular" | "desktop-regular" | "device-meeting-room-regular" | "dismiss-circle-regular" | "dismiss-filled" | "dismiss-regular" | "document-regular" | "earth-regular" | "edit-filled" | "edit-regular" | "error-circle-filled" | "error-circle-regular" | "eye-filled" | "eye-off-filled" | "eye-regular" | "eye-off-regular" | "filter-filled" | "flag-filled" | "flag-regular" | "flash-filled" | "flash-regular" | "form-new-filled" | "form-new-regular" | "hand-right-regular" | "image-add-filled" | "image-add-regular" | "image-filled" | "image-regular" | "info-filled" | "info-regular" | "key-regular" | "link-filled" | "live-filled" | "live-regular" | "lock-closed-filled" | "lock-closed-regular" | "lock-open-filled" | "lock-open-regular" | "mail-filled" | "mail-regular" | "money-calculator-regular" | "money-calculator-filled" | "money-regular" | "money-filled" | "more-horizontal-filled" | "more-vertical-filled" | "open-filled" | "open-regular" | "options-regular" | "paint-brush-filled" | "paint-brush-regular" | "panel-left-filled" | "panel-left-regular" | "panel-left-expand-filled" | "panel-left-expand-regular" | "pause-regular" | "payment-filled" | "payment-regular" | "people-add-regular" | "people-community-filled" | "people-community-regular" | "people-filled" | "people-regular" | "people-team-regular" | "person-accounts-filled" | "person-accounts-regular" | "person-add-regular" | "person-call-filled" | "person-call-regular" | "person-filled" | "person-lock-regular" | "person-regular" | "phone-filled" | "phone-regular" | "pin-regular" | "play-filled" | "play-regular" | "preview-link-filled" | "qr-code-regular" | "question-circle-regular" | "receipt-money-filled" | "receipt-money-regular" | "rocket-regular" | "search-filled" | "send-filled" | "send-regular" | "settings-filled" | "settings-regular" | "shield-checkmark-filled" | "shield-checkmark-regular" | "shield-error-regular" | "shield-regular" | "sign-out-regular" | "signature-filled" | "signature-regular" | "subtract-circle-filled" | "subtract-circle-regular" | "target-arrow-regular" | "task-list-square-ltr-filled" | "task-list-square-ltr-regular" | "warning-filled" | "warning-regular" | "window-dev-tools-filled" | "window-dev-tools-regular" | undefined;
232
+ icon?: "lake-building-bank" | "lake-calendar-arrow-swap" | "lake-call" | "lake-card" | "lake-card-add" | "lake-card-filled" | "lake-card-one-off" | "lake-card-physical" | "lake-card-recurring" | "lake-card-single-use" | "lake-card-virtual" | "lake-check" | "lake-chevron-double" | "lake-clipboard-bullet" | "lake-clock" | "lake-clock-arrow-swap" | "lake-close" | "lake-compass" | "lake-currencies" | "lake-delivery-grouped" | "lake-delivery-individual" | "lake-denied" | "lake-document-csv" | "lake-document-jpg" | "lake-document-pdf" | "lake-document-png" | "lake-document-xls" | "lake-email" | "lake-eraser" | "lake-error" | "lake-face-id" | "lake-fingerprint" | "lake-id-card" | "lake-inbox-empty" | "lake-key" | "lake-lock-closed" | "lake-menu" | "lake-people" | "lake-person-arrow-swap" | "lake-person-support" | "lake-phone" | "lake-receipt" | "lake-settings" | "lake-shield" | "lake-signature" | "lake-transfer" | "lake-warning" | "lake-world-map" | "add-circle-filled" | "add-circle-regular" | "add-filled" | "approvals-app-filled" | "apps-list-filled" | "apps-list-regular" | "arrow-counterclockwise-filled" | "arrow-clockwise-filled" | "arrow-down-filled" | "arrow-down-regular" | "arrow-download-filled" | "arrow-left-filled" | "arrow-left-regular" | "arrow-right-filled" | "arrow-right-regular" | "arrow-swap-filled" | "arrow-swap-regular" | "arrow-up-filled" | "arrow-up-regular" | "arrow-upload-filled" | "arrow-upload-regular" | "beaker-filled" | "beaker-regular" | "board-filled" | "board-regular" | "box-regular" | "building-bank-filled" | "building-bank-regular" | "building-filled" | "building-multiple-regular" | "building-regular" | "building-shop-regular" | "calendar-ltr-regular" | "cart-regular" | "chat-help-filled" | "chat-help-regular" | "check-filled" | "check-regular" | "checkmark-circle-regular" | "checkmark-filled" | "checkmark-starburst-regular" | "checkmark-starburst-filled" | "chevron-down-filled" | "chevron-left-filled" | "chevron-right-filled" | "chevron-up-down-regular" | "chevron-up-filled" | "clipboard-search-regular" | "clock-filled" | "clock-regular" | "cloud-sync-filled" | "cloud-sync-regular" | "code-filled" | "code-regular" | "color-regular" | "comment-note-regular" | "copy-filled" | "copy-regular" | "cursor-click-regular" | "database-filled" | "database-regular" | "delete-filled" | "delete-regular" | "desktop-regular" | "device-meeting-room-regular" | "dismiss-circle-regular" | "dismiss-filled" | "dismiss-regular" | "document-regular" | "earth-regular" | "edit-filled" | "edit-regular" | "error-circle-filled" | "error-circle-regular" | "eye-filled" | "eye-off-filled" | "eye-regular" | "eye-off-regular" | "filter-filled" | "flag-filled" | "flag-regular" | "flash-filled" | "flash-regular" | "form-new-filled" | "form-new-regular" | "hand-right-regular" | "image-add-filled" | "image-add-regular" | "image-filled" | "image-regular" | "info-filled" | "info-regular" | "key-regular" | "link-filled" | "live-filled" | "live-regular" | "lock-closed-filled" | "lock-closed-regular" | "lock-open-filled" | "lock-open-regular" | "mail-filled" | "mail-regular" | "money-calculator-regular" | "money-calculator-filled" | "money-regular" | "money-filled" | "more-horizontal-filled" | "more-vertical-filled" | "open-filled" | "open-regular" | "options-regular" | "paint-brush-filled" | "paint-brush-regular" | "panel-left-filled" | "panel-left-regular" | "panel-left-contract-filled" | "panel-left-contract-regular" | "panel-left-expand-filled" | "panel-left-expand-regular" | "pause-regular" | "payment-filled" | "payment-regular" | "people-add-regular" | "people-community-filled" | "people-community-regular" | "people-filled" | "people-regular" | "people-team-regular" | "person-accounts-filled" | "person-accounts-regular" | "person-add-regular" | "person-call-filled" | "person-call-regular" | "person-filled" | "person-lock-regular" | "person-regular" | "phone-filled" | "phone-regular" | "pin-regular" | "play-filled" | "play-regular" | "preview-link-filled" | "qr-code-regular" | "question-circle-regular" | "receipt-money-filled" | "receipt-money-regular" | "rocket-regular" | "search-filled" | "send-filled" | "send-regular" | "settings-filled" | "settings-regular" | "shield-checkmark-filled" | "shield-checkmark-regular" | "shield-error-regular" | "shield-regular" | "sign-out-regular" | "signature-filled" | "signature-regular" | "subtract-circle-filled" | "subtract-circle-regular" | "target-arrow-regular" | "task-list-square-ltr-filled" | "task-list-square-ltr-regular" | "warning-filled" | "warning-regular" | "window-dev-tools-filled" | "window-dev-tools-regular" | undefined;
233
233
  unit?: string | undefined;
234
234
  units?: string[] | undefined;
235
235
  inputMode?: TextInputProps["inputMode"];
@@ -78,16 +78,17 @@ export const Popover = memo(({ children, id, label, role = "dialog", describedBy
78
78
  const rect = element.getBoundingClientRect();
79
79
  const availableSpaceAbove = rect.top;
80
80
  const availableSpaceBelow = window.innerHeight - rect.bottom;
81
- const visualViewportOffsetTop = (_b = (_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.offsetTop) !== null && _b !== void 0 ? _b : 0;
81
+ const visualViewportOffsetTop = (_a = window.scrollY) !== null && _a !== void 0 ? _a : 0;
82
+ const visualViewportOffsetLeft = (_b = window.scrollX) !== null && _b !== void 0 ? _b : 0;
82
83
  setViewportInformation({
83
84
  availableSpaceAbove,
84
85
  availableSpaceBelow,
85
86
  availableSpaceBefore: rect.left,
86
87
  availableSpaceAfter: window.innerWidth - rect.right,
87
88
  top: visualViewportOffsetTop + Math.max(rect.bottom, safetyMargin),
88
- bottom: Math.max(window.innerHeight - rect.top, safetyMargin),
89
- left: Math.max(rect.left, safetyMargin),
90
- right: Math.max(window.innerWidth - rect.right, safetyMargin),
89
+ bottom: Math.max(window.innerHeight - rect.top, safetyMargin) - visualViewportOffsetTop,
90
+ left: visualViewportOffsetLeft + Math.max(rect.left, safetyMargin),
91
+ right: Math.max(window.innerWidth - rect.right, safetyMargin) - visualViewportOffsetLeft,
91
92
  availableHeight: field || availableSpaceAbove <= availableSpaceBelow
92
93
  ? window.innerHeight - rect.top - (rect.bottom - rect.top) - 20
93
94
  : availableSpaceAbove - 20,
@@ -136,7 +137,7 @@ export const Popover = memo(({ children, id, label, role = "dialog", describedBy
136
137
  if (mode === "BottomPanel") {
137
138
  return (_jsx(BottomPanel, { visible: visible, onPressClose: onDismiss, returnFocus: false, children: typeof children == "function" ? children({ mode: "panel" }) : children }));
138
139
  }
139
- return (_jsx(Portal, { container: rootElement, children: _jsx(TransitionView, { style: styles.container, ...animation, children: visible ? (_jsxs(View, { style: styles.contents, children: [underlay ? (_jsx(Pressable, { ref: underlayRef, style: styles.underlay, onPress: onPressUnderlay, "aria-label": "Close" })) : null, availableHeight > 0 ? (_jsx(ScrollView, { style: [
140
+ return (_jsxs(Portal, { container: rootElement, children: [visible && underlay ? (_jsx(Pressable, { ref: underlayRef, style: styles.underlay, onPress: onPressUnderlay, "aria-label": "Close" })) : null, _jsx(TransitionView, { style: styles.container, ...animation, children: visible ? (_jsx(View, { style: styles.contents, children: availableHeight > 0 ? (_jsx(ScrollView, { style: [
140
141
  styles.popover,
141
142
  (field || availableSpaceAbove <= availableSpaceBelow) && { top },
142
143
  !field && availableSpaceAbove > availableSpaceBelow && { bottom },
@@ -150,5 +151,5 @@ export const Popover = memo(({ children, id, label, role = "dialog", describedBy
150
151
  {
151
152
  justifyContent: !field && availableSpaceAbove > availableSpaceBelow ? FLEX_END : FLEX_START,
152
153
  },
153
- ], id: id, role: role, "aria-describedby": describedBy, "aria-label": label, children: _jsx(FocusTrap, { focusLock: true, returnFocus: returnFocus, autoFocus: autoFocus, onEscapeKey: onEscapeKey, onClickOutside: underlay ? undefined : onClickOutside, children: _jsx(Pressable, { tabIndex: -1, onPress: onPress, style: styles.defaultCursor, children: typeof children == "function" ? children({ mode: "dropdown" }) : children }) }) })) : null] })) : null }) }));
154
+ ], id: id, role: role, "aria-describedby": describedBy, "aria-label": label, children: _jsx(FocusTrap, { focusLock: true, returnFocus: returnFocus, autoFocus: autoFocus, onEscapeKey: onEscapeKey, onClickOutside: underlay ? undefined : onClickOutside, children: _jsx(Pressable, { tabIndex: -1, onPress: onPress, style: styles.defaultCursor, children: typeof children == "function" ? children({ mode: "dropdown" }) : children }) }) })) : null })) : null })] }));
154
155
  });
@@ -114,6 +114,8 @@
114
114
  "paint-brush-regular": "M5.75 2a.75.75 0 0 0-.75.75v11.5c0 1.24 1 2.25 2.25 2.25H9.5v3a2.5 2.5 0 1 0 5 0v-3h2.25c1.24 0 2.25-1 2.25-2.25V2.75a.75.75 0 0 0-.75-.75H5.75Zm.75 9V3.5h6v1.75a.75.75 0 1 0 1.5 0V3.5h1v2.75a.75.75 0 1 0 1.5 0V3.5h1V11h-11Zm0 3.25V12.5h11v1.75c0 .41-.34.75-.75.75h-3a.75.75 0 0 0-.75.75v3.75a1 1 0 0 1-2 0v-3.75a.75.75 0 0 0-.75-.75h-3a.75.75 0 0 1-.75-.75Z",
115
115
  "panel-left-filled": "M5.25 4A3.25 3.25 0 0 0 2 7.25v9.5C2 18.55 3.46 20 5.25 20h13.5c1.8 0 3.25-1.46 3.25-3.25v-9.5C22 5.45 20.54 4 18.75 4H5.25Zm13.5 1.5c.97 0 1.75.78 1.75 1.75v9.5c0 .97-.78 1.75-1.75 1.75H9.5v-13h9.25Z",
116
116
  "panel-left-regular": "M2 7.25C2 5.45 3.46 4 5.25 4h13.5C20.55 4 22 5.46 22 7.25v9.5c0 1.8-1.46 3.25-3.25 3.25H5.25A3.25 3.25 0 0 1 2 16.75v-9.5ZM9.5 5.5v13h9.25c.97 0 1.75-.78 1.75-1.75v-9.5c0-.97-.78-1.75-1.75-1.75H9.5ZM8 5.5H5.25c-.97 0-1.75.78-1.75 1.75v9.5c0 .97.78 1.75 1.75 1.75H8v-13Z",
117
+ "panel-left-contract-filled": "M14.8 9.25a.75.75 0 0 0-1.05-.06l-2.5 2.25a.75.75 0 0 0 0 1.12l2.5 2.25a.75.75 0 1 0 1-1.12l-1.05-.94h3.55a.75.75 0 0 0 0-1.5H13.7l1.05-.94c.31-.28.33-.75.06-1.06ZM2 6.75A2.75 2.75 0 0 1 4.75 4h14.5A2.75 2.75 0 0 1 22 6.75v10.5A2.75 2.75 0 0 1 19.25 20H4.75A2.75 2.75 0 0 1 2 17.25V6.75ZM9 5.5v13h10.25c.69 0 1.25-.56 1.25-1.25V6.75c0-.69-.56-1.25-1.25-1.25H9Z",
118
+ "panel-left-contract-regular": "M14.8 9.25a.75.75 0 0 0-1.05-.06l-2.5 2.25a.75.75 0 0 0 0 1.12l2.5 2.25a.75.75 0 0 0 1-1.12l-1.05-.94h3.55a.75.75 0 1 0 0-1.5H13.7l1.05-.94c.31-.28.33-.75.06-1.06Zm-12.8 8A2.75 2.75 0 0 0 4.75 20h14.5A2.75 2.75 0 0 0 22 17.25V6.75A2.75 2.75 0 0 0 19.25 4H4.75A2.75 2.75 0 0 0 2 6.75v10.5Zm2.75 1.25c-.69 0-1.25-.56-1.25-1.25V6.75c0-.7.56-1.25 1.25-1.25H8v13H4.75Zm4.75 0v-13h9.75c.69 0 1.25.56 1.25 1.25v10.5c0 .7-.56 1.25-1.25 1.25H9.5Z",
117
119
  "panel-left-expand-filled": "M14.2 14.75c.27.3.74.33 1.05.06l2.5-2.25a.75.75 0 0 0 0-1.12l-2.5-2.25a.75.75 0 0 0-1 1.12l1.05.94h-3.55a.75.75 0 1 0 0 1.5h3.55l-1.05.94a.75.75 0 0 0-.06 1.06ZM2 6.75A2.75 2.75 0 0 1 4.75 4h14.5A2.75 2.75 0 0 1 22 6.75v10.5A2.75 2.75 0 0 1 19.25 20H4.75A2.75 2.75 0 0 1 2 17.25V6.75ZM9 5.5v13h10.25c.69 0 1.25-.56 1.25-1.25V6.75c0-.69-.56-1.25-1.25-1.25H9Z",
118
120
  "panel-left-expand-regular": "M14.2 14.75c.27.3.74.33 1.05.06l2.5-2.25a.75.75 0 0 0 0-1.12l-2.5-2.25a.75.75 0 0 0-1 1.12l1.05.94h-3.55a.75.75 0 1 0 0 1.5h3.55l-1.05.94a.75.75 0 0 0-.06 1.06ZM2 6.75A2.75 2.75 0 0 1 4.75 4h14.5A2.75 2.75 0 0 1 22 6.75v10.5A2.75 2.75 0 0 1 19.25 20H4.75A2.75 2.75 0 0 1 2 17.25V6.75ZM4.75 5.5c-.69 0-1.25.56-1.25 1.25v10.5c0 .69.56 1.25 1.25 1.25H8v-13H4.75Zm4.75 0v13h9.75c.69 0 1.25-.56 1.25-1.25V6.75c0-.69-.56-1.25-1.25-1.25H9.5Z",
119
121
  "pause-regular": "M6.25 3C5.01 3 4 4 4 5.25v13.5C4 19.99 5 21 6.25 21h2.5C9.99 21 11 20 11 18.75V5.25C11 4.01 10 3 8.75 3h-2.5ZM5.5 5.25c0-.41.34-.75.75-.75h2.5c.41 0 .75.34.75.75v13.5c0 .41-.34.75-.75.75h-2.5a.75.75 0 0 1-.75-.75V5.25ZM15.25 3C14.01 3 13 4 13 5.25v13.5c0 1.24 1 2.25 2.25 2.25h2.5c1.24 0 2.25-1 2.25-2.25V5.25C20 4.01 19 3 17.75 3h-2.5Zm-.75 2.25c0-.41.34-.75.75-.75h2.5c.41 0 .75.34.75.75v13.5c0 .41-.34.75-.75.75h-2.5a.75.75 0 0 1-.75-.75V5.25Z",