@tscircuit/cli 0.0.144 → 0.0.161
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/.github/workflows/formatbot.yml +41 -0
- package/.github/workflows/release.yml +6 -1
- package/.github/workflows/test.yml +2 -2
- package/.github/workflows/typecheck.yml +29 -0
- package/DEVELOPMENT.md +4 -1
- package/README.md +2 -6
- package/{dev-server-api/src → api}/db/generic-json-level.ts +4 -7
- package/{dev-server-api/src → api}/db/zod-level-db.ts +9 -9
- package/{dev-server-api/src → api/lib}/middlewares/with-db.ts +2 -2
- package/{dev-server-api/src → api/lib}/middlewares/with-debug-request-logging.ts +1 -1
- package/{dev-server-api/src → api/lib}/middlewares/with-error-response.ts +2 -2
- package/{dev-server-api → api}/routes/api/db/download.ts +3 -3
- package/{dev-server-api → api}/routes/api/dev_package_examples/create.ts +1 -1
- package/{dev-server-api → api}/routes/api/dev_package_examples/get.ts +3 -3
- package/{dev-server-api → api}/routes/api/dev_package_examples/list.ts +3 -3
- package/{dev-server-api → api}/routes/api/dev_package_examples/update.ts +4 -4
- package/{dev-server-api → api}/routes/api/dev_server/reset.ts +1 -1
- package/{dev-server-api → api}/routes/api/export_files/create.ts +2 -6
- package/{dev-server-api → api}/routes/api/export_files/download.ts +1 -3
- package/{dev-server-api → api}/routes/api/export_requests/create.ts +3 -4
- package/{dev-server-api → api}/routes/api/export_requests/get.ts +5 -8
- package/{dev-server-api → api}/routes/api/export_requests/list.ts +2 -3
- package/{dev-server-api → api}/routes/api/export_requests/update.ts +3 -5
- package/{dev-server-api/routes → api/routes/api}/health.ts +1 -1
- package/{dev-server-api → api}/routes/api/package_info/create.ts +1 -1
- package/{dev-server-api → api}/routes/api/package_info/get.ts +3 -2
- package/{dev-server-api/routes/api → api/routes}/health.ts +1 -1
- package/{dev-server-api → api}/routes/index.ts +2 -2
- package/{dev-server-api → api}/server.ts +2 -2
- package/api/static-routes.ts +24 -0
- package/{dev-server-api → api}/tests/fixtures/get-test-server.ts +2 -1
- package/api/tests/fixtures/start-server.ts +41 -0
- package/{dev-server-api → api}/tests/routes/dev_package_examples/create.test.ts +2 -2
- package/{dev-server-api → api}/tests/routes/dev_package_examples/get.test.ts +2 -2
- package/{dev-server-api → api}/tests/routes/dev_package_examples/list.test.ts +2 -2
- package/{dev-server-api → api}/tests/routes/dev_package_examples/update.test.ts +3 -3
- package/{dev-server-api → api}/tests/routes/export_files/create.test.ts +1 -1
- package/{dev-server-api → api}/tests/routes/export_files/download.test.ts +3 -3
- package/{dev-server-api → api}/tests/routes/export_requests/create.test.ts +2 -2
- package/{dev-server-api → api}/tests/routes/export_requests/get.test.ts +2 -2
- package/{dev-server-api → api}/tests/routes/export_requests/list.test.ts +1 -1
- package/{dev-server-api → api}/tests/routes/export_requests/update.test.ts +1 -1
- package/biome.json +49 -0
- package/bun.lockb +0 -0
- package/{lib → cli/lib}/cmd-fns/add.ts +2 -2
- package/{lib → cli/lib}/cmd-fns/auth-login.ts +2 -2
- package/{lib → cli/lib}/cmd-fns/dev/check-if-initialized.ts +1 -1
- package/{lib → cli/lib}/cmd-fns/dev/derive-selector-from-pcb-component-id.ts +1 -1
- package/{lib → cli/lib}/cmd-fns/dev/dev-server-request-handler.ts +5 -5
- package/{lib → cli/lib}/cmd-fns/dev/find-available-port.ts +7 -5
- package/{lib → cli/lib}/cmd-fns/dev/fulfill-export-requests.ts +27 -27
- package/{lib → cli/lib}/cmd-fns/dev/get-dev-server-axios.ts +3 -3
- package/{lib → cli/lib}/cmd-fns/dev/index.ts +4 -4
- package/{lib → cli/lib}/cmd-fns/dev/infer-export-name-from-source.ts +2 -2
- package/{lib → cli/lib}/cmd-fns/dev/soupify-and-upload-example-file.ts +6 -5
- package/{lib → cli/lib}/cmd-fns/dev/start-edit-event-watcher.ts +41 -42
- package/{lib → cli/lib}/cmd-fns/dev/start-export-request-watcher.ts +3 -4
- package/{lib → cli/lib}/cmd-fns/dev/start-fs-watcher.ts +2 -1
- package/{lib → cli/lib}/cmd-fns/dev/upload-examples-from-directory.ts +4 -3
- package/{lib → cli/lib}/cmd-fns/dev-server-fulfill-export-requests.ts +3 -3
- package/{lib → cli/lib}/cmd-fns/dev-server-upload.ts +3 -3
- package/{lib → cli/lib}/cmd-fns/export-gerbers.ts +2 -2
- package/cli/lib/cmd-fns/go.ts +14 -0
- package/{lib → cli/lib}/cmd-fns/index.ts +2 -0
- package/{lib → cli/lib}/cmd-fns/init/create-or-modify-npmrc.ts +2 -2
- package/{lib → cli/lib}/cmd-fns/init/get-generated-npmrc.ts +1 -1
- package/{lib → cli/lib}/cmd-fns/init/index.ts +13 -9
- package/{lib → cli/lib}/cmd-fns/install.ts +1 -1
- package/{lib → cli/lib}/cmd-fns/lint.ts +16 -10
- package/{lib → cli/lib}/cmd-fns/open.ts +1 -1
- package/{lib → cli/lib}/cmd-fns/package-examples-create.ts +2 -2
- package/{lib → cli/lib}/cmd-fns/package-files-create.ts +1 -1
- package/{lib → cli/lib}/cmd-fns/package-files-upload-directory.ts +1 -1
- package/{lib → cli/lib}/cmd-fns/package-releases-create.ts +1 -1
- package/{lib → cli/lib}/cmd-fns/package-releases-list.ts +1 -1
- package/{lib → cli/lib}/cmd-fns/publish/index.ts +34 -34
- package/{lib → cli/lib}/cmd-fns/remove.ts +2 -2
- package/cli/lib/cmd-fns/render.ts +45 -0
- package/{lib → cli/lib}/cmd-fns/soupify.ts +2 -2
- package/{lib → cli/lib}/cmd-fns/uninstall.ts +1 -1
- package/{lib → cli/lib}/cmd-fns/version.ts +7 -8
- package/{lib → cli/lib}/create-config-manager.ts +1 -1
- package/{lib → cli/lib}/export-fns/export-bom-csv.ts +3 -3
- package/{lib → cli/lib}/export-fns/export-gerbers.ts +6 -6
- package/{lib → cli/lib}/export-fns/export-pnp-csv.ts +3 -3
- package/{lib → cli/lib}/get-program.ts +37 -21
- package/{lib → cli/lib}/param-handlers/interact-for-package-release-id.ts +2 -3
- package/{lib → cli/lib}/param-handlers/interact-for-runtime.ts +1 -1
- package/{lib → cli/lib}/param-handlers/param-handler-type.ts +1 -1
- package/{lib → cli/lib}/posthog.ts +6 -7
- package/{lib → cli/lib}/soupify.ts +4 -4
- package/{lib → cli/lib}/util/app-context.ts +1 -1
- package/{lib → cli/lib}/util/create-context-and-run-program.ts +14 -10
- package/{lib → cli/lib}/util/get-all-package-files.ts +2 -2
- package/cli/lib/util/lint-project.ts +137 -0
- package/{tests → cli/tests}/init.test.ts +1 -1
- package/{tests → cli/tests}/open.test.ts +2 -1
- package/{tests → cli/tests}/soupify.test.ts +1 -1
- package/dist/cli.js +311 -310
- package/example-project/package.json +2 -11
- package/example-project/src/manual-edits.ts +34 -34
- package/{dev-server-frontend/src → frontend}/components/command-k.tsx +2 -2
- package/{dev-server-frontend/src → frontend}/components/dialogs/generic-export-dialog.tsx +6 -10
- package/{dev-server-frontend/src → frontend}/components/dialogs/gerber-export-dialog.tsx +5 -5
- package/{dev-server-frontend/src → frontend}/components/select-example-search.tsx +7 -7
- package/{dev-server-frontend/src → frontend}/components/ui/alert-dialog.tsx +7 -7
- package/{dev-server-frontend/src → frontend}/components/ui/alert.tsx +2 -2
- package/{dev-server-frontend/src → frontend}/components/ui/breadcrumb.tsx +2 -2
- package/{dev-server-frontend/src → frontend}/components/ui/button.tsx +3 -3
- package/{dev-server-frontend/src → frontend}/components/ui/card.tsx +2 -2
- package/{dev-server-frontend/src → frontend}/components/ui/command.tsx +7 -7
- package/{dev-server-frontend/src → frontend}/components/ui/context-menu.tsx +9 -9
- package/{dev-server-frontend/src → frontend}/components/ui/dialog.tsx +6 -6
- package/{dev-server-frontend/src → frontend}/components/ui/menubar.tsx +13 -13
- package/{dev-server-frontend/src → frontend}/components/ui/navigation-menu.tsx +7 -7
- package/{dev-server-frontend/src → frontend}/components/ui/popover.tsx +2 -2
- package/{dev-server-frontend/src → frontend}/components/ui/select.tsx +7 -7
- package/{dev-server-frontend/src → frontend}/components/ui/tabs.tsx +4 -4
- package/{dev-server-frontend/src → frontend}/components/ui/toggle-group.tsx +3 -3
- package/{dev-server-frontend/src → frontend}/components/ui/toggle.tsx +2 -2
- package/{dev-server-frontend/src → frontend}/components/ui/tooltip.tsx +2 -2
- package/{dev-server-frontend → frontend}/components.json +1 -1
- package/{dev-server-frontend/src → frontend}/hooks/use-active-dev-package-example-lite.ts +2 -2
- package/{dev-server-frontend → frontend}/index.html +1 -1
- package/{dev-server-frontend/src → frontend}/main.tsx +2 -2
- package/{dev-server-frontend → frontend}/tailwind.config.js +4 -7
- package/frontend/views/App.tsx +22 -0
- package/{dev-server-frontend/src → frontend/views}/Header.tsx +5 -5
- package/{dev-server-frontend/src → frontend/views}/HeaderMenu.tsx +51 -23
- package/{dev-server-frontend/src/ExampleContentView.tsx → frontend/views/MainContentView.tsx} +7 -7
- package/frontend/vite.config.ts +50 -0
- package/package.json +57 -18
- package/renovate.json +2 -4
- package/scripts/build-cli.ts +12 -0
- package/tsconfig.json +17 -108
- package/tsup.config.ts +3 -3
- package/.github/workflows/server-tests.yml +0 -31
- package/build-cli.ts +0 -14
- package/dev-server-api/bun.lockb +0 -0
- package/dev-server-api/edgespec.config.ts +0 -4
- package/dev-server-api/package.json +0 -23
- package/dev-server-api/src/db/create-schema.ts +0 -54
- package/dev-server-api/src/lib/public-mapping/public-map-export-file.ts +0 -17
- package/dev-server-api/src/lib/public-mapping/public-map-export-request.ts +0 -23
- package/dev-server-api/static-routes.ts +0 -24
- package/dev-server-api/tests/fixtures/start-server.ts +0 -20
- package/dev-server-api/tsconfig.json +0 -28
- package/dev-server-frontend/.eslintrc.cjs +0 -20
- package/dev-server-frontend/package-lock.json +0 -8970
- package/dev-server-frontend/package.json +0 -70
- package/dev-server-frontend/postcss.config.js +0 -6
- package/dev-server-frontend/src/App.tsx +0 -22
- package/dev-server-frontend/tsconfig.json +0 -29
- package/dev-server-frontend/tsconfig.node.json +0 -13
- package/dev-server-frontend/vite.config.ts +0 -23
- package/example-project/package-lock.json +0 -609
- package/lib/util/lint-project.ts +0 -112
- /package/{dev-server-api → api}/README.md +0 -0
- /package/{dev-server-api/src → api}/db/get-db.ts +0 -0
- /package/{dev-server-api/src → api}/db/schema.ts +0 -0
- /package/{dev-server-api → api}/index.ts +0 -0
- /package/{dev-server-api/src → api/lib}/with-winter-spec.ts +0 -0
- /package/{dev-server-api/src → api}/lib/zod/export_parameters.ts +0 -0
- /package/{dev-server-api → api}/tests/routes/health.test.ts +0 -0
- /package/{cli.ts → cli/cli.ts} +0 -0
- /package/{lib → cli/lib}/cmd-fns/auth-logout.ts +0 -0
- /package/{lib → cli/lib}/cmd-fns/auth-sessions-create.ts +0 -0
- /package/{lib → cli/lib}/cmd-fns/auth-sessions-get.ts +0 -0
- /package/{lib → cli/lib}/cmd-fns/auth-sessions-list.ts +0 -0
- /package/{lib → cli/lib}/cmd-fns/config-clear.ts +0 -0
- /package/{lib → cli/lib}/cmd-fns/config-print-config.ts +0 -0
- /package/{lib → cli/lib}/cmd-fns/config-reveal-location.ts +0 -0
- /package/{lib → cli/lib}/cmd-fns/config-set-log-requests.ts +0 -0
- /package/{lib → cli/lib}/cmd-fns/config-set-registry.ts +0 -0
- /package/{lib → cli/lib}/cmd-fns/config-set-runtime.ts +0 -0
- /package/{lib → cli/lib}/cmd-fns/config-set-session.ts +0 -0
- /package/{lib → cli/lib}/cmd-fns/dev/mark-all-examples-loading.ts +0 -0
- /package/{lib → cli/lib}/cmd-fns/dev/start-dev-server.ts +0 -0
- /package/{lib → cli/lib}/cmd-fns/init/get-generated-readme.ts +0 -0
- /package/{lib → cli/lib}/cmd-fns/init/get-generated-tsconfig.ts +0 -0
- /package/{lib → cli/lib}/cmd-fns/package-examples-get.ts +0 -0
- /package/{lib → cli/lib}/cmd-fns/package-examples-list.ts +0 -0
- /package/{lib → cli/lib}/cmd-fns/package-files-download.ts +0 -0
- /package/{lib → cli/lib}/cmd-fns/package-files-get.ts +0 -0
- /package/{lib → cli/lib}/cmd-fns/package-files-list.ts +0 -0
- /package/{lib → cli/lib}/cmd-fns/package-releases-get.ts +0 -0
- /package/{lib → cli/lib}/cmd-fns/package-releases-update.ts +0 -0
- /package/{lib → cli/lib}/cmd-fns/packages-create.ts +0 -0
- /package/{lib → cli/lib}/cmd-fns/packages-get.ts +0 -0
- /package/{lib → cli/lib}/cmd-fns/packages-list.ts +0 -0
- /package/{lib → cli/lib}/param-handlers/index.ts +0 -0
- /package/{lib → cli/lib}/param-handlers/interact-for-local-directory.ts +0 -0
- /package/{lib → cli/lib}/param-handlers/interact-for-local-file.ts +0 -0
- /package/{lib → cli/lib}/param-handlers/interact-for-package-example-id.ts +0 -0
- /package/{lib → cli/lib}/param-handlers/interact-for-package-name-with-version.ts +0 -0
- /package/{lib → cli/lib}/param-handlers/interact-for-package-name.ts +0 -0
- /package/{lib → cli/lib}/param-handlers/interact-for-registry-url.ts +0 -0
- /package/example-project/examples/{basic-bug.tsx → basic-chip.tsx} +0 -0
- /package/{dev-server-frontend → frontend}/README.md +0 -0
- /package/{dev-server-frontend → frontend}/bun.lockb +0 -0
- /package/{dev-server-frontend/src → frontend}/components/global-context-providers.tsx +0 -0
- /package/{dev-server-frontend/src → frontend}/hooks/toast-if-api-not-connected.ts +0 -0
- /package/{dev-server-frontend/src → frontend}/hooks/use-dev-package-examples.tsx +0 -0
- /package/{dev-server-frontend/src → frontend}/hooks/use-global-store.ts +0 -0
- /package/{dev-server-frontend/src → frontend}/index.css +0 -0
- /package/{dev-server-frontend/src → frontend}/lib/utils.ts +0 -0
- /package/{dev-server-frontend/src → frontend}/vite-env.d.ts +0 -0
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "example-project",
|
|
3
|
-
"
|
|
4
|
-
"type": "module"
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"update-deps": "bun add -f @tscircuit/builder@latest @tscircuit/react-fiber@latest @tscircuit/layout@latest"
|
|
8
|
-
},
|
|
9
|
-
"dependencies": {
|
|
10
|
-
"@tscircuit/builder": "^1.5.134",
|
|
11
|
-
"@tscircuit/layout": "^0.0.25",
|
|
12
|
-
"@tscircuit/react-fiber": "^1.1.29"
|
|
13
|
-
}
|
|
3
|
+
"description": "An example project for tscircuit, this package.json is required",
|
|
4
|
+
"type": "module"
|
|
14
5
|
}
|
|
@@ -15,43 +15,43 @@ export default {
|
|
|
15
15
|
|
|
16
16
|
// Manual pcb placements, added when you drag a footprint
|
|
17
17
|
pcb_placements: [
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
"relative_to": "group_center"
|
|
18
|
+
{
|
|
19
|
+
_edit_event_id: "0.6668756126702717",
|
|
20
|
+
selector: ".U2",
|
|
21
|
+
center: {
|
|
22
|
+
x: -5.004250626566417,
|
|
23
|
+
y: 0.13319298245614064,
|
|
26
24
|
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
relative_to: "group_center",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
_edit_event_id: "0.867524742177592",
|
|
29
|
+
selector: ".R1",
|
|
30
|
+
center: {
|
|
31
|
+
x: 2.8351077694235585,
|
|
32
|
+
y: 0,
|
|
35
33
|
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
relative_to: "group_center",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
_edit_event_id: "0.4555106760070762",
|
|
38
|
+
selector: ".C1",
|
|
39
|
+
center: {
|
|
40
|
+
x: 0,
|
|
41
|
+
y: 2.6666666666666665,
|
|
44
42
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
43
|
+
relative_to: "group_center",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
_edit_event_id: "0.6123290063979561",
|
|
47
|
+
selector: ".R2",
|
|
48
|
+
center: {
|
|
49
|
+
x: 13.457749922536511,
|
|
50
|
+
y: 5.576084911465589,
|
|
51
|
+
},
|
|
52
|
+
relative_to: "group_center",
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
55
|
manual_trace_hints: [],
|
|
56
56
|
edit_events: [],
|
|
57
57
|
}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
CommandList,
|
|
9
9
|
CommandShortcut,
|
|
10
10
|
} from "./ui/command"
|
|
11
|
-
import { useGlobalStore } from "
|
|
11
|
+
import { useGlobalStore } from "frontend/hooks/use-global-store"
|
|
12
12
|
import { useDevPackageExamples } from "../hooks/use-dev-package-examples"
|
|
13
13
|
import { CommandSeparator } from "cmdk"
|
|
14
14
|
|
|
@@ -71,7 +71,7 @@ export const CommandK = () => {
|
|
|
71
71
|
onSelect={() =>
|
|
72
72
|
close() &&
|
|
73
73
|
store.setActiveDevExamplePackageId(
|
|
74
|
-
ex.dev_package_example_id.toString()
|
|
74
|
+
ex.dev_package_example_id.toString(),
|
|
75
75
|
)
|
|
76
76
|
}
|
|
77
77
|
>
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { useMemo, useState } from "react"
|
|
2
2
|
import { Dialog } from "@headlessui/react"
|
|
3
|
-
import { useGlobalStore } from "
|
|
4
|
-
import { useActiveDevPackageExampleLite } from "
|
|
3
|
+
import { useGlobalStore } from "frontend/hooks/use-global-store"
|
|
4
|
+
import { useActiveDevPackageExampleLite } from "frontend/hooks/use-active-dev-package-example-lite"
|
|
5
5
|
import { Button } from "../ui/button"
|
|
6
6
|
import axios from "axios"
|
|
7
|
-
import {
|
|
8
|
-
ExportParameters,
|
|
9
|
-
ExportParametersInput,
|
|
10
|
-
export_parameters,
|
|
11
|
-
} from "@server/lib/zod/export_parameters"
|
|
7
|
+
import type { ExportParametersInput } from "api/lib/zod/export_parameters"
|
|
12
8
|
|
|
13
9
|
export const useGenericExportDialog = ({
|
|
14
10
|
exportFileName,
|
|
@@ -91,7 +87,7 @@ export const useGenericExportDialog = ({
|
|
|
91
87
|
} catch (e: any) {
|
|
92
88
|
console.error(e)
|
|
93
89
|
setExportError(
|
|
94
|
-
`${e.toString()}\n\n${e.response?.data?.error?.message}
|
|
90
|
+
`${e.toString()}\n\n${e.response?.data?.error?.message}`,
|
|
95
91
|
)
|
|
96
92
|
setIsExporting(false)
|
|
97
93
|
return
|
|
@@ -106,13 +102,13 @@ export const useGenericExportDialog = ({
|
|
|
106
102
|
export_request.file_summary[0].export_file_id
|
|
107
103
|
window.open(
|
|
108
104
|
`/api/export_files/download?export_file_id=${export_file_id}`,
|
|
109
|
-
"_blank"
|
|
105
|
+
"_blank",
|
|
110
106
|
)
|
|
111
107
|
setIsExporting(false)
|
|
112
108
|
} catch (e: any) {
|
|
113
109
|
console.error(e)
|
|
114
110
|
setExportError(
|
|
115
|
-
`${e.toString()}\n\n${e.response?.data?.error?.message}
|
|
111
|
+
`${e.toString()}\n\n${e.response?.data?.error?.message}`,
|
|
116
112
|
)
|
|
117
113
|
setIsExporting(false)
|
|
118
114
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useMemo, useState } from "react"
|
|
2
2
|
import { Dialog } from "@headlessui/react"
|
|
3
|
-
import { useGlobalStore } from "
|
|
4
|
-
import { useActiveDevPackageExampleLite } from "
|
|
3
|
+
import { useGlobalStore } from "frontend/hooks/use-global-store"
|
|
4
|
+
import { useActiveDevPackageExampleLite } from "frontend/hooks/use-active-dev-package-example-lite"
|
|
5
5
|
import { Button } from "../ui/button"
|
|
6
6
|
import axios from "axios"
|
|
7
7
|
|
|
@@ -67,7 +67,7 @@ export const useGerberExportDialog = () => {
|
|
|
67
67
|
} catch (e: any) {
|
|
68
68
|
console.error(e)
|
|
69
69
|
setExportError(
|
|
70
|
-
`${e.toString()}\n\n${e.response?.data?.error?.message}
|
|
70
|
+
`${e.toString()}\n\n${e.response?.data?.error?.message}`,
|
|
71
71
|
)
|
|
72
72
|
setIsExporting(false)
|
|
73
73
|
return
|
|
@@ -86,14 +86,14 @@ export const useGerberExportDialog = () => {
|
|
|
86
86
|
|
|
87
87
|
window.open(
|
|
88
88
|
`/api/export_files/download?export_file_id=${export_file_id}`,
|
|
89
|
-
"_blank"
|
|
89
|
+
"_blank",
|
|
90
90
|
)
|
|
91
91
|
|
|
92
92
|
setIsExporting(false)
|
|
93
93
|
} catch (e: any) {
|
|
94
94
|
console.error(e)
|
|
95
95
|
setExportError(
|
|
96
|
-
`${e.toString()}\n\n${e.response?.data?.error?.message}
|
|
96
|
+
`${e.toString()}\n\n${e.response?.data?.error?.message}`,
|
|
97
97
|
)
|
|
98
98
|
setIsExporting(false)
|
|
99
99
|
}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import * as React from "react"
|
|
4
4
|
import { CaretSortIcon, CheckIcon } from "@radix-ui/react-icons"
|
|
5
5
|
|
|
6
|
-
import { cn } from "
|
|
7
|
-
import { Button } from "
|
|
6
|
+
import { cn } from "frontend/lib/utils"
|
|
7
|
+
import { Button } from "frontend/components/ui/button"
|
|
8
8
|
import {
|
|
9
9
|
Command,
|
|
10
10
|
CommandEmpty,
|
|
@@ -13,15 +13,15 @@ import {
|
|
|
13
13
|
CommandItem,
|
|
14
14
|
CommandList,
|
|
15
15
|
CommandShortcut,
|
|
16
|
-
} from "
|
|
16
|
+
} from "frontend/components/ui/command"
|
|
17
17
|
import {
|
|
18
18
|
Popover,
|
|
19
19
|
PopoverContent,
|
|
20
20
|
PopoverTrigger,
|
|
21
|
-
} from "
|
|
22
|
-
import { useGlobalStore } from "
|
|
21
|
+
} from "frontend/components/ui/popover"
|
|
22
|
+
import { useGlobalStore } from "frontend/hooks/use-global-store"
|
|
23
23
|
import { useDevPackageExamples } from "../hooks/use-dev-package-examples"
|
|
24
|
-
import { useActiveDevPackageExampleLite } from "
|
|
24
|
+
import { useActiveDevPackageExampleLite } from "frontend/hooks/use-active-dev-package-example-lite"
|
|
25
25
|
|
|
26
26
|
export function inflatePackageExample(ex: any) {
|
|
27
27
|
if (!ex) return ex
|
|
@@ -97,7 +97,7 @@ export const SelectExampleSearch = () => {
|
|
|
97
97
|
value={example.searchable_id}
|
|
98
98
|
onSelect={() => {
|
|
99
99
|
setActiveDevExamplePackageId(
|
|
100
|
-
example.dev_package_example_id.toString()
|
|
100
|
+
example.dev_package_example_id.toString(),
|
|
101
101
|
)
|
|
102
102
|
setOpen(false)
|
|
103
103
|
}}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
2
|
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
|
|
3
3
|
|
|
4
|
-
import { cn } from "
|
|
5
|
-
import { buttonVariants } from "
|
|
4
|
+
import { cn } from "frontend/lib/utils"
|
|
5
|
+
import { buttonVariants } from "frontend/components/ui/button"
|
|
6
6
|
|
|
7
7
|
const AlertDialog = AlertDialogPrimitive.Root
|
|
8
8
|
|
|
@@ -17,7 +17,7 @@ const AlertDialogOverlay = React.forwardRef<
|
|
|
17
17
|
<AlertDialogPrimitive.Overlay
|
|
18
18
|
className={cn(
|
|
19
19
|
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
20
|
-
className
|
|
20
|
+
className,
|
|
21
21
|
)}
|
|
22
22
|
{...props}
|
|
23
23
|
ref={ref}
|
|
@@ -35,7 +35,7 @@ const AlertDialogContent = React.forwardRef<
|
|
|
35
35
|
ref={ref}
|
|
36
36
|
className={cn(
|
|
37
37
|
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
38
|
-
className
|
|
38
|
+
className,
|
|
39
39
|
)}
|
|
40
40
|
{...props}
|
|
41
41
|
/>
|
|
@@ -50,7 +50,7 @@ const AlertDialogHeader = ({
|
|
|
50
50
|
<div
|
|
51
51
|
className={cn(
|
|
52
52
|
"flex flex-col space-y-2 text-center sm:text-left",
|
|
53
|
-
className
|
|
53
|
+
className,
|
|
54
54
|
)}
|
|
55
55
|
{...props}
|
|
56
56
|
/>
|
|
@@ -64,7 +64,7 @@ const AlertDialogFooter = ({
|
|
|
64
64
|
<div
|
|
65
65
|
className={cn(
|
|
66
66
|
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
67
|
-
className
|
|
67
|
+
className,
|
|
68
68
|
)}
|
|
69
69
|
{...props}
|
|
70
70
|
/>
|
|
@@ -117,7 +117,7 @@ const AlertDialogCancel = React.forwardRef<
|
|
|
117
117
|
className={cn(
|
|
118
118
|
buttonVariants({ variant: "outline" }),
|
|
119
119
|
"mt-2 sm:mt-0",
|
|
120
|
-
className
|
|
120
|
+
className,
|
|
121
121
|
)}
|
|
122
122
|
{...props}
|
|
123
123
|
/>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
2
|
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
3
|
|
|
4
|
-
import { cn } from "
|
|
4
|
+
import { cn } from "frontend/lib/utils"
|
|
5
5
|
|
|
6
6
|
const alertVariants = cva(
|
|
7
7
|
"relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",
|
|
@@ -16,7 +16,7 @@ const alertVariants = cva(
|
|
|
16
16
|
defaultVariants: {
|
|
17
17
|
variant: "default",
|
|
18
18
|
},
|
|
19
|
-
}
|
|
19
|
+
},
|
|
20
20
|
)
|
|
21
21
|
|
|
22
22
|
const Alert = React.forwardRef<
|
|
@@ -2,7 +2,7 @@ import * as React from "react"
|
|
|
2
2
|
import { ChevronRightIcon, DotsHorizontalIcon } from "@radix-ui/react-icons"
|
|
3
3
|
import { Slot } from "@radix-ui/react-slot"
|
|
4
4
|
|
|
5
|
-
import { cn } from "
|
|
5
|
+
import { cn } from "frontend/lib/utils"
|
|
6
6
|
|
|
7
7
|
const Breadcrumb = React.forwardRef<
|
|
8
8
|
HTMLElement,
|
|
@@ -20,7 +20,7 @@ const BreadcrumbList = React.forwardRef<
|
|
|
20
20
|
ref={ref}
|
|
21
21
|
className={cn(
|
|
22
22
|
"flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",
|
|
23
|
-
className
|
|
23
|
+
className,
|
|
24
24
|
)}
|
|
25
25
|
{...props}
|
|
26
26
|
/>
|
|
@@ -2,7 +2,7 @@ import * as React from "react"
|
|
|
2
2
|
import { Slot } from "@radix-ui/react-slot"
|
|
3
3
|
import { cva, type VariantProps } from "class-variance-authority"
|
|
4
4
|
|
|
5
|
-
import { cn } from "
|
|
5
|
+
import { cn } from "frontend/lib/utils"
|
|
6
6
|
|
|
7
7
|
const buttonVariants = cva(
|
|
8
8
|
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
|
|
@@ -31,7 +31,7 @@ const buttonVariants = cva(
|
|
|
31
31
|
variant: "default",
|
|
32
32
|
size: "default",
|
|
33
33
|
},
|
|
34
|
-
}
|
|
34
|
+
},
|
|
35
35
|
)
|
|
36
36
|
|
|
37
37
|
export interface ButtonProps
|
|
@@ -50,7 +50,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
50
50
|
{...props}
|
|
51
51
|
/>
|
|
52
52
|
)
|
|
53
|
-
}
|
|
53
|
+
},
|
|
54
54
|
)
|
|
55
55
|
Button.displayName = "Button"
|
|
56
56
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
2
|
|
|
3
|
-
import { cn } from "
|
|
3
|
+
import { cn } from "frontend/lib/utils"
|
|
4
4
|
|
|
5
5
|
const Card = React.forwardRef<
|
|
6
6
|
HTMLDivElement,
|
|
@@ -10,7 +10,7 @@ const Card = React.forwardRef<
|
|
|
10
10
|
ref={ref}
|
|
11
11
|
className={cn(
|
|
12
12
|
"rounded-xl border bg-card text-card-foreground shadow",
|
|
13
|
-
className
|
|
13
|
+
className,
|
|
14
14
|
)}
|
|
15
15
|
{...props}
|
|
16
16
|
/>
|
|
@@ -3,8 +3,8 @@ import { type DialogProps } from "@radix-ui/react-dialog"
|
|
|
3
3
|
import { MagnifyingGlassIcon } from "@radix-ui/react-icons"
|
|
4
4
|
import { Command as CommandPrimitive } from "cmdk"
|
|
5
5
|
|
|
6
|
-
import { cn } from "
|
|
7
|
-
import { Dialog, DialogContent } from "
|
|
6
|
+
import { cn } from "frontend/lib/utils"
|
|
7
|
+
import { Dialog, DialogContent } from "frontend/components/ui/dialog"
|
|
8
8
|
|
|
9
9
|
const Command = React.forwardRef<
|
|
10
10
|
React.ElementRef<typeof CommandPrimitive>,
|
|
@@ -14,7 +14,7 @@ const Command = React.forwardRef<
|
|
|
14
14
|
ref={ref}
|
|
15
15
|
className={cn(
|
|
16
16
|
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
|
|
17
|
-
className
|
|
17
|
+
className,
|
|
18
18
|
)}
|
|
19
19
|
{...props}
|
|
20
20
|
/>
|
|
@@ -45,7 +45,7 @@ const CommandInput = React.forwardRef<
|
|
|
45
45
|
ref={ref}
|
|
46
46
|
className={cn(
|
|
47
47
|
"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
48
|
-
className
|
|
48
|
+
className,
|
|
49
49
|
)}
|
|
50
50
|
{...props}
|
|
51
51
|
/>
|
|
@@ -88,7 +88,7 @@ const CommandGroup = React.forwardRef<
|
|
|
88
88
|
ref={ref}
|
|
89
89
|
className={cn(
|
|
90
90
|
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
|
|
91
|
-
className
|
|
91
|
+
className,
|
|
92
92
|
)}
|
|
93
93
|
{...props}
|
|
94
94
|
/>
|
|
@@ -116,7 +116,7 @@ const CommandItem = React.forwardRef<
|
|
|
116
116
|
ref={ref}
|
|
117
117
|
className={cn(
|
|
118
118
|
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-[selected='true']:bg-accent aria-[selected='true']:text-accent-foreground data-[disabled='true']:pointer-events-none data-[disabled='true']:opacity-50",
|
|
119
|
-
className
|
|
119
|
+
className,
|
|
120
120
|
)}
|
|
121
121
|
{...props}
|
|
122
122
|
/>
|
|
@@ -132,7 +132,7 @@ const CommandShortcut = ({
|
|
|
132
132
|
<span
|
|
133
133
|
className={cn(
|
|
134
134
|
"ml-auto text-xs tracking-widest text-muted-foreground",
|
|
135
|
-
className
|
|
135
|
+
className,
|
|
136
136
|
)}
|
|
137
137
|
{...props}
|
|
138
138
|
/>
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
DotFilledIcon,
|
|
7
7
|
} from "@radix-ui/react-icons"
|
|
8
8
|
|
|
9
|
-
import { cn } from "
|
|
9
|
+
import { cn } from "frontend/lib/utils"
|
|
10
10
|
|
|
11
11
|
const ContextMenu = ContextMenuPrimitive.Root
|
|
12
12
|
|
|
@@ -31,7 +31,7 @@ const ContextMenuSubTrigger = React.forwardRef<
|
|
|
31
31
|
className={cn(
|
|
32
32
|
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
|
|
33
33
|
inset && "pl-8",
|
|
34
|
-
className
|
|
34
|
+
className,
|
|
35
35
|
)}
|
|
36
36
|
{...props}
|
|
37
37
|
>
|
|
@@ -49,7 +49,7 @@ const ContextMenuSubContent = React.forwardRef<
|
|
|
49
49
|
ref={ref}
|
|
50
50
|
className={cn(
|
|
51
51
|
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
52
|
-
className
|
|
52
|
+
className,
|
|
53
53
|
)}
|
|
54
54
|
{...props}
|
|
55
55
|
/>
|
|
@@ -65,7 +65,7 @@ const ContextMenuContent = React.forwardRef<
|
|
|
65
65
|
ref={ref}
|
|
66
66
|
className={cn(
|
|
67
67
|
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
68
|
-
className
|
|
68
|
+
className,
|
|
69
69
|
)}
|
|
70
70
|
{...props}
|
|
71
71
|
/>
|
|
@@ -84,7 +84,7 @@ const ContextMenuItem = React.forwardRef<
|
|
|
84
84
|
className={cn(
|
|
85
85
|
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
86
86
|
inset && "pl-8",
|
|
87
|
-
className
|
|
87
|
+
className,
|
|
88
88
|
)}
|
|
89
89
|
{...props}
|
|
90
90
|
/>
|
|
@@ -99,7 +99,7 @@ const ContextMenuCheckboxItem = React.forwardRef<
|
|
|
99
99
|
ref={ref}
|
|
100
100
|
className={cn(
|
|
101
101
|
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
102
|
-
className
|
|
102
|
+
className,
|
|
103
103
|
)}
|
|
104
104
|
checked={checked}
|
|
105
105
|
{...props}
|
|
@@ -123,7 +123,7 @@ const ContextMenuRadioItem = React.forwardRef<
|
|
|
123
123
|
ref={ref}
|
|
124
124
|
className={cn(
|
|
125
125
|
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
126
|
-
className
|
|
126
|
+
className,
|
|
127
127
|
)}
|
|
128
128
|
{...props}
|
|
129
129
|
>
|
|
@@ -148,7 +148,7 @@ const ContextMenuLabel = React.forwardRef<
|
|
|
148
148
|
className={cn(
|
|
149
149
|
"px-2 py-1.5 text-sm font-semibold text-foreground",
|
|
150
150
|
inset && "pl-8",
|
|
151
|
-
className
|
|
151
|
+
className,
|
|
152
152
|
)}
|
|
153
153
|
{...props}
|
|
154
154
|
/>
|
|
@@ -175,7 +175,7 @@ const ContextMenuShortcut = ({
|
|
|
175
175
|
<span
|
|
176
176
|
className={cn(
|
|
177
177
|
"ml-auto text-xs tracking-widest text-muted-foreground",
|
|
178
|
-
className
|
|
178
|
+
className,
|
|
179
179
|
)}
|
|
180
180
|
{...props}
|
|
181
181
|
/>
|
|
@@ -2,7 +2,7 @@ import * as React from "react"
|
|
|
2
2
|
import * as DialogPrimitive from "@radix-ui/react-dialog"
|
|
3
3
|
import { Cross2Icon } from "@radix-ui/react-icons"
|
|
4
4
|
|
|
5
|
-
import { cn } from "
|
|
5
|
+
import { cn } from "frontend/lib/utils"
|
|
6
6
|
|
|
7
7
|
const Dialog = DialogPrimitive.Root
|
|
8
8
|
|
|
@@ -20,7 +20,7 @@ const DialogOverlay = React.forwardRef<
|
|
|
20
20
|
ref={ref}
|
|
21
21
|
className={cn(
|
|
22
22
|
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
23
|
-
className
|
|
23
|
+
className,
|
|
24
24
|
)}
|
|
25
25
|
{...props}
|
|
26
26
|
/>
|
|
@@ -37,7 +37,7 @@ const DialogContent = React.forwardRef<
|
|
|
37
37
|
ref={ref}
|
|
38
38
|
className={cn(
|
|
39
39
|
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
40
|
-
className
|
|
40
|
+
className,
|
|
41
41
|
)}
|
|
42
42
|
{...props}
|
|
43
43
|
>
|
|
@@ -58,7 +58,7 @@ const DialogHeader = ({
|
|
|
58
58
|
<div
|
|
59
59
|
className={cn(
|
|
60
60
|
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
61
|
-
className
|
|
61
|
+
className,
|
|
62
62
|
)}
|
|
63
63
|
{...props}
|
|
64
64
|
/>
|
|
@@ -72,7 +72,7 @@ const DialogFooter = ({
|
|
|
72
72
|
<div
|
|
73
73
|
className={cn(
|
|
74
74
|
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
75
|
-
className
|
|
75
|
+
className,
|
|
76
76
|
)}
|
|
77
77
|
{...props}
|
|
78
78
|
/>
|
|
@@ -87,7 +87,7 @@ const DialogTitle = React.forwardRef<
|
|
|
87
87
|
ref={ref}
|
|
88
88
|
className={cn(
|
|
89
89
|
"text-lg font-semibold leading-none tracking-tight",
|
|
90
|
-
className
|
|
90
|
+
className,
|
|
91
91
|
)}
|
|
92
92
|
{...props}
|
|
93
93
|
/>
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "@radix-ui/react-icons"
|
|
7
7
|
import * as MenubarPrimitive from "@radix-ui/react-menubar"
|
|
8
8
|
|
|
9
|
-
import { cn } from "
|
|
9
|
+
import { cn } from "frontend/lib/utils"
|
|
10
10
|
|
|
11
11
|
const MenubarMenu = MenubarPrimitive.Menu
|
|
12
12
|
|
|
@@ -26,7 +26,7 @@ const Menubar = React.forwardRef<
|
|
|
26
26
|
ref={ref}
|
|
27
27
|
className={cn(
|
|
28
28
|
"flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm",
|
|
29
|
-
className
|
|
29
|
+
className,
|
|
30
30
|
)}
|
|
31
31
|
{...props}
|
|
32
32
|
/>
|
|
@@ -41,7 +41,7 @@ const MenubarTrigger = React.forwardRef<
|
|
|
41
41
|
ref={ref}
|
|
42
42
|
className={cn(
|
|
43
43
|
"flex cursor-default select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
|
|
44
|
-
className
|
|
44
|
+
className,
|
|
45
45
|
)}
|
|
46
46
|
{...props}
|
|
47
47
|
/>
|
|
@@ -59,7 +59,7 @@ const MenubarSubTrigger = React.forwardRef<
|
|
|
59
59
|
className={cn(
|
|
60
60
|
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
|
|
61
61
|
inset && "pl-8",
|
|
62
|
-
className
|
|
62
|
+
className,
|
|
63
63
|
)}
|
|
64
64
|
{...props}
|
|
65
65
|
>
|
|
@@ -77,7 +77,7 @@ const MenubarSubContent = React.forwardRef<
|
|
|
77
77
|
ref={ref}
|
|
78
78
|
className={cn(
|
|
79
79
|
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
80
|
-
className
|
|
80
|
+
className,
|
|
81
81
|
)}
|
|
82
82
|
{...props}
|
|
83
83
|
/>
|
|
@@ -90,7 +90,7 @@ const MenubarContent = React.forwardRef<
|
|
|
90
90
|
>(
|
|
91
91
|
(
|
|
92
92
|
{ className, align = "start", alignOffset = -4, sideOffset = 8, ...props },
|
|
93
|
-
ref
|
|
93
|
+
ref,
|
|
94
94
|
) => (
|
|
95
95
|
<MenubarPrimitive.Portal>
|
|
96
96
|
<MenubarPrimitive.Content
|
|
@@ -100,12 +100,12 @@ const MenubarContent = React.forwardRef<
|
|
|
100
100
|
sideOffset={sideOffset}
|
|
101
101
|
className={cn(
|
|
102
102
|
"z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
103
|
-
className
|
|
103
|
+
className,
|
|
104
104
|
)}
|
|
105
105
|
{...props}
|
|
106
106
|
/>
|
|
107
107
|
</MenubarPrimitive.Portal>
|
|
108
|
-
)
|
|
108
|
+
),
|
|
109
109
|
)
|
|
110
110
|
MenubarContent.displayName = MenubarPrimitive.Content.displayName
|
|
111
111
|
|
|
@@ -120,7 +120,7 @@ const MenubarItem = React.forwardRef<
|
|
|
120
120
|
className={cn(
|
|
121
121
|
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
122
122
|
inset && "pl-8",
|
|
123
|
-
className
|
|
123
|
+
className,
|
|
124
124
|
)}
|
|
125
125
|
{...props}
|
|
126
126
|
/>
|
|
@@ -135,7 +135,7 @@ const MenubarCheckboxItem = React.forwardRef<
|
|
|
135
135
|
ref={ref}
|
|
136
136
|
className={cn(
|
|
137
137
|
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
138
|
-
className
|
|
138
|
+
className,
|
|
139
139
|
)}
|
|
140
140
|
checked={checked}
|
|
141
141
|
{...props}
|
|
@@ -158,7 +158,7 @@ const MenubarRadioItem = React.forwardRef<
|
|
|
158
158
|
ref={ref}
|
|
159
159
|
className={cn(
|
|
160
160
|
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
161
|
-
className
|
|
161
|
+
className,
|
|
162
162
|
)}
|
|
163
163
|
{...props}
|
|
164
164
|
>
|
|
@@ -183,7 +183,7 @@ const MenubarLabel = React.forwardRef<
|
|
|
183
183
|
className={cn(
|
|
184
184
|
"px-2 py-1.5 text-sm font-semibold",
|
|
185
185
|
inset && "pl-8",
|
|
186
|
-
className
|
|
186
|
+
className,
|
|
187
187
|
)}
|
|
188
188
|
{...props}
|
|
189
189
|
/>
|
|
@@ -210,7 +210,7 @@ const MenubarShortcut = ({
|
|
|
210
210
|
<span
|
|
211
211
|
className={cn(
|
|
212
212
|
"ml-auto text-xs tracking-widest text-muted-foreground",
|
|
213
|
-
className
|
|
213
|
+
className,
|
|
214
214
|
)}
|
|
215
215
|
{...props}
|
|
216
216
|
/>
|