@heymantle/litho 0.0.7 → 0.0.8

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.
@@ -102,7 +102,7 @@ var styles = (0, _tailwindvariants.tv)({
102
102
  * @returns {JSX.Element} A div element representing the grid container.
103
103
  */ function Grid() {
104
104
  var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
105
- var children = props.children, columns = props.columns, gap = props.gap, _props_justify = props.justify, justify = _props_justify === void 0 ? "stretch" : _props_justify, _props_align = props.align, align = _props_align === void 0 ? "stretch" : _props_align, className = props.className;
105
+ var children = props.children, columns = props.columns, _props_gap = props.gap, gap = _props_gap === void 0 ? "md" : _props_gap, _props_justify = props.justify, justify = _props_justify === void 0 ? "stretch" : _props_justify, _props_align = props.align, align = _props_align === void 0 ? "stretch" : _props_align, className = props.className;
106
106
  var columnClasses;
107
107
  var gapClasses;
108
108
  if ((typeof columns === "undefined" ? "undefined" : _type_of(columns)) === "object") {
@@ -199,10 +199,11 @@ var sectionStyles = (0, _tailwindvariants.tv)({
199
199
  * @param {React.ReactNode} [props.leftAccessory] - Left accessory content in the footer.
200
200
  * @param {boolean} [props.hideCloseButton=false] - Whether to hide the close button.
201
201
  * @param {number} [props.zIndexOverride=1000] - The z-index of the modal.
202
+ * @param {boolean} [props.autoFocusFirstInput=true] - Whether to focus the first input when the modal opens.
202
203
  * @returns {React.ReactPortal|null} The rendered modal component or null if not open.
203
204
  */ function Modal() {
204
205
  var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
205
- var children = props.children, title = props.title, subtitle = props.subtitle, open = props.open, onClose = props.onClose, sectioned = props.sectioned, primaryAction = props.primaryAction, secondaryAction = props.secondaryAction, _props_secondaryActions = props.secondaryActions, secondaryActions = _props_secondaryActions === void 0 ? [] : _props_secondaryActions, destructiveAction = props.destructiveAction, loading = props.loading, _props_size = props.size, size = _props_size === void 0 ? "default" : _props_size, leftAccessory = props.leftAccessory, _props_hideCloseButton = props.hideCloseButton, hideCloseButton = _props_hideCloseButton === void 0 ? false : _props_hideCloseButton, backAction = props.backAction, zIndexOverride = props.zIndexOverride;
206
+ var children = props.children, title = props.title, subtitle = props.subtitle, open = props.open, onClose = props.onClose, sectioned = props.sectioned, primaryAction = props.primaryAction, secondaryAction = props.secondaryAction, _props_secondaryActions = props.secondaryActions, secondaryActions = _props_secondaryActions === void 0 ? [] : _props_secondaryActions, destructiveAction = props.destructiveAction, loading = props.loading, _props_size = props.size, size = _props_size === void 0 ? "default" : _props_size, leftAccessory = props.leftAccessory, _props_hideCloseButton = props.hideCloseButton, hideCloseButton = _props_hideCloseButton === void 0 ? false : _props_hideCloseButton, backAction = props.backAction, zIndexOverride = props.zIndexOverride, _props_autoFocusFirstInput = props.autoFocusFirstInput, autoFocusFirstInput = _props_autoFocusFirstInput === void 0 ? true : _props_autoFocusFirstInput;
206
207
  var setModalIsOpen = (0, _Frame.useFrame)().setModalIsOpen;
207
208
  var modalContentRef = (0, _react.useRef)(null);
208
209
  var hasChildren = !!children;
@@ -244,11 +245,12 @@ var sectionStyles = (0, _tailwindvariants.tv)({
244
245
  ]);
245
246
  // Focus first input when modal opens
246
247
  (0, _react.useLayoutEffect)(function() {
247
- if (open && container && modalContentRef.current) {
248
+ if (autoFocusFirstInput && open && container && modalContentRef.current) {
248
249
  var focusable = modalContentRef.current.querySelector('input:not([type="hidden"]), select, textarea');
249
250
  if (focusable) focusable.focus();
250
251
  }
251
252
  }, [
253
+ autoFocusFirstInput,
252
254
  open,
253
255
  container
254
256
  ]);
@@ -92,7 +92,7 @@ var styles = tv({
92
92
  * @returns {JSX.Element} A div element representing the grid container.
93
93
  */ function Grid() {
94
94
  var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
95
- var children = props.children, columns = props.columns, gap = props.gap, _props_justify = props.justify, justify = _props_justify === void 0 ? "stretch" : _props_justify, _props_align = props.align, align = _props_align === void 0 ? "stretch" : _props_align, className = props.className;
95
+ var children = props.children, columns = props.columns, _props_gap = props.gap, gap = _props_gap === void 0 ? "md" : _props_gap, _props_justify = props.justify, justify = _props_justify === void 0 ? "stretch" : _props_justify, _props_align = props.align, align = _props_align === void 0 ? "stretch" : _props_align, className = props.className;
96
96
  var columnClasses;
97
97
  var gapClasses;
98
98
  if ((typeof columns === "undefined" ? "undefined" : _type_of(columns)) === "object") {
@@ -135,10 +135,11 @@ var sectionStyles = tv({
135
135
  * @param {React.ReactNode} [props.leftAccessory] - Left accessory content in the footer.
136
136
  * @param {boolean} [props.hideCloseButton=false] - Whether to hide the close button.
137
137
  * @param {number} [props.zIndexOverride=1000] - The z-index of the modal.
138
+ * @param {boolean} [props.autoFocusFirstInput=true] - Whether to focus the first input when the modal opens.
138
139
  * @returns {React.ReactPortal|null} The rendered modal component or null if not open.
139
140
  */ function Modal() {
140
141
  var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
141
- var children = props.children, title = props.title, subtitle = props.subtitle, open = props.open, onClose = props.onClose, sectioned = props.sectioned, primaryAction = props.primaryAction, secondaryAction = props.secondaryAction, _props_secondaryActions = props.secondaryActions, secondaryActions = _props_secondaryActions === void 0 ? [] : _props_secondaryActions, destructiveAction = props.destructiveAction, loading = props.loading, _props_size = props.size, size = _props_size === void 0 ? "default" : _props_size, leftAccessory = props.leftAccessory, _props_hideCloseButton = props.hideCloseButton, hideCloseButton = _props_hideCloseButton === void 0 ? false : _props_hideCloseButton, backAction = props.backAction, zIndexOverride = props.zIndexOverride;
142
+ var children = props.children, title = props.title, subtitle = props.subtitle, open = props.open, onClose = props.onClose, sectioned = props.sectioned, primaryAction = props.primaryAction, secondaryAction = props.secondaryAction, _props_secondaryActions = props.secondaryActions, secondaryActions = _props_secondaryActions === void 0 ? [] : _props_secondaryActions, destructiveAction = props.destructiveAction, loading = props.loading, _props_size = props.size, size = _props_size === void 0 ? "default" : _props_size, leftAccessory = props.leftAccessory, _props_hideCloseButton = props.hideCloseButton, hideCloseButton = _props_hideCloseButton === void 0 ? false : _props_hideCloseButton, backAction = props.backAction, zIndexOverride = props.zIndexOverride, _props_autoFocusFirstInput = props.autoFocusFirstInput, autoFocusFirstInput = _props_autoFocusFirstInput === void 0 ? true : _props_autoFocusFirstInput;
142
143
  var setModalIsOpen = useFrame().setModalIsOpen;
143
144
  var modalContentRef = useRef(null);
144
145
  var hasChildren = !!children;
@@ -180,11 +181,12 @@ var sectionStyles = tv({
180
181
  ]);
181
182
  // Focus first input when modal opens
182
183
  useLayoutEffect(function() {
183
- if (open && container && modalContentRef.current) {
184
+ if (autoFocusFirstInput && open && container && modalContentRef.current) {
184
185
  var focusable = modalContentRef.current.querySelector('input:not([type="hidden"]), select, textarea');
185
186
  if (focusable) focusable.focus();
186
187
  }
187
188
  }, [
189
+ autoFocusFirstInput,
188
190
  open,
189
191
  container
190
192
  ]);
@@ -28,6 +28,7 @@ import React from "react";
28
28
  * @param {React.ReactNode} [props.leftAccessory] - Left accessory content in the footer.
29
29
  * @param {boolean} [props.hideCloseButton=false] - Whether to hide the close button.
30
30
  * @param {number} [props.zIndexOverride=1000] - The z-index of the modal.
31
+ * @param {boolean} [props.autoFocusFirstInput=true] - Whether to focus the first input when the modal opens.
31
32
  * @returns {React.ReactPortal|null} The rendered modal component or null if not open.
32
33
  */
33
34
  declare function Modal(props?: {
@@ -56,6 +57,7 @@ declare function Modal(props?: {
56
57
  leftAccessory?: React.ReactNode;
57
58
  hideCloseButton?: boolean;
58
59
  zIndexOverride?: number;
60
+ autoFocusFirstInput?: boolean;
59
61
  }): React.ReactPortal | null;
60
62
  declare namespace Modal {
61
63
  export { Section };
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../components/Modal.js"],"names":[],"mappings":"AAaA,kDAAiD;;kBAVkC,OAAO;AAgE1F;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,+BA1BG;IAAgC,QAAQ,GAAhC,KAAK,CAAC,SAAS;IACA,KAAK,GAApB,MA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AjC,KAAQ;IACO,iBAAiB;IAChB,OAAO,GAAvB,OAAO;IACQ,IAAI,GAAnB,MAAM;IACkB,aAAa,GAArC,KAAK,CAAC,SAAS;IACC,eAAe,GAA/B,OAAO;IACQ,cAAc,GAA7B,MAAM;IACU,mBAAmB,GAAnC,OAAO;CACf,GAAU,KAAK,CAAC,WAAW,GAAC,IAAI,CAsMlC;;;;AAED;;;;;;;GAOG;AAEH,iCALG;IAAgC,QAAQ,GAAhC,KAAK,CAAC,SAAS;IACC,KAAK,GAArB,OAAO;CACf,GAAU,GAAG,CAAC,OAAO,CA0EvB"}
package/index.css CHANGED
@@ -572,6 +572,8 @@
572
572
  --color-edge-alt-default: rgba(238, 238, 242, 0.21);
573
573
  --color-edge-alt-subdued: rgba(238, 238, 242, 0.12);
574
574
 
575
+ --color-brand-chat: #42331d;
576
+
575
577
  --color-tint-1: rgba(0, 0, 0, 0.08);
576
578
  --color-tint-2: rgba(0, 0, 0, 0.11);
577
579
  --color-tint-3: rgba(0, 0, 0, 0.14);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@heymantle/litho",
3
3
  "description": "Litho is a library of components for building Mantle extensions",
4
- "version": "0.0.7",
4
+ "version": "0.0.8",
5
5
  "type": "module",
6
6
  "main": "./dist/esm/index.js",
7
7
  "module": "./dist/esm/index.js",