@cfast/joy 0.0.1 → 0.1.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Daniel Schmidt
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ReactNode, ReactElement } from 'react';
2
- import { ButtonProps } from '@mui/joy/Button';
2
+ import { ButtonProps } from "@mui/joy";
3
3
  import { ActionHookResult } from '@cfast/actions/client';
4
4
  import { WhenForbidden, ConfirmOptions, ConfirmDialogSlotProps, FormStatusProps, EmptyStateProps, BreadcrumbItem, TabItem, AppShellProps, NavigationItem, UserMenuProps, DataTableProps, FilterBarProps, BulkAction, DropZoneProps, ImagePreviewProps, FileListProps, ListViewProps, DetailViewProps, AvatarWithInitialsProps, RoleBadgeProps, ImpersonationBannerProps } from '@cfast/ui';
5
5
  export { PermissionGate } from '@cfast/ui';
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // src/action-button.tsx
2
2
  import "react";
3
- import JoyButton from "@mui/joy/Button";
4
- import JoyTooltip from "@mui/joy/Tooltip";
3
+ import { Button as JoyButton } from "@mui/joy";
4
+ import { Tooltip as JoyTooltip } from "@mui/joy";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  function ActionButton({
7
7
  action,
@@ -42,11 +42,11 @@ function ActionButton({
42
42
 
43
43
  // src/confirm-dialog.tsx
44
44
  import "react";
45
- import Modal from "@mui/joy/Modal";
46
- import ModalDialog from "@mui/joy/ModalDialog";
47
- import Typography from "@mui/joy/Typography";
48
- import Button from "@mui/joy/Button";
49
- import Stack from "@mui/joy/Stack";
45
+ import { Modal } from "@mui/joy";
46
+ import { ModalDialog } from "@mui/joy";
47
+ import { Typography } from "@mui/joy";
48
+ import { Button } from "@mui/joy";
49
+ import { Stack } from "@mui/joy";
50
50
  import { jsx as jsx2, jsxs } from "react/jsx-runtime";
51
51
  function ConfirmDialog({
52
52
  open,
@@ -108,8 +108,8 @@ function ToastProvider({ children }) {
108
108
 
109
109
  // src/form-status.tsx
110
110
  import "react";
111
- import Alert from "@mui/joy/Alert";
112
- import Stack2 from "@mui/joy/Stack";
111
+ import { Alert } from "@mui/joy";
112
+ import { Stack as Stack2 } from "@mui/joy";
113
113
  import { jsx as jsx4 } from "react/jsx-runtime";
114
114
  function FormStatus({ data }) {
115
115
  if (!data) return null;
@@ -140,9 +140,9 @@ function FormStatus({ data }) {
140
140
 
141
141
  // src/empty-state.tsx
142
142
  import "react";
143
- import Typography2 from "@mui/joy/Typography";
144
- import Button2 from "@mui/joy/Button";
145
- import Stack3 from "@mui/joy/Stack";
143
+ import { Typography as Typography2 } from "@mui/joy";
144
+ import { Button as Button2 } from "@mui/joy";
145
+ import { Stack as Stack3 } from "@mui/joy";
146
146
  import { useActionStatus } from "@cfast/ui";
147
147
  import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
148
148
  function EmptyState({
@@ -191,7 +191,7 @@ function EmptyStateWithAction({
191
191
 
192
192
  // src/navigation-progress.tsx
193
193
  import "react";
194
- import LinearProgress from "@mui/joy/LinearProgress";
194
+ import { LinearProgress } from "@mui/joy";
195
195
  import { useNavigation } from "react-router";
196
196
  import { jsx as jsx6 } from "react/jsx-runtime";
197
197
  function NavigationProgress() {
@@ -218,10 +218,10 @@ function NavigationProgress() {
218
218
 
219
219
  // src/page-container.tsx
220
220
  import "react";
221
- import Typography3 from "@mui/joy/Typography";
222
- import Breadcrumbs from "@mui/joy/Breadcrumbs";
221
+ import { Typography as Typography3 } from "@mui/joy";
222
+ import { Breadcrumbs } from "@mui/joy";
223
223
  import { Link } from "react-router";
224
- import Stack4 from "@mui/joy/Stack";
224
+ import { Stack as Stack4 } from "@mui/joy";
225
225
  import { Fragment, jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
226
226
  function PageContainer({
227
227
  title,
@@ -244,10 +244,10 @@ function PageContainer({
244
244
 
245
245
  // src/app-shell.tsx
246
246
  import "react";
247
- import Sheet from "@mui/joy/Sheet";
248
- import List from "@mui/joy/List";
249
- import ListItem from "@mui/joy/ListItem";
250
- import ListItemButton from "@mui/joy/ListItemButton";
247
+ import { Sheet } from "@mui/joy";
248
+ import { List } from "@mui/joy";
249
+ import { ListItem } from "@mui/joy";
250
+ import { ListItemButton } from "@mui/joy";
251
251
  import { Link as Link2 } from "react-router";
252
252
  import { useActionStatus as useActionStatus2 } from "@cfast/ui";
253
253
  import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
@@ -322,19 +322,19 @@ AppShell.Header = AppShellHeader;
322
322
 
323
323
  // src/user-menu.tsx
324
324
  import "react";
325
- import Avatar from "@mui/joy/Avatar";
326
- import Dropdown from "@mui/joy/Dropdown";
327
- import Menu from "@mui/joy/Menu";
328
- import MenuItem from "@mui/joy/MenuItem";
329
- import MenuButton from "@mui/joy/MenuButton";
330
- import IconButton from "@mui/joy/IconButton";
325
+ import { Avatar } from "@mui/joy";
326
+ import { Dropdown } from "@mui/joy";
327
+ import { Menu } from "@mui/joy";
328
+ import { MenuItem } from "@mui/joy";
329
+ import { MenuButton } from "@mui/joy";
330
+ import { IconButton } from "@mui/joy";
331
331
  import { Link as Link3 } from "react-router";
332
332
  import { useCurrentUser } from "@cfast/auth/client";
333
333
  import { getInitials, useActionStatus as useActionStatus3 } from "@cfast/ui";
334
334
 
335
335
  // src/role-badge.tsx
336
336
  import "react";
337
- import Chip from "@mui/joy/Chip";
337
+ import { Chip } from "@mui/joy";
338
338
  import { jsx as jsx9 } from "react/jsx-runtime";
339
339
  var VALID_COLORS = /* @__PURE__ */ new Set(["primary", "neutral", "danger", "success", "warning"]);
340
340
  var defaultColors = {
@@ -389,9 +389,9 @@ function PermissionFilteredLink({ link }) {
389
389
 
390
390
  // src/data-table.tsx
391
391
  import { useState, useCallback as useCallback2 } from "react";
392
- import JoyTable from "@mui/joy/Table";
393
- import JoySheet from "@mui/joy/Sheet";
394
- import JoyCheckbox from "@mui/joy/Checkbox";
392
+ import { Table as JoyTable } from "@mui/joy";
393
+ import { Sheet as JoySheet } from "@mui/joy";
394
+ import { Checkbox as JoyCheckbox } from "@mui/joy";
395
395
  import { getField, getRecordId } from "@cfast/ui";
396
396
  import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
397
397
  function normalizeColumns(columns) {
@@ -508,10 +508,10 @@ function defaultGetId(row) {
508
508
  // src/filter-bar.tsx
509
509
  import { useCallback as useCallback3 } from "react";
510
510
  import { useSearchParams, useNavigate, useLocation } from "react-router";
511
- import JoyInput from "@mui/joy/Input";
512
- import JoySelect from "@mui/joy/Select";
513
- import JoyOption from "@mui/joy/Option";
514
- import JoyStack from "@mui/joy/Stack";
511
+ import { Input as JoyInput } from "@mui/joy";
512
+ import { Select as JoySelect } from "@mui/joy";
513
+ import { Option as JoyOption } from "@mui/joy";
514
+ import { Stack as JoyStack } from "@mui/joy";
515
515
  import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
516
516
  function FilterBar({
517
517
  filters,
@@ -595,10 +595,10 @@ function JoyFilterInput({
595
595
 
596
596
  // src/bulk-action-bar.tsx
597
597
  import "react";
598
- import JoySheet2 from "@mui/joy/Sheet";
599
- import JoyStack2 from "@mui/joy/Stack";
600
- import JoyButton2 from "@mui/joy/Button";
601
- import JoyTypography from "@mui/joy/Typography";
598
+ import { Sheet as JoySheet2 } from "@mui/joy";
599
+ import { Stack as JoyStack2 } from "@mui/joy";
600
+ import { Button as JoyButton2 } from "@mui/joy";
601
+ import { Typography as JoyTypography } from "@mui/joy";
602
602
  import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
603
603
  function BulkActionBar({
604
604
  selectedCount,
@@ -656,9 +656,9 @@ function BulkActionBar({
656
656
 
657
657
  // src/drop-zone.tsx
658
658
  import { useState as useState2, useCallback as useCallback4, useRef } from "react";
659
- import JoySheet3 from "@mui/joy/Sheet";
660
- import JoyTypography2 from "@mui/joy/Typography";
661
- import JoyLinearProgress from "@mui/joy/LinearProgress";
659
+ import { Sheet as JoySheet3 } from "@mui/joy";
660
+ import { Typography as JoyTypography2 } from "@mui/joy";
661
+ import { LinearProgress as JoyLinearProgress } from "@mui/joy";
662
662
  import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
663
663
  function DropZone({
664
664
  upload,
@@ -748,8 +748,8 @@ function DropZone({
748
748
 
749
749
  // src/image-preview.tsx
750
750
  import "react";
751
- import JoyAspectRatio from "@mui/joy/AspectRatio";
752
- import JoyTypography3 from "@mui/joy/Typography";
751
+ import { AspectRatio as JoyAspectRatio } from "@mui/joy";
752
+ import { Typography as JoyTypography3 } from "@mui/joy";
753
753
  import { jsx as jsx15 } from "react/jsx-runtime";
754
754
  function ImagePreview({
755
755
  fileKey,
@@ -790,11 +790,11 @@ function ImagePreview({
790
790
 
791
791
  // src/file-list.tsx
792
792
  import "react";
793
- import JoyList from "@mui/joy/List";
794
- import JoyListItem from "@mui/joy/ListItem";
795
- import JoyListItemContent from "@mui/joy/ListItemContent";
796
- import JoyTypography4 from "@mui/joy/Typography";
797
- import JoyButton3 from "@mui/joy/Button";
793
+ import { List as JoyList } from "@mui/joy";
794
+ import { ListItem as JoyListItem } from "@mui/joy";
795
+ import { ListItemContent as JoyListItemContent } from "@mui/joy";
796
+ import { Typography as JoyTypography4 } from "@mui/joy";
797
+ import { Button as JoyButton3 } from "@mui/joy";
798
798
  import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
799
799
  function formatBytes(bytes) {
800
800
  if (bytes < 1024) return `${bytes} B`;
@@ -827,9 +827,9 @@ function FileList({
827
827
 
828
828
  // src/list-view.tsx
829
829
  import { useState as useState3, useCallback as useCallback5 } from "react";
830
- import JoyButton4 from "@mui/joy/Button";
831
- import JoyStack3 from "@mui/joy/Stack";
832
- import JoyTypography5 from "@mui/joy/Typography";
830
+ import { Button as JoyButton4 } from "@mui/joy";
831
+ import { Stack as JoyStack3 } from "@mui/joy";
832
+ import { Typography as JoyTypography5 } from "@mui/joy";
833
833
  import { useActionStatus as useActionStatus4 } from "@cfast/ui";
834
834
  import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
835
835
  function ListView({
@@ -920,8 +920,8 @@ function CreateButton({ action, label }) {
920
920
  }
921
921
 
922
922
  // src/detail-view.tsx
923
- import JoyGrid from "@mui/joy/Grid";
924
- import JoyTypography6 from "@mui/joy/Typography";
923
+ import { Grid as JoyGrid } from "@mui/joy";
924
+ import { Typography as JoyTypography6 } from "@mui/joy";
925
925
  import { fieldForColumn, getField as getField2 } from "@cfast/ui";
926
926
  import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
927
927
  function normalizeFields(fields) {
@@ -982,7 +982,7 @@ function resolveFieldComponent(_key, table) {
982
982
 
983
983
  // src/avatar-with-initials.tsx
984
984
  import "react";
985
- import Avatar2 from "@mui/joy/Avatar";
985
+ import { Avatar as Avatar2 } from "@mui/joy";
986
986
  import { getInitials as getInitials2 } from "@cfast/ui";
987
987
  import { jsx as jsx19 } from "react/jsx-runtime";
988
988
  function AvatarWithInitials({
@@ -995,10 +995,10 @@ function AvatarWithInitials({
995
995
 
996
996
  // src/impersonation-banner.tsx
997
997
  import "react";
998
- import Sheet2 from "@mui/joy/Sheet";
999
- import Typography4 from "@mui/joy/Typography";
1000
- import Button3 from "@mui/joy/Button";
1001
- import Stack5 from "@mui/joy/Stack";
998
+ import { Sheet as Sheet2 } from "@mui/joy";
999
+ import { Typography as Typography4 } from "@mui/joy";
1000
+ import { Button as Button3 } from "@mui/joy";
1001
+ import { Stack as Stack5 } from "@mui/joy";
1002
1002
  import { useCurrentUser as useCurrentUser2 } from "@cfast/auth/client";
1003
1003
  import { jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
1004
1004
  function ImpersonationBanner({
@@ -1032,12 +1032,12 @@ function ImpersonationBanner({
1032
1032
  import { PermissionGate } from "@cfast/ui";
1033
1033
 
1034
1034
  // src/login-components.tsx
1035
- import Box from "@mui/joy/Box";
1036
- import Card from "@mui/joy/Card";
1037
- import Input from "@mui/joy/Input";
1038
- import Button4 from "@mui/joy/Button";
1039
- import Alert2 from "@mui/joy/Alert";
1040
- import Divider from "@mui/joy/Divider";
1035
+ import { Box } from "@mui/joy";
1036
+ import { Card } from "@mui/joy";
1037
+ import { Input } from "@mui/joy";
1038
+ import { Button as Button4 } from "@mui/joy";
1039
+ import { Alert as Alert2 } from "@mui/joy";
1040
+ import { Divider } from "@mui/joy";
1041
1041
  import { Fragment as Fragment3, jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
1042
1042
  function Layout({ children }) {
1043
1043
  return /* @__PURE__ */ jsx21(
package/llms.txt CHANGED
@@ -106,3 +106,8 @@ import { ActionButton } from "@cfast/joy";
106
106
  - Forgetting `<ToastProvider>` in root layout -- `useToast()` and `useActionToast()` throw without it.
107
107
  - Forgetting `<ConfirmProvider>` -- `useConfirm()` and `ActionButton` with `confirmation` need it.
108
108
  - Passing raw data arrays to `DataTable` instead of a pagination result from `usePagination()`.
109
+
110
+ ## See Also
111
+
112
+ - `@cfast/ui` -- Headless components that `@cfast/joy` styles with MUI Joy.
113
+ - `@cfast/actions` -- Action handling consumed by `ActionButton` and `ActionForm`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cfast/joy",
3
- "version": "0.0.1",
3
+ "version": "0.1.1",
4
4
  "description": "Joy UI plugin for @cfast/ui — styled components powered by MUI Joy",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -17,34 +17,28 @@
17
17
  "types": "./dist/index.d.ts"
18
18
  }
19
19
  },
20
- "files": ["dist", "llms.txt"],
20
+ "files": [
21
+ "dist",
22
+ "llms.txt"
23
+ ],
21
24
  "sideEffects": false,
22
25
  "publishConfig": {
23
26
  "access": "public"
24
27
  },
25
- "scripts": {
26
- "build": "tsup src/index.ts --format esm --dts",
27
- "dev": "tsup src/index.ts --format esm --dts --watch",
28
- "typecheck": "tsc --noEmit",
29
- "lint": "eslint src/",
30
- "test": "vitest run",
31
- "storybook": "storybook dev -p 6006",
32
- "build-storybook": "storybook build"
33
- },
34
28
  "peerDependencies": {
35
29
  "react": ">=19",
36
30
  "react-dom": ">=19",
37
31
  "react-router": ">=7"
38
32
  },
39
33
  "dependencies": {
40
- "@cfast/actions": "workspace:*",
41
- "@cfast/auth": "workspace:*",
42
- "@cfast/ui": "workspace:*",
43
34
  "@emotion/react": "^11.14.0",
44
35
  "@emotion/styled": "^11.14.1",
45
36
  "@mui/joy": "^5.0.0-beta.52",
46
37
  "@mui/material": "^6.5.0",
47
- "sonner": "^2.0.3"
38
+ "sonner": "^2.0.3",
39
+ "@cfast/ui": "0.2.1",
40
+ "@cfast/auth": "0.2.2",
41
+ "@cfast/actions": "0.1.1"
48
42
  },
49
43
  "devDependencies": {
50
44
  "@storybook/react": "^8.6.14",
@@ -61,5 +55,14 @@
61
55
  "tsup": "^8",
62
56
  "typescript": "^5.7",
63
57
  "vitest": "^4.1.0"
58
+ },
59
+ "scripts": {
60
+ "build": "tsup src/index.ts --format esm --dts && node ../../scripts/fix-mui-joy-imports.mjs dist",
61
+ "dev": "tsup src/index.ts --format esm --dts --watch --onSuccess \"node ../../scripts/fix-mui-joy-imports.mjs dist\"",
62
+ "typecheck": "tsc --noEmit",
63
+ "lint": "eslint src/",
64
+ "test": "vitest run",
65
+ "storybook": "storybook dev -p 6006",
66
+ "build-storybook": "storybook build"
64
67
  }
65
- }
68
+ }