@agg-market/ui 0.0.6 → 1.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.
@@ -313,19 +313,31 @@ var ProfileModal = ({
313
313
  const [draftUsername, setDraftUsername] = useState(username != null ? username : "");
314
314
  const [draftAvatarFile, setDraftAvatarFile] = useState();
315
315
  const [draftAvatarPreview, setDraftAvatarPreview] = useState();
316
+ const [isSaving, setIsSaving] = useState(false);
316
317
  useEffect(() => {
317
318
  setDraftUsername(username != null ? username : "");
318
319
  }, [username]);
319
- const handleOpenChange = (isOpen) => {
320
- if (!isOpen) {
321
- setActiveTab(PROFILE_TAB_KEYS.ABOUT);
322
- setIsSaving(false);
323
- setDraftUsername(username != null ? username : "");
324
- setDraftAvatarFile(void 0);
325
- setDraftAvatarPreview(void 0);
326
- }
327
- onOpenChange(isOpen);
328
- };
320
+ const handleOpenChange = useCallback2(
321
+ (isOpen) => {
322
+ if (!isOpen) {
323
+ setActiveTab(PROFILE_TAB_KEYS.ABOUT);
324
+ setIsSaving(false);
325
+ setDraftUsername(username != null ? username : "");
326
+ setDraftAvatarFile(void 0);
327
+ setDraftAvatarPreview(void 0);
328
+ }
329
+ onOpenChange(isOpen);
330
+ },
331
+ [
332
+ onOpenChange,
333
+ username,
334
+ setActiveTab,
335
+ setIsSaving,
336
+ setDraftUsername,
337
+ setDraftAvatarFile,
338
+ setDraftAvatarPreview
339
+ ]
340
+ );
329
341
  const handleDraftAvatarChange = useCallback2(
330
342
  (file, preview) => {
331
343
  setDraftAvatarFile(file);
@@ -333,7 +345,6 @@ var ProfileModal = ({
333
345
  },
334
346
  []
335
347
  );
336
- const [isSaving, setIsSaving] = useState(false);
337
348
  const hasChanges = draftUsername !== (username != null ? username : "") || draftAvatarFile !== void 0;
338
349
  const handleSave = useCallback2(() => {
339
350
  setIsSaving(true);
@@ -349,7 +360,7 @@ var ProfileModal = ({
349
360
  }, [draftUsername, draftAvatarFile, draftAvatarPreview, onSave, onOpenChange]);
350
361
  const handleCancel = useCallback2(() => {
351
362
  handleOpenChange(false);
352
- }, [onOpenChange, username]);
363
+ }, [handleOpenChange]);
353
364
  return /* @__PURE__ */ jsx3(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs3(Modal.Container, { maxWidth: "800px", "aria-label": "Edit Profile", children: [
354
365
  /* @__PURE__ */ jsx3(Modal.Header, { title: "Edit Profile" }),
355
366
  /* @__PURE__ */ jsx3(Modal.Body, { children: /* @__PURE__ */ jsxs3("div", { className: "flex flex-col sm:flex-row sm:gap-10", children: [
@@ -1,5 +1,5 @@
1
1
  import { Event } from '@agg-market/hooks';
2
- import { A as PlaceOrderViewModel, S as SettlementViewModel } from './types-DkGlbmXq.mjs';
2
+ import { A as PlaceOrderViewModel, S as SettlementViewModel } from './types-JBf1DZlH.mjs';
3
3
  import { d as EventListItemDetailsTimeRange } from './event-list-item-details.types-DekJKeMD.mjs';
4
4
  import 'zod';
5
5
  import './event-list-item.types-Y6IeJ4e4.mjs';
@@ -1,5 +1,5 @@
1
1
  import { Event } from '@agg-market/hooks';
2
- import { A as PlaceOrderViewModel, S as SettlementViewModel } from './types-DkGlbmXq.js';
2
+ import { A as PlaceOrderViewModel, S as SettlementViewModel } from './types-JBf1DZlH.js';
3
3
  import { d as EventListItemDetailsTimeRange } from './event-list-item-details.types-CMbXOrT-.js';
4
4
  import 'zod';
5
5
  import './event-list-item.types-Y6IeJ4e4.js';
package/dist/index.d.mts CHANGED
@@ -26,8 +26,8 @@ export { ConnectAccountsStep, ConnectAccountsStepProps, ConnectKalshiModal, Conn
26
26
  export { ExchangeAccount, ProfileModal, ProfileModalProps, SocialAccountInfo, SocialAccountState } from './profile-modal.mjs';
27
27
  export { EventMarketPage, EventMarketPageClassNames, EventMarketPageProps } from './event-market-page.mjs';
28
28
  export { UserProfileActivity, UserProfileBalance, UserProfileConnectedExchange, UserProfileInfo, UserProfilePage, UserProfilePageClassNames, UserProfilePageProps, UserProfilePosition, UserProfilePositionFilter, UserProfileSocialLink, UserProfileTimeRange, UserProfileVenueBalance } from './user-profile-page.mjs';
29
- import { T as TradingVenue } from './types-DkGlbmXq.mjs';
30
- export { v as PlaceOrderMetric, u as PlaceOrderOutcome, y as PlaceOrderResult, r as PlaceOrderResultTone, x as PlaceOrderRouting, w as PlaceOrderRoutingRow, q as PlaceOrderRoutingTone, z as PlaceOrderStatus, o as PlaceOrderStatusPlacement, n as PlaceOrderStatusTone, P as PlaceOrderTab, A as PlaceOrderViewModel, b as SettlementVenueItem, S as SettlementViewModel, h as placeOrderMetricSchema, g as placeOrderOutcomeSchema, k as placeOrderResultSchema, f as placeOrderResultToneSchema, i as placeOrderRoutingRowSchema, j as placeOrderRoutingSchema, e as placeOrderRoutingToneSchema, d as placeOrderStatusPlacementSchema, l as placeOrderStatusSchema, c as placeOrderStatusToneSchema, p as placeOrderTabSchema, m as placeOrderViewModelSchema, s as settlementVenueSchema, a as settlementViewModelSchema, t as tradingVenueSchema } from './types-DkGlbmXq.mjs';
29
+ import { T as TradingVenue } from './types-JBf1DZlH.mjs';
30
+ export { v as PlaceOrderMetric, u as PlaceOrderOutcome, y as PlaceOrderResult, r as PlaceOrderResultTone, x as PlaceOrderRouting, w as PlaceOrderRoutingRow, q as PlaceOrderRoutingTone, z as PlaceOrderStatus, o as PlaceOrderStatusPlacement, n as PlaceOrderStatusTone, P as PlaceOrderTab, A as PlaceOrderViewModel, b as SettlementVenueItem, S as SettlementViewModel, h as placeOrderMetricSchema, g as placeOrderOutcomeSchema, k as placeOrderResultSchema, f as placeOrderResultToneSchema, i as placeOrderRoutingRowSchema, j as placeOrderRoutingSchema, e as placeOrderRoutingToneSchema, d as placeOrderStatusPlacementSchema, l as placeOrderStatusSchema, c as placeOrderStatusToneSchema, p as placeOrderTabSchema, m as placeOrderViewModelSchema, s as settlementVenueSchema, a as settlementViewModelSchema, t as tradingVenueSchema } from './types-JBf1DZlH.mjs';
31
31
  export { Settlement, SettlementProps } from './settlement.mjs';
32
32
  export { PlaceOrder, PlaceOrderProps } from './place-order.mjs';
33
33
  export { A as AvailableSizes } from './types-Bed6Q0EK.mjs';
package/dist/index.d.ts CHANGED
@@ -26,8 +26,8 @@ export { ConnectAccountsStep, ConnectAccountsStepProps, ConnectKalshiModal, Conn
26
26
  export { ExchangeAccount, ProfileModal, ProfileModalProps, SocialAccountInfo, SocialAccountState } from './profile-modal.js';
27
27
  export { EventMarketPage, EventMarketPageClassNames, EventMarketPageProps } from './event-market-page.js';
28
28
  export { UserProfileActivity, UserProfileBalance, UserProfileConnectedExchange, UserProfileInfo, UserProfilePage, UserProfilePageClassNames, UserProfilePageProps, UserProfilePosition, UserProfilePositionFilter, UserProfileSocialLink, UserProfileTimeRange, UserProfileVenueBalance } from './user-profile-page.js';
29
- import { T as TradingVenue } from './types-DkGlbmXq.js';
30
- export { v as PlaceOrderMetric, u as PlaceOrderOutcome, y as PlaceOrderResult, r as PlaceOrderResultTone, x as PlaceOrderRouting, w as PlaceOrderRoutingRow, q as PlaceOrderRoutingTone, z as PlaceOrderStatus, o as PlaceOrderStatusPlacement, n as PlaceOrderStatusTone, P as PlaceOrderTab, A as PlaceOrderViewModel, b as SettlementVenueItem, S as SettlementViewModel, h as placeOrderMetricSchema, g as placeOrderOutcomeSchema, k as placeOrderResultSchema, f as placeOrderResultToneSchema, i as placeOrderRoutingRowSchema, j as placeOrderRoutingSchema, e as placeOrderRoutingToneSchema, d as placeOrderStatusPlacementSchema, l as placeOrderStatusSchema, c as placeOrderStatusToneSchema, p as placeOrderTabSchema, m as placeOrderViewModelSchema, s as settlementVenueSchema, a as settlementViewModelSchema, t as tradingVenueSchema } from './types-DkGlbmXq.js';
29
+ import { T as TradingVenue } from './types-JBf1DZlH.js';
30
+ export { v as PlaceOrderMetric, u as PlaceOrderOutcome, y as PlaceOrderResult, r as PlaceOrderResultTone, x as PlaceOrderRouting, w as PlaceOrderRoutingRow, q as PlaceOrderRoutingTone, z as PlaceOrderStatus, o as PlaceOrderStatusPlacement, n as PlaceOrderStatusTone, P as PlaceOrderTab, A as PlaceOrderViewModel, b as SettlementVenueItem, S as SettlementViewModel, h as placeOrderMetricSchema, g as placeOrderOutcomeSchema, k as placeOrderResultSchema, f as placeOrderResultToneSchema, i as placeOrderRoutingRowSchema, j as placeOrderRoutingSchema, e as placeOrderRoutingToneSchema, d as placeOrderStatusPlacementSchema, l as placeOrderStatusSchema, c as placeOrderStatusToneSchema, p as placeOrderTabSchema, m as placeOrderViewModelSchema, s as settlementVenueSchema, a as settlementViewModelSchema, t as tradingVenueSchema } from './types-JBf1DZlH.js';
31
31
  export { Settlement, SettlementProps } from './settlement.js';
32
32
  export { PlaceOrder, PlaceOrderProps } from './place-order.js';
33
33
  export { A as AvailableSizes } from './types-Bed6Q0EK.js';
package/dist/index.js CHANGED
@@ -9606,19 +9606,31 @@ var ProfileModal = ({
9606
9606
  const [draftUsername, setDraftUsername] = (0, import_react24.useState)(username != null ? username : "");
9607
9607
  const [draftAvatarFile, setDraftAvatarFile] = (0, import_react24.useState)();
9608
9608
  const [draftAvatarPreview, setDraftAvatarPreview] = (0, import_react24.useState)();
9609
+ const [isSaving, setIsSaving] = (0, import_react24.useState)(false);
9609
9610
  (0, import_react24.useEffect)(() => {
9610
9611
  setDraftUsername(username != null ? username : "");
9611
9612
  }, [username]);
9612
- const handleOpenChange = (isOpen) => {
9613
- if (!isOpen) {
9614
- setActiveTab(PROFILE_TAB_KEYS.ABOUT);
9615
- setIsSaving(false);
9616
- setDraftUsername(username != null ? username : "");
9617
- setDraftAvatarFile(void 0);
9618
- setDraftAvatarPreview(void 0);
9619
- }
9620
- onOpenChange(isOpen);
9621
- };
9613
+ const handleOpenChange = (0, import_react24.useCallback)(
9614
+ (isOpen) => {
9615
+ if (!isOpen) {
9616
+ setActiveTab(PROFILE_TAB_KEYS.ABOUT);
9617
+ setIsSaving(false);
9618
+ setDraftUsername(username != null ? username : "");
9619
+ setDraftAvatarFile(void 0);
9620
+ setDraftAvatarPreview(void 0);
9621
+ }
9622
+ onOpenChange(isOpen);
9623
+ },
9624
+ [
9625
+ onOpenChange,
9626
+ username,
9627
+ setActiveTab,
9628
+ setIsSaving,
9629
+ setDraftUsername,
9630
+ setDraftAvatarFile,
9631
+ setDraftAvatarPreview
9632
+ ]
9633
+ );
9622
9634
  const handleDraftAvatarChange = (0, import_react24.useCallback)(
9623
9635
  (file, preview) => {
9624
9636
  setDraftAvatarFile(file);
@@ -9626,7 +9638,6 @@ var ProfileModal = ({
9626
9638
  },
9627
9639
  []
9628
9640
  );
9629
- const [isSaving, setIsSaving] = (0, import_react24.useState)(false);
9630
9641
  const hasChanges = draftUsername !== (username != null ? username : "") || draftAvatarFile !== void 0;
9631
9642
  const handleSave = (0, import_react24.useCallback)(() => {
9632
9643
  setIsSaving(true);
@@ -9642,7 +9653,7 @@ var ProfileModal = ({
9642
9653
  }, [draftUsername, draftAvatarFile, draftAvatarPreview, onSave, onOpenChange]);
9643
9654
  const handleCancel = (0, import_react24.useCallback)(() => {
9644
9655
  handleOpenChange(false);
9645
- }, [onOpenChange, username]);
9656
+ }, [handleOpenChange]);
9646
9657
  return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(Modal.Container, { maxWidth: "800px", "aria-label": "Edit Profile", children: [
9647
9658
  /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Modal.Header, { title: "Edit Profile" }),
9648
9659
  /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Modal.Body, { children: /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: "flex flex-col sm:flex-row sm:gap-10", children: [
package/dist/index.mjs CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  } from "./chunk-RGZQHSNJ.mjs";
18
18
  import {
19
19
  ProfileModal
20
- } from "./chunk-I4YUYVJJ.mjs";
20
+ } from "./chunk-H4UIBDL2.mjs";
21
21
  import {
22
22
  EventMarketPage
23
23
  } from "./chunk-USLTNDJA.mjs";
@@ -1,4 +1,4 @@
1
- import { A as PlaceOrderViewModel, P as PlaceOrderTab } from './types-DkGlbmXq.mjs';
1
+ import { A as PlaceOrderViewModel, P as PlaceOrderTab } from './types-JBf1DZlH.mjs';
2
2
  import 'zod';
3
3
 
4
4
  type PlaceOrderProps = PlaceOrderViewModel & {
@@ -1,4 +1,4 @@
1
- import { A as PlaceOrderViewModel, P as PlaceOrderTab } from './types-DkGlbmXq.js';
1
+ import { A as PlaceOrderViewModel, P as PlaceOrderTab } from './types-JBf1DZlH.js';
2
2
  import 'zod';
3
3
 
4
4
  type PlaceOrderProps = PlaceOrderViewModel & {
@@ -2270,19 +2270,31 @@ var ProfileModal = ({
2270
2270
  const [draftUsername, setDraftUsername] = (0, import_react2.useState)(username != null ? username : "");
2271
2271
  const [draftAvatarFile, setDraftAvatarFile] = (0, import_react2.useState)();
2272
2272
  const [draftAvatarPreview, setDraftAvatarPreview] = (0, import_react2.useState)();
2273
+ const [isSaving, setIsSaving] = (0, import_react2.useState)(false);
2273
2274
  (0, import_react2.useEffect)(() => {
2274
2275
  setDraftUsername(username != null ? username : "");
2275
2276
  }, [username]);
2276
- const handleOpenChange = (isOpen) => {
2277
- if (!isOpen) {
2278
- setActiveTab(PROFILE_TAB_KEYS.ABOUT);
2279
- setIsSaving(false);
2280
- setDraftUsername(username != null ? username : "");
2281
- setDraftAvatarFile(void 0);
2282
- setDraftAvatarPreview(void 0);
2283
- }
2284
- onOpenChange(isOpen);
2285
- };
2277
+ const handleOpenChange = (0, import_react2.useCallback)(
2278
+ (isOpen) => {
2279
+ if (!isOpen) {
2280
+ setActiveTab(PROFILE_TAB_KEYS.ABOUT);
2281
+ setIsSaving(false);
2282
+ setDraftUsername(username != null ? username : "");
2283
+ setDraftAvatarFile(void 0);
2284
+ setDraftAvatarPreview(void 0);
2285
+ }
2286
+ onOpenChange(isOpen);
2287
+ },
2288
+ [
2289
+ onOpenChange,
2290
+ username,
2291
+ setActiveTab,
2292
+ setIsSaving,
2293
+ setDraftUsername,
2294
+ setDraftAvatarFile,
2295
+ setDraftAvatarPreview
2296
+ ]
2297
+ );
2286
2298
  const handleDraftAvatarChange = (0, import_react2.useCallback)(
2287
2299
  (file, preview) => {
2288
2300
  setDraftAvatarFile(file);
@@ -2290,7 +2302,6 @@ var ProfileModal = ({
2290
2302
  },
2291
2303
  []
2292
2304
  );
2293
- const [isSaving, setIsSaving] = (0, import_react2.useState)(false);
2294
2305
  const hasChanges = draftUsername !== (username != null ? username : "") || draftAvatarFile !== void 0;
2295
2306
  const handleSave = (0, import_react2.useCallback)(() => {
2296
2307
  setIsSaving(true);
@@ -2306,7 +2317,7 @@ var ProfileModal = ({
2306
2317
  }, [draftUsername, draftAvatarFile, draftAvatarPreview, onSave, onOpenChange]);
2307
2318
  const handleCancel = (0, import_react2.useCallback)(() => {
2308
2319
  handleOpenChange(false);
2309
- }, [onOpenChange, username]);
2320
+ }, [handleOpenChange]);
2310
2321
  return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Modal.Container, { maxWidth: "800px", "aria-label": "Edit Profile", children: [
2311
2322
  /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Modal.Header, { title: "Edit Profile" }),
2312
2323
  /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Modal.Body, { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex flex-col sm:flex-row sm:gap-10", children: [
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ProfileModal
3
- } from "./chunk-I4YUYVJJ.mjs";
3
+ } from "./chunk-H4UIBDL2.mjs";
4
4
  import "./chunk-VIP7HSOU.mjs";
5
5
  import "./chunk-BLSHXIAH.mjs";
6
6
  import "./chunk-F236MLT6.mjs";
@@ -1,4 +1,4 @@
1
- import { S as SettlementViewModel, T as TradingVenue } from './types-DkGlbmXq.mjs';
1
+ import { S as SettlementViewModel, T as TradingVenue } from './types-JBf1DZlH.mjs';
2
2
  import 'zod';
3
3
 
4
4
  type SettlementProps = SettlementViewModel & {
@@ -1,4 +1,4 @@
1
- import { S as SettlementViewModel, T as TradingVenue } from './types-DkGlbmXq.js';
1
+ import { S as SettlementViewModel, T as TradingVenue } from './types-JBf1DZlH.js';
2
2
  import 'zod';
3
3
 
4
4
  type SettlementProps = SettlementViewModel & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agg-market/ui",
3
- "version": "0.0.6",
3
+ "version": "1.0.0",
4
4
  "sideEffects": false,
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",
@@ -331,7 +331,7 @@
331
331
  "peerDependencies": {
332
332
  "react": "^18.0.0 || ^19.0.0",
333
333
  "react-dom": "^18.0.0 || ^19.0.0",
334
- "@agg-market/hooks": "0.0.6"
334
+ "@agg-market/hooks": "1.0.0"
335
335
  },
336
336
  "dependencies": {
337
337
  "@radix-ui/react-dialog": "^1.1.15",
@@ -285,13 +285,13 @@ declare const placeOrderViewModelSchema: z.ZodObject<{
285
285
  actionLabel?: string | undefined;
286
286
  }>>;
287
287
  }, "strip", z.ZodTypeAny, {
288
+ title: string;
288
289
  result: {
289
290
  value: string;
290
291
  label: string;
291
292
  tone: "default" | "success";
292
293
  hint: string;
293
294
  };
294
- title: string;
295
295
  outcomes: {
296
296
  id: string;
297
297
  label: string;
@@ -328,13 +328,13 @@ declare const placeOrderViewModelSchema: z.ZodObject<{
328
328
  marketImageUrl?: string | undefined;
329
329
  isDismissible?: boolean | undefined;
330
330
  }, {
331
+ title: string;
331
332
  result: {
332
333
  value: string;
333
334
  label: string;
334
335
  tone: "default" | "success";
335
336
  hint: string;
336
337
  };
337
- title: string;
338
338
  outcomes: {
339
339
  id: string;
340
340
  label: string;
@@ -285,13 +285,13 @@ declare const placeOrderViewModelSchema: z.ZodObject<{
285
285
  actionLabel?: string | undefined;
286
286
  }>>;
287
287
  }, "strip", z.ZodTypeAny, {
288
+ title: string;
288
289
  result: {
289
290
  value: string;
290
291
  label: string;
291
292
  tone: "default" | "success";
292
293
  hint: string;
293
294
  };
294
- title: string;
295
295
  outcomes: {
296
296
  id: string;
297
297
  label: string;
@@ -328,13 +328,13 @@ declare const placeOrderViewModelSchema: z.ZodObject<{
328
328
  marketImageUrl?: string | undefined;
329
329
  isDismissible?: boolean | undefined;
330
330
  }, {
331
+ title: string;
331
332
  result: {
332
333
  value: string;
333
334
  label: string;
334
335
  tone: "default" | "success";
335
336
  hint: string;
336
337
  };
337
- title: string;
338
338
  outcomes: {
339
339
  id: string;
340
340
  label: string;