@nubase/frontend 0.1.21 → 0.1.23
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.d.mts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +79 -40
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +71 -32
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +3 -8
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -5912,7 +5912,7 @@ var textInputVariants = cva7([
|
|
|
5912
5912
|
"selection:bg-primary selection:text-primary-foreground",
|
|
5913
5913
|
// Focus State
|
|
5914
5914
|
"focus-visible:border-ring",
|
|
5915
|
-
"focus-visible:ring-ring/50",
|
|
5915
|
+
"focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
5916
5916
|
// Invalid State
|
|
5917
5917
|
"aria-invalid:border-destructive",
|
|
5918
5918
|
"aria-invalid:ring-destructive/20",
|
|
@@ -6554,7 +6554,7 @@ var SchemaFormBody = ({
|
|
|
6554
6554
|
" ",
|
|
6555
6555
|
metadataError.message
|
|
6556
6556
|
] }),
|
|
6557
|
-
/* @__PURE__ */ jsx32("div", { className: "flex-1 space-y-4", children: /* @__PURE__ */ jsx32(
|
|
6557
|
+
/* @__PURE__ */ jsx32("div", { className: "flex-1 space-y-4 pt-1", children: /* @__PURE__ */ jsx32(
|
|
6558
6558
|
SchemaFormVerticalLayout,
|
|
6559
6559
|
{
|
|
6560
6560
|
layout,
|
|
@@ -7790,10 +7790,11 @@ function useResourceViewQuery(resourceId, view, params, options) {
|
|
|
7790
7790
|
}
|
|
7791
7791
|
|
|
7792
7792
|
// src/hooks/useSchemaFilters.ts
|
|
7793
|
+
import { SEARCH_FIELD_NAME as SEARCH_FIELD_NAME2 } from "@nubase/core";
|
|
7793
7794
|
import { useCallback as useCallback7, useMemo as useMemo4, useState as useState10 } from "react";
|
|
7794
7795
|
|
|
7795
7796
|
// src/components/schema-filter-bar/introspect-schema.ts
|
|
7796
|
-
import { OptionalSchema as OptionalSchema5 } from "@nubase/core";
|
|
7797
|
+
import { OptionalSchema as OptionalSchema5, SEARCH_FIELD_NAME } from "@nubase/core";
|
|
7797
7798
|
function formatFieldName(name) {
|
|
7798
7799
|
return name.replace(/([A-Z])/g, " $1").replace(/^./, (str) => str.toUpperCase()).trim();
|
|
7799
7800
|
}
|
|
@@ -7823,6 +7824,9 @@ function introspectSchemaForFilters(schema, config) {
|
|
|
7823
7824
|
const descriptors = [];
|
|
7824
7825
|
const shape = schema._shape;
|
|
7825
7826
|
for (const [fieldName, fieldSchema] of Object.entries(shape)) {
|
|
7827
|
+
if (fieldName === SEARCH_FIELD_NAME) {
|
|
7828
|
+
continue;
|
|
7829
|
+
}
|
|
7826
7830
|
if (config?.excludeFields?.includes(fieldName)) {
|
|
7827
7831
|
continue;
|
|
7828
7832
|
}
|
|
@@ -7852,6 +7856,10 @@ function introspectSchemaForFilters(schema, config) {
|
|
|
7852
7856
|
|
|
7853
7857
|
// src/hooks/useSchemaFilters.ts
|
|
7854
7858
|
function useSchemaFilters(schema, options) {
|
|
7859
|
+
const hasTextSearch = useMemo4(() => {
|
|
7860
|
+
if (!schema) return false;
|
|
7861
|
+
return SEARCH_FIELD_NAME2 in schema._shape;
|
|
7862
|
+
}, [schema]);
|
|
7855
7863
|
const filterDescriptors = useMemo4(() => {
|
|
7856
7864
|
if (!schema) return [];
|
|
7857
7865
|
return introspectSchemaForFilters(schema, options);
|
|
@@ -7859,6 +7867,10 @@ function useSchemaFilters(schema, options) {
|
|
|
7859
7867
|
const [filterState, setFilterState] = useState10(
|
|
7860
7868
|
{}
|
|
7861
7869
|
);
|
|
7870
|
+
const [searchValue, setSearchValueState] = useState10("");
|
|
7871
|
+
const setSearchValue = useCallback7((value) => {
|
|
7872
|
+
setSearchValueState(value);
|
|
7873
|
+
}, []);
|
|
7862
7874
|
const setFilterValue = useCallback7((field, value) => {
|
|
7863
7875
|
setFilterState((prev) => ({
|
|
7864
7876
|
...prev,
|
|
@@ -7876,8 +7888,12 @@ function useSchemaFilters(schema, options) {
|
|
|
7876
7888
|
);
|
|
7877
7889
|
const clearFilters = useCallback7(() => {
|
|
7878
7890
|
setFilterState({});
|
|
7891
|
+
setSearchValueState("");
|
|
7879
7892
|
}, []);
|
|
7880
7893
|
const hasActiveFilters = useMemo4(() => {
|
|
7894
|
+
if (searchValue.trim() !== "") {
|
|
7895
|
+
return true;
|
|
7896
|
+
}
|
|
7881
7897
|
return Object.entries(filterState).some(([, value]) => {
|
|
7882
7898
|
if (value === void 0 || value === null || value === "") {
|
|
7883
7899
|
return false;
|
|
@@ -7887,9 +7903,12 @@ function useSchemaFilters(schema, options) {
|
|
|
7887
7903
|
}
|
|
7888
7904
|
return true;
|
|
7889
7905
|
});
|
|
7890
|
-
}, [filterState]);
|
|
7906
|
+
}, [filterState, searchValue]);
|
|
7891
7907
|
const getRequestParams = useCallback7(() => {
|
|
7892
7908
|
const params = {};
|
|
7909
|
+
if (searchValue.trim() !== "") {
|
|
7910
|
+
params[SEARCH_FIELD_NAME2] = searchValue.trim();
|
|
7911
|
+
}
|
|
7893
7912
|
for (const [key, value] of Object.entries(filterState)) {
|
|
7894
7913
|
if (value === void 0 || value === null || value === "") {
|
|
7895
7914
|
continue;
|
|
@@ -7900,7 +7919,7 @@ function useSchemaFilters(schema, options) {
|
|
|
7900
7919
|
params[key] = value;
|
|
7901
7920
|
}
|
|
7902
7921
|
return params;
|
|
7903
|
-
}, [filterState]);
|
|
7922
|
+
}, [filterState, searchValue]);
|
|
7904
7923
|
return {
|
|
7905
7924
|
filterState,
|
|
7906
7925
|
setFilterValue,
|
|
@@ -7908,7 +7927,10 @@ function useSchemaFilters(schema, options) {
|
|
|
7908
7927
|
clearFilters,
|
|
7909
7928
|
hasActiveFilters,
|
|
7910
7929
|
filterDescriptors,
|
|
7911
|
-
getRequestParams
|
|
7930
|
+
getRequestParams,
|
|
7931
|
+
searchValue,
|
|
7932
|
+
setSearchValue,
|
|
7933
|
+
hasTextSearch
|
|
7912
7934
|
};
|
|
7913
7935
|
}
|
|
7914
7936
|
|
|
@@ -14365,6 +14387,7 @@ var checkListCommand = {
|
|
|
14365
14387
|
};
|
|
14366
14388
|
|
|
14367
14389
|
// src/components/markdown-textarea/MarkdownTextArea.tsx
|
|
14390
|
+
import { cva as cva14 } from "class-variance-authority";
|
|
14368
14391
|
import { forwardRef as forwardRef18, useImperativeHandle as useImperativeHandle3, useRef as useRef19 } from "react";
|
|
14369
14392
|
|
|
14370
14393
|
// src/components/markdown-textarea/text-controller.ts
|
|
@@ -14478,6 +14501,27 @@ function canManipulateViaTextNodes(input) {
|
|
|
14478
14501
|
|
|
14479
14502
|
// src/components/markdown-textarea/MarkdownTextArea.tsx
|
|
14480
14503
|
import { jsx as jsx97 } from "react/jsx-runtime";
|
|
14504
|
+
var markdownTextAreaVariants = cva14([
|
|
14505
|
+
// Layout & Sizing
|
|
14506
|
+
"w-full min-h-[200px]",
|
|
14507
|
+
// Spacing & Borders
|
|
14508
|
+
"px-3 py-2 rounded-md border border-border",
|
|
14509
|
+
// Background & Text
|
|
14510
|
+
"bg-background text-foreground",
|
|
14511
|
+
"font-mono text-sm",
|
|
14512
|
+
// Resize behavior
|
|
14513
|
+
"resize-vertical",
|
|
14514
|
+
// Visual Effects
|
|
14515
|
+
"outline-none",
|
|
14516
|
+
// Placeholder
|
|
14517
|
+
"placeholder:text-muted-foreground",
|
|
14518
|
+
// Focus State
|
|
14519
|
+
"focus-visible:border-ring",
|
|
14520
|
+
"focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
14521
|
+
// Disabled State
|
|
14522
|
+
"disabled:opacity-50",
|
|
14523
|
+
"disabled:cursor-not-allowed"
|
|
14524
|
+
]);
|
|
14481
14525
|
var MarkdownTextArea = forwardRef18(({ className, ...props }, ref) => {
|
|
14482
14526
|
const textAreaRef = useRef19(null);
|
|
14483
14527
|
const textControllerRef = useRef19(void 0);
|
|
@@ -14506,17 +14550,7 @@ var MarkdownTextArea = forwardRef18(({ className, ...props }, ref) => {
|
|
|
14506
14550
|
"textarea",
|
|
14507
14551
|
{
|
|
14508
14552
|
ref: textAreaRef,
|
|
14509
|
-
className: cn(
|
|
14510
|
-
"w-full min-h-[200px] px-3 py-2",
|
|
14511
|
-
"bg-background text-foreground",
|
|
14512
|
-
"border border-border rounded-md",
|
|
14513
|
-
"resize-vertical",
|
|
14514
|
-
"focus:outline-none focus:ring-2 focus:ring-ring/20 focus:border-primary",
|
|
14515
|
-
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
14516
|
-
"placeholder:text-muted-foreground",
|
|
14517
|
-
"font-mono text-sm",
|
|
14518
|
-
className
|
|
14519
|
-
),
|
|
14553
|
+
className: cn(markdownTextAreaVariants({ className })),
|
|
14520
14554
|
...props
|
|
14521
14555
|
}
|
|
14522
14556
|
);
|
|
@@ -14685,7 +14719,7 @@ var MainNav = forwardRef19(
|
|
|
14685
14719
|
MainNav.displayName = "MainNav";
|
|
14686
14720
|
|
|
14687
14721
|
// src/components/navigation/main-nav/NavItemComponent.tsx
|
|
14688
|
-
import { cva as
|
|
14722
|
+
import { cva as cva15 } from "class-variance-authority";
|
|
14689
14723
|
|
|
14690
14724
|
// src/components/navigation/main-nav/SafeLink.tsx
|
|
14691
14725
|
import { jsx as jsx101 } from "react/jsx-runtime";
|
|
@@ -14707,7 +14741,7 @@ var SafeLink = ({ to, className, onClick, children }) => {
|
|
|
14707
14741
|
|
|
14708
14742
|
// src/components/navigation/main-nav/NavItemComponent.tsx
|
|
14709
14743
|
import { Fragment as Fragment9, jsx as jsx102, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
14710
|
-
var navItemVariants =
|
|
14744
|
+
var navItemVariants = cva15(
|
|
14711
14745
|
"flex items-center gap-3 px-3 py-2 text-sm font-medium transition-all duration-200 rounded-md group",
|
|
14712
14746
|
{
|
|
14713
14747
|
variants: {
|
|
@@ -15178,17 +15212,17 @@ import { useNavigate as useNavigate3 } from "@tanstack/react-router";
|
|
|
15178
15212
|
import { memo as memo9, useCallback as useCallback15, useEffect as useEffect15, useMemo as useMemo19, useState as useState30 } from "react";
|
|
15179
15213
|
|
|
15180
15214
|
// src/components/search-controls/LookupSelectFilter.tsx
|
|
15181
|
-
import { cva as
|
|
15215
|
+
import { cva as cva17 } from "class-variance-authority";
|
|
15182
15216
|
import { debounce } from "lodash-es";
|
|
15183
15217
|
import * as React9 from "react";
|
|
15184
15218
|
|
|
15185
15219
|
// src/components/search-controls/SearchFilterDropdown.tsx
|
|
15186
15220
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
15187
|
-
import { cva as
|
|
15221
|
+
import { cva as cva16 } from "class-variance-authority";
|
|
15188
15222
|
import { ChevronDownIcon, TypeIcon } from "lucide-react";
|
|
15189
15223
|
import * as React8 from "react";
|
|
15190
15224
|
import { jsx as jsx110, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
15191
|
-
var searchFilterTriggerVariants =
|
|
15225
|
+
var searchFilterTriggerVariants = cva16(
|
|
15192
15226
|
[
|
|
15193
15227
|
// Base - matching TextInput height/roundness
|
|
15194
15228
|
"inline-flex items-center gap-1.5 h-9 px-3 rounded-md",
|
|
@@ -15210,7 +15244,7 @@ var searchFilterTriggerVariants = cva15(
|
|
|
15210
15244
|
}
|
|
15211
15245
|
}
|
|
15212
15246
|
);
|
|
15213
|
-
var searchFilterContentVariants =
|
|
15247
|
+
var searchFilterContentVariants = cva16([
|
|
15214
15248
|
// Background & Border
|
|
15215
15249
|
"bg-popover text-popover-foreground",
|
|
15216
15250
|
"border rounded-md shadow-md",
|
|
@@ -15315,7 +15349,7 @@ SearchFilterDropdown.displayName = "SearchFilterDropdown";
|
|
|
15315
15349
|
|
|
15316
15350
|
// src/components/search-controls/LookupSelectFilter.tsx
|
|
15317
15351
|
import { jsx as jsx111, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
15318
|
-
var optionVariants3 =
|
|
15352
|
+
var optionVariants3 = cva17(
|
|
15319
15353
|
[
|
|
15320
15354
|
"flex items-center gap-2 px-3 py-2",
|
|
15321
15355
|
"cursor-pointer select-none",
|
|
@@ -15611,13 +15645,13 @@ var LookupSelectFilter = React9.forwardRef(
|
|
|
15611
15645
|
LookupSelectFilter.displayName = "LookupSelectFilter";
|
|
15612
15646
|
|
|
15613
15647
|
// src/components/search-controls/SearchFilterBar.tsx
|
|
15614
|
-
import { cva as
|
|
15648
|
+
import { cva as cva18 } from "class-variance-authority";
|
|
15615
15649
|
import { debounce as debounce2 } from "lodash-es";
|
|
15616
15650
|
import { Search as Search2, XIcon } from "lucide-react";
|
|
15617
15651
|
import * as React10 from "react";
|
|
15618
15652
|
import { jsx as jsx112, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
15619
|
-
var searchFilterBarVariants =
|
|
15620
|
-
var searchFilterBarInputVariants =
|
|
15653
|
+
var searchFilterBarVariants = cva18(["flex items-center gap-2", "flex-wrap"]);
|
|
15654
|
+
var searchFilterBarInputVariants = cva18([
|
|
15621
15655
|
// Layout & Sizing
|
|
15622
15656
|
"flex h-9 min-w-0",
|
|
15623
15657
|
// Spacing & Borders (pl-10 for search icon)
|
|
@@ -15639,7 +15673,7 @@ var searchFilterBarInputVariants = cva17([
|
|
|
15639
15673
|
"disabled:cursor-not-allowed",
|
|
15640
15674
|
"disabled:opacity-50"
|
|
15641
15675
|
]);
|
|
15642
|
-
var searchFilterBarClearButtonVariants =
|
|
15676
|
+
var searchFilterBarClearButtonVariants = cva18([
|
|
15643
15677
|
"inline-flex items-center gap-1 h-9 px-3",
|
|
15644
15678
|
"text-sm font-medium text-muted-foreground",
|
|
15645
15679
|
"hover:text-foreground",
|
|
@@ -15737,10 +15771,10 @@ var SearchFilterBar = React10.forwardRef(
|
|
|
15737
15771
|
SearchFilterBar.displayName = "SearchFilterBar";
|
|
15738
15772
|
|
|
15739
15773
|
// src/components/search-controls/SelectFilter.tsx
|
|
15740
|
-
import { cva as
|
|
15774
|
+
import { cva as cva19 } from "class-variance-authority";
|
|
15741
15775
|
import * as React11 from "react";
|
|
15742
15776
|
import { jsx as jsx113, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
15743
|
-
var optionVariants4 =
|
|
15777
|
+
var optionVariants4 = cva19(
|
|
15744
15778
|
[
|
|
15745
15779
|
// Layout
|
|
15746
15780
|
"flex items-center gap-2 px-3 py-2",
|
|
@@ -16247,7 +16281,10 @@ var ResourceSearchViewRenderer = (props) => {
|
|
|
16247
16281
|
clearFilters,
|
|
16248
16282
|
hasActiveFilters,
|
|
16249
16283
|
filterDescriptors,
|
|
16250
|
-
getRequestParams
|
|
16284
|
+
getRequestParams,
|
|
16285
|
+
searchValue,
|
|
16286
|
+
setSearchValue,
|
|
16287
|
+
hasTextSearch
|
|
16251
16288
|
} = useSchemaFilters(view.schemaFilter);
|
|
16252
16289
|
const mergedParams = useMemo19(() => {
|
|
16253
16290
|
const filterParams = getRequestParams();
|
|
@@ -16448,7 +16485,9 @@ var ResourceSearchViewRenderer = (props) => {
|
|
|
16448
16485
|
filterState,
|
|
16449
16486
|
onFilterChange: setFilterValue,
|
|
16450
16487
|
onClearFilters: clearFilters,
|
|
16451
|
-
showClearFilters: hasActiveFilters
|
|
16488
|
+
showClearFilters: hasActiveFilters,
|
|
16489
|
+
searchValue: hasTextSearch ? searchValue : "",
|
|
16490
|
+
onSearchChange: hasTextSearch ? setSearchValue : void 0
|
|
16452
16491
|
}
|
|
16453
16492
|
),
|
|
16454
16493
|
bulkActions.length > 0 && /* @__PURE__ */ jsx116(ActionBar, { actions: bulkActions }),
|