@orient-ai/aurora-ui 1.0.0-alpha.6 → 1.0.0-alpha.7

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/index.js CHANGED
@@ -11893,25 +11893,25 @@ var K = {
11893
11893
  };
11894
11894
  //#endregion
11895
11895
  //#region src/components/Popover/Popover.tsx
11896
- function um({ children: e, header: n, blockSize: r = "auto", minBlockSize: i = "0", maxBlockSize: a = "none", inlineSize: o = "auto", minInlineSize: s = "0", maxInlineSize: c = "none", matchAnchorWidth: l = !1, scrollTabIndex: u, anchor: d, side: f = "bottom", align: m = "start", sideOffset: v = 4, alignOffset: y = 0, collisionPadding: b = 16, collisionAvoidance: x = {
11896
+ function um({ children: e, header: n, blockSize: r = "auto", minBlockSize: i = "0", maxBlockSize: a = "none", inlineSize: o = "auto", minInlineSize: s = "0", maxInlineSize: c = "none", matchAnchorWidth: l = !1, scrollRef: u, scrollTabIndex: d, anchor: f, side: m = "bottom", align: v = "start", sideOffset: y = 4, alignOffset: b = 0, collisionPadding: x = 16, collisionAvoidance: S = {
11897
11897
  side: "flip",
11898
11898
  align: "shift",
11899
11899
  fallbackAxisSide: "none"
11900
- }, initialFocus: S, finalFocus: C }) {
11901
- let w = t();
11900
+ }, initialFocus: C, finalFocus: w }) {
11901
+ let T = t();
11902
11902
  return /* @__PURE__ */ h(_.Portal, { children: /* @__PURE__ */ h(_.Positioner, {
11903
- dir: w,
11904
- anchor: d,
11905
- side: f,
11906
- align: m,
11907
- sideOffset: v,
11908
- alignOffset: y,
11909
- collisionPadding: b,
11910
- collisionAvoidance: x,
11903
+ dir: T,
11904
+ anchor: f,
11905
+ side: m,
11906
+ align: v,
11907
+ sideOffset: y,
11908
+ alignOffset: b,
11909
+ collisionPadding: x,
11910
+ collisionAvoidance: S,
11911
11911
  className: K.positioner,
11912
11912
  children: /* @__PURE__ */ g(_.Popup, {
11913
- initialFocus: S,
11914
- finalFocus: C,
11913
+ initialFocus: C,
11914
+ finalFocus: w,
11915
11915
  className: p("aurora-base", K.popover),
11916
11916
  style: {
11917
11917
  blockSize: r === "auto" ? "fit-content" : r,
@@ -11925,8 +11925,9 @@ function um({ children: e, header: n, blockSize: r = "auto", minBlockSize: i = "
11925
11925
  className: K.header,
11926
11926
  children: n
11927
11927
  }), /* @__PURE__ */ h("div", {
11928
+ ref: u,
11928
11929
  className: p(K.scroll, K.spacious),
11929
- tabIndex: u,
11930
+ tabIndex: d,
11930
11931
  children: e
11931
11932
  })]
11932
11933
  })
@@ -14106,32 +14107,52 @@ function qh({ id: e, label: n = "Date", preset: r, onPresetsChange: i, value: a,
14106
14107
  });
14107
14108
  }
14108
14109
  var Jh = {
14109
- search: "_search_fipy4_1",
14110
- options: "_options_fipy4_7",
14111
- option: "_option_fipy4_7",
14112
- checkbox: "_checkbox_fipy4_38",
14113
- "option-label": "_option-label_fipy4_44",
14114
- loading: "_loading_fipy4_49",
14115
- empty: "_empty_fipy4_55"
14110
+ search: "_search_1fbkm_1",
14111
+ options: "_options_1fbkm_7",
14112
+ option: "_option_1fbkm_7",
14113
+ checkbox: "_checkbox_1fbkm_38",
14114
+ "option-label": "_option-label_1fbkm_44",
14115
+ loadMore: "_loadMore_1fbkm_49",
14116
+ loading: "_loading_1fbkm_53",
14117
+ empty: "_empty_1fbkm_59"
14116
14118
  };
14117
14119
  //#endregion
14118
14120
  //#region src/components/Filters/Select/Select.tsx
14119
- function Yh({ id: e, label: t, options: n, filteredOptions: r, value: i, onChange: a, inputValue: o, onInputChange: s, open: c, onOpenChange: l, searchPlaceholder: f = "Search options", empty: m = "No results found", loading: _ = !1, disabled: v = !1 }) {
14120
- let y = d(null), b = u(() => new Map(n.map((e) => [e.value, e])), [n]), x = i.map((e) => b.get(e)?.text ?? e), S = r ?? n;
14121
- return /* @__PURE__ */ g(pm, {
14122
- open: c && !v,
14123
- onOpenChange: l,
14121
+ function Yh({ id: e, label: t, selectedOptions: n, options: r, value: i, onChange: a, inputValue: o, onInputChange: c, open: l, onOpenChange: u, searchPlaceholder: m = "Search options", empty: _ = "No results found", loading: v = !1, hasMore: y = !1, loadMore: b, isLoadingMore: x = !1, disabled: S = !1 }) {
14122
+ let C = d(null), w = d(null), [T, E] = f(null);
14123
+ return s(() => {
14124
+ if (!l || S || v || x || !y || !b || !T) return;
14125
+ let e = new IntersectionObserver(([t]) => {
14126
+ t.isIntersecting && (e.disconnect(), b());
14127
+ }, {
14128
+ root: w.current,
14129
+ rootMargin: "0px 0px 32px 0px"
14130
+ });
14131
+ return e.observe(T), () => e.disconnect();
14132
+ }, [
14133
+ l,
14134
+ S,
14135
+ v,
14136
+ x,
14137
+ y,
14138
+ b,
14139
+ T,
14140
+ r.length
14141
+ ]), /* @__PURE__ */ g(pm, {
14142
+ open: l && !S,
14143
+ onOpenChange: u,
14124
14144
  children: [/* @__PURE__ */ h(Hh, {
14125
- ref: y,
14145
+ ref: C,
14126
14146
  id: e,
14127
14147
  label: t,
14128
- segments: [{ values: x }],
14129
- open: c,
14130
- disabled: v,
14148
+ segments: [{ values: n.map((e) => e.text) }],
14149
+ open: l,
14150
+ disabled: S,
14131
14151
  renderTrigger: /* @__PURE__ */ h(mm, {}),
14132
14152
  onClear: () => a?.([])
14133
14153
  }), /* @__PURE__ */ h(um, {
14134
- anchor: y,
14154
+ anchor: C,
14155
+ scrollRef: w,
14135
14156
  matchAnchorWidth: !0,
14136
14157
  minInlineSize: "256px",
14137
14158
  maxBlockSize: "264px",
@@ -14139,40 +14160,52 @@ function Yh({ id: e, label: t, options: n, filteredOptions: r, value: i, onChang
14139
14160
  className: Jh.search,
14140
14161
  children: /* @__PURE__ */ h(Tm, {
14141
14162
  value: o,
14142
- onChange: (e) => s?.(e.currentTarget.value),
14143
- placeholder: f,
14163
+ onChange: (e) => c?.(e.currentTarget.value),
14164
+ placeholder: m,
14144
14165
  prefix: /* @__PURE__ */ h(V, { type: "search" })
14145
14166
  })
14146
14167
  }),
14147
- children: S.length > 0 ? /* @__PURE__ */ h("div", {
14148
- className: Jh.options,
14149
- children: S.map((e) => {
14150
- let t = i.includes(e.value);
14151
- return /* @__PURE__ */ g("button", {
14152
- type: "button",
14153
- disabled: _ || e.disabled,
14154
- "data-selected": t || void 0,
14155
- className: p("aurora-base", "aurora-button", Jh.option),
14156
- onClick: () => a?.(t ? i.filter((t) => t !== e.value) : [...i, e.value]),
14157
- children: [/* @__PURE__ */ h("span", {
14158
- className: Jh.checkbox,
14159
- inert: !0,
14160
- children: /* @__PURE__ */ h(Sm, {
14161
- checked: t,
14162
- disabled: _ || e.disabled
14163
- })
14164
- }), /* @__PURE__ */ h("span", {
14165
- className: Jh["option-label"],
14166
- children: e.label
14167
- })]
14168
- }, e.value);
14169
- })
14170
- }) : _ ? /* @__PURE__ */ h("div", {
14171
- className: Jh.loading,
14172
- children: /* @__PURE__ */ h(Te, {})
14173
- }) : /* @__PURE__ */ h("div", {
14174
- className: Jh.empty,
14175
- children: m
14168
+ children: /* @__PURE__ */ g("div", {
14169
+ "aria-busy": v || x,
14170
+ children: [r.length > 0 ? /* @__PURE__ */ h("div", {
14171
+ className: Jh.options,
14172
+ children: r.map((e) => {
14173
+ let t = i.includes(e.value);
14174
+ return /* @__PURE__ */ g("button", {
14175
+ type: "button",
14176
+ disabled: v || e.disabled,
14177
+ "data-selected": t || void 0,
14178
+ className: p("aurora-base", "aurora-button", Jh.option),
14179
+ onClick: () => a?.(t ? i.filter((t) => t !== e.value) : [...i, e.value]),
14180
+ children: [/* @__PURE__ */ h("span", {
14181
+ className: Jh.checkbox,
14182
+ inert: !0,
14183
+ children: /* @__PURE__ */ h(Sm, {
14184
+ checked: t,
14185
+ disabled: v || e.disabled
14186
+ })
14187
+ }), /* @__PURE__ */ h("span", {
14188
+ className: Jh["option-label"],
14189
+ children: e.label
14190
+ })]
14191
+ }, e.value);
14192
+ })
14193
+ }) : v ? /* @__PURE__ */ h("div", {
14194
+ className: Jh.loading,
14195
+ children: /* @__PURE__ */ h(Te, {})
14196
+ }) : x ? null : /* @__PURE__ */ h("div", {
14197
+ className: Jh.empty,
14198
+ children: _
14199
+ }), (y || x) && /* @__PURE__ */ h("div", {
14200
+ ref: E,
14201
+ className: Jh.loadMore,
14202
+ children: x && /* @__PURE__ */ h("div", {
14203
+ className: Jh.loading,
14204
+ role: "status",
14205
+ "aria-label": "Loading more options",
14206
+ children: /* @__PURE__ */ h(Te, {})
14207
+ })
14208
+ })]
14176
14209
  })
14177
14210
  })]
14178
14211
  });
@@ -14214,14 +14247,17 @@ function Zh({ definition: e, filter: t, onChange: n }) {
14214
14247
  return /* @__PURE__ */ h(Yh, {
14215
14248
  label: e.label,
14216
14249
  disabled: e.disabled,
14250
+ selectedOptions: e.selectedOptions,
14217
14251
  options: e.options,
14218
- filteredOptions: e.filteredOptions,
14219
14252
  value: t?.type === "select" ? t.value : [],
14220
14253
  inputValue: e.inputValue,
14221
14254
  onInputChange: e.onInputChange,
14222
14255
  searchPlaceholder: e.searchPlaceholder,
14223
14256
  empty: e.empty,
14224
14257
  loading: e.loading,
14258
+ hasMore: e.hasMore,
14259
+ loadMore: e.loadMore,
14260
+ isLoadingMore: e.isLoadingMore,
14225
14261
  open: a && r,
14226
14262
  onOpenChange: i,
14227
14263
  onChange: (t) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orient-ai/aurora-ui",
3
- "version": "1.0.0-alpha.6",
3
+ "version": "1.0.0-alpha.7",
4
4
  "description": "Aurora UI",
5
5
  "private": false,
6
6
  "type": "module",