@mostrom/app-shell 0.1.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.
Files changed (142) hide show
  1. package/.claude/ralph-loop.local.md +9 -0
  2. package/README.md +172 -0
  3. package/bin/init.js +269 -0
  4. package/bun.lock +401 -0
  5. package/components.json +28 -0
  6. package/package.json +74 -0
  7. package/scripts/publish-npm.sh +202 -0
  8. package/src/AppShell.tsx +847 -0
  9. package/src/components/PageHeader.tsx +160 -0
  10. package/src/components/data-table/README.md +447 -0
  11. package/src/components/data-table/data-table-preferences.tsx +184 -0
  12. package/src/components/data-table/data-table-toolbar.tsx +118 -0
  13. package/src/components/data-table/data-table.tsx +37 -0
  14. package/src/components/data-table/index.ts +32 -0
  15. package/src/components/global-header/AllServicesButton.tsx +127 -0
  16. package/src/components/global-header/CategoriesButton.tsx +120 -0
  17. package/src/components/global-header/GlobalHeader.tsx +59 -0
  18. package/src/components/global-header/GlobalHeaderSearch.tsx +57 -0
  19. package/src/components/global-header/HeaderUtilities.tsx +243 -0
  20. package/src/components/global-header/ServicesMenu.tsx +246 -0
  21. package/src/components/layout/AppBreadcrumb.tsx +70 -0
  22. package/src/components/layout/AppFlashbar.tsx +95 -0
  23. package/src/components/layout/AppLayout.tsx +271 -0
  24. package/src/components/layout/AppNavigation.tsx +313 -0
  25. package/src/components/layout/AppSidebar.tsx +229 -0
  26. package/src/components/patterns/index.ts +14 -0
  27. package/src/components/patterns/p-alert-5.tsx +19 -0
  28. package/src/components/patterns/p-autocomplete-5.tsx +89 -0
  29. package/src/components/patterns/p-breadcrumb-1.tsx +28 -0
  30. package/src/components/patterns/p-button-42.tsx +37 -0
  31. package/src/components/patterns/p-button-51.tsx +14 -0
  32. package/src/components/patterns/p-button-6.tsx +5 -0
  33. package/src/components/patterns/p-calendar-1.tsx +18 -0
  34. package/src/components/patterns/p-card-1.tsx +33 -0
  35. package/src/components/patterns/p-card-2.tsx +26 -0
  36. package/src/components/patterns/p-card-5.tsx +31 -0
  37. package/src/components/patterns/p-collapsible-7.tsx +121 -0
  38. package/src/components/patterns/p-command-6.tsx +113 -0
  39. package/src/components/patterns/p-dialog-1.tsx +56 -0
  40. package/src/components/patterns/p-dropdown-menu-1.tsx +38 -0
  41. package/src/components/patterns/p-dropdown-menu-11.tsx +122 -0
  42. package/src/components/patterns/p-dropdown-menu-14.tsx +165 -0
  43. package/src/components/patterns/p-dropdown-menu-9.tsx +108 -0
  44. package/src/components/patterns/p-empty-2.tsx +34 -0
  45. package/src/components/patterns/p-file-upload-1.tsx +72 -0
  46. package/src/components/patterns/p-filters-1.tsx +666 -0
  47. package/src/components/patterns/p-frame-2.tsx +26 -0
  48. package/src/components/patterns/p-tabs-2.tsx +129 -0
  49. package/src/components/reui/alert.tsx +92 -0
  50. package/src/components/reui/autocomplete.tsx +343 -0
  51. package/src/components/reui/badge.tsx +87 -0
  52. package/src/components/reui/data-grid/data-grid-column-filter.tsx +165 -0
  53. package/src/components/reui/data-grid/data-grid-column-header.tsx +339 -0
  54. package/src/components/reui/data-grid/data-grid-column-visibility.tsx +55 -0
  55. package/src/components/reui/data-grid/data-grid-pagination.tsx +224 -0
  56. package/src/components/reui/data-grid/data-grid-table-dnd-rows.tsx +260 -0
  57. package/src/components/reui/data-grid/data-grid-table-dnd.tsx +253 -0
  58. package/src/components/reui/data-grid/data-grid-table.tsx +639 -0
  59. package/src/components/reui/data-grid/data-grid.tsx +209 -0
  60. package/src/components/reui/date-selector.tsx +1330 -0
  61. package/src/components/reui/filters.tsx +1869 -0
  62. package/src/components/reui/frame.tsx +134 -0
  63. package/src/components/reui/index.ts +17 -0
  64. package/src/components/reui/timeline.tsx +219 -0
  65. package/src/components/search/Autocomplete.tsx +183 -0
  66. package/src/components/search/AutocompleteClient.tsx +293 -0
  67. package/src/components/search/GlobalSearch.tsx +187 -0
  68. package/src/components/section-drawer/deal-drawer-content.tsx +891 -0
  69. package/src/components/section-drawer/index.ts +19 -0
  70. package/src/components/section-drawer/section-drawer.css +665 -0
  71. package/src/components/section-drawer/section-drawer.tsx +467 -0
  72. package/src/components/sectioned-list-board/README.md +78 -0
  73. package/src/components/sectioned-list-board/board-card-content.tsx +340 -0
  74. package/src/components/sectioned-list-board/date-range-filter.tsx +249 -0
  75. package/src/components/sectioned-list-board/index.ts +19 -0
  76. package/src/components/sectioned-list-board/sectioned-list-board.css +564 -0
  77. package/src/components/sectioned-list-board/sectioned-list-board.tsx +731 -0
  78. package/src/components/sectioned-list-board/sortable-card.tsx +314 -0
  79. package/src/components/sectioned-list-board/sortable-section.tsx +319 -0
  80. package/src/components/sectioned-list-board/types.ts +216 -0
  81. package/src/components/sectioned-list-table/README.md +80 -0
  82. package/src/components/sectioned-list-table/index.ts +14 -0
  83. package/src/components/sectioned-list-table/sectioned-list-table.css +534 -0
  84. package/src/components/sectioned-list-table/sectioned-list-table.tsx +740 -0
  85. package/src/components/sectioned-list-table/sortable-column-header.tsx +120 -0
  86. package/src/components/sectioned-list-table/sortable-row.tsx +420 -0
  87. package/src/components/sectioned-list-table/sortable-section.tsx +251 -0
  88. package/src/components/sectioned-list-table/table-cell-content.tsx +129 -0
  89. package/src/components/sectioned-list-table/types.ts +120 -0
  90. package/src/components/sectioned-list-table/use-column-preferences.ts +103 -0
  91. package/src/components/ui/actions-dropdown.tsx +109 -0
  92. package/src/components/ui/assignee-selector.tsx +209 -0
  93. package/src/components/ui/avatar.tsx +107 -0
  94. package/src/components/ui/breadcrumb.tsx +109 -0
  95. package/src/components/ui/button-group.tsx +83 -0
  96. package/src/components/ui/button.tsx +64 -0
  97. package/src/components/ui/calendar.tsx +220 -0
  98. package/src/components/ui/card.tsx +92 -0
  99. package/src/components/ui/chart.tsx +376 -0
  100. package/src/components/ui/checkbox.tsx +30 -0
  101. package/src/components/ui/collapsible.tsx +33 -0
  102. package/src/components/ui/command.tsx +182 -0
  103. package/src/components/ui/context-menu.tsx +250 -0
  104. package/src/components/ui/create-button-group.tsx +128 -0
  105. package/src/components/ui/dialog.tsx +156 -0
  106. package/src/components/ui/drawer.tsx +133 -0
  107. package/src/components/ui/dropdown-menu.tsx +255 -0
  108. package/src/components/ui/empty.tsx +104 -0
  109. package/src/components/ui/field.tsx +248 -0
  110. package/src/components/ui/form.tsx +165 -0
  111. package/src/components/ui/index.ts +37 -0
  112. package/src/components/ui/input-group.tsx +168 -0
  113. package/src/components/ui/input.tsx +21 -0
  114. package/src/components/ui/kbd.tsx +28 -0
  115. package/src/components/ui/label.tsx +22 -0
  116. package/src/components/ui/navigation-menu.tsx +168 -0
  117. package/src/components/ui/page-header.tsx +80 -0
  118. package/src/components/ui/popover.tsx +87 -0
  119. package/src/components/ui/scroll-area.tsx +56 -0
  120. package/src/components/ui/select.tsx +190 -0
  121. package/src/components/ui/separator.tsx +26 -0
  122. package/src/components/ui/sheet.tsx +141 -0
  123. package/src/components/ui/sidebar.tsx +726 -0
  124. package/src/components/ui/skeleton.tsx +13 -0
  125. package/src/components/ui/sonner.tsx +38 -0
  126. package/src/components/ui/switch.tsx +33 -0
  127. package/src/components/ui/tabs.tsx +91 -0
  128. package/src/components/ui/textarea.tsx +18 -0
  129. package/src/components/ui/toggle-group.tsx +83 -0
  130. package/src/components/ui/toggle.tsx +45 -0
  131. package/src/components/ui/tooltip.tsx +57 -0
  132. package/src/hooks/use-copy-to-clipboard.ts +37 -0
  133. package/src/hooks/use-file-upload.ts +415 -0
  134. package/src/hooks/use-mobile.ts +19 -0
  135. package/src/index.ts +95 -0
  136. package/src/lib/utils.ts +6 -0
  137. package/src/styles.css +1859 -0
  138. package/src/urls.ts +83 -0
  139. package/src/vite.d.ts +22 -0
  140. package/src/vite.js +241 -0
  141. package/tsconfig.base.json +18 -0
  142. package/tsconfig.json +24 -0
package/package.json ADDED
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "@mostrom/app-shell",
3
+ "version": "0.1.0",
4
+ "private": false,
5
+ "type": "module",
6
+ "bin": {
7
+ "app-shell": "./bin/init.js",
8
+ "app-shell-init": "./bin/init.js"
9
+ },
10
+ "exports": {
11
+ ".": "./src/index.ts",
12
+ "./styles.css": "./src/styles.css",
13
+ "./components/ui": "./src/components/ui/index.ts",
14
+ "./components/ui/*": "./src/components/ui/*.tsx",
15
+ "./components/patterns": "./src/components/patterns/index.ts",
16
+ "./components/patterns/*": "./src/components/patterns/*.tsx",
17
+ "./components/reui": "./src/components/reui/index.ts",
18
+ "./components/reui/*": "./src/components/reui/*.tsx",
19
+ "./components/sectioned-list-board": "./src/components/sectioned-list-board/index.ts",
20
+ "./components/sectioned-list-table": "./src/components/sectioned-list-table/index.ts",
21
+ "./components/section-drawer": "./src/components/section-drawer/index.ts",
22
+ "./components/data-table": "./src/components/data-table/index.ts",
23
+ "./lib/utils": "./src/lib/utils.ts",
24
+ "./hooks/*": "./src/hooks/*.ts",
25
+ "./vite": "./src/vite.js",
26
+ "./tsconfig.base.json": "./tsconfig.base.json"
27
+ },
28
+ "dependencies": {
29
+ "@base-ui/react": "^1.1.0",
30
+ "@cloudscape-design/components": "*",
31
+ "@cloudscape-design/global-styles": "*",
32
+ "@dnd-kit/core": "^6.3.1",
33
+ "@dnd-kit/modifiers": "^9.0.0",
34
+ "@dnd-kit/sortable": "^10.0.0",
35
+ "@dnd-kit/utilities": "^3.2.2",
36
+ "@floating-ui/dom": "^1.7.5",
37
+ "@hookform/resolvers": "^5.2.2",
38
+ "@radix-ui/react-dropdown-menu": "^2.1.4",
39
+ "@tanstack/react-table": "^8.21.3",
40
+ "class-variance-authority": "^0.7.1",
41
+ "clsx": "^2.1.1",
42
+ "cmdk": "^1.1.1",
43
+ "date-fns": "^4.1.0",
44
+ "detect-node-es": "^1.1.0",
45
+ "get-nonce": "^1.0.1",
46
+ "lucide-react": "^0.563.0",
47
+ "next-themes": "^0.4.6",
48
+ "radix-ui": "^1.4.3",
49
+ "react-day-picker": "^9.13.2",
50
+ "react-hook-form": "^7.71.1",
51
+ "recharts": "2.15.4",
52
+ "sonner": "^2.0.7",
53
+ "tailwind-merge": "^3.4.0",
54
+ "tw-animate-css": "^1.4.0",
55
+ "vaul": "^1.1.2",
56
+ "zod": "^4.3.6",
57
+ "@mostrom/service-catalog": "^0.1.0"
58
+ },
59
+ "devDependencies": {
60
+ "@types/react": "19.2.14",
61
+ "@types/react-dom": "19.2.3"
62
+ },
63
+ "peerDependencies": {
64
+ "react": "^19.0.0",
65
+ "react-dom": "^19.0.0"
66
+ },
67
+ "scripts": {
68
+ "publish:npm": "bash ./scripts/publish-npm.sh",
69
+ "publish:npm:dry-run": "bash ./scripts/publish-npm.sh --dry-run"
70
+ },
71
+ "publishConfig": {
72
+ "access": "public"
73
+ }
74
+ }
@@ -0,0 +1,202 @@
1
+ #!/usr/bin/env sh
2
+ set -eu
3
+
4
+ usage() {
5
+ cat <<USAGE
6
+ Usage:
7
+ ./scripts/publish-npm.sh --version <version> [--scope <scope>] [--tag <tag>] [--otp <code>] [--dry-run]
8
+ ./scripts/publish-npm.sh <version> [--scope <scope>] [--tag <tag>] [--otp <code>] [--dry-run]
9
+
10
+ Examples:
11
+ ./scripts/publish-npm.sh 0.1.0
12
+ ./scripts/publish-npm.sh --version 0.1.0 --scope @mostrom --tag next
13
+ ./scripts/publish-npm.sh --version 0.1.0 --scope mostrom --otp 123456
14
+ ./scripts/publish-npm.sh --version 0.1.0 --dry-run
15
+ USAGE
16
+ }
17
+
18
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
19
+ APP_SHELL_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
20
+ PACKAGES_DIR="$(cd "${APP_SHELL_DIR}/.." && pwd)"
21
+ SERVICE_CATALOG_DIR="${PACKAGES_DIR}/service-catalog"
22
+
23
+ VERSION=""
24
+ SCOPE="@mostrom"
25
+ TAG="latest"
26
+ OTP=""
27
+ DRY_RUN=0
28
+
29
+ while [ "$#" -gt 0 ]; do
30
+ case "$1" in
31
+ --)
32
+ # Allow accidental npm-style separator when running script directly
33
+ shift
34
+ ;;
35
+ --version|-v)
36
+ VERSION="${2:-}"
37
+ shift 2
38
+ ;;
39
+ --scope)
40
+ SCOPE="${2:-}"
41
+ shift 2
42
+ ;;
43
+ --tag)
44
+ TAG="${2:-}"
45
+ shift 2
46
+ ;;
47
+ --otp)
48
+ OTP="${2:-}"
49
+ shift 2
50
+ ;;
51
+ --dry-run)
52
+ DRY_RUN=1
53
+ shift
54
+ ;;
55
+ --help|-h)
56
+ usage
57
+ exit 0
58
+ ;;
59
+ *)
60
+ if [ -z "$VERSION" ]; then
61
+ VERSION="$1"
62
+ shift
63
+ else
64
+ echo "Unknown argument: $1" >&2
65
+ usage
66
+ exit 1
67
+ fi
68
+ ;;
69
+ esac
70
+ done
71
+
72
+ if [ -z "$VERSION" ]; then
73
+ echo "Error: version is required." >&2
74
+ usage
75
+ exit 1
76
+ fi
77
+
78
+ case "$SCOPE" in
79
+ @*) ;;
80
+ *) SCOPE="@$SCOPE" ;;
81
+ esac
82
+ SCOPE="${SCOPE%/}"
83
+
84
+ if [ ! -d "$SERVICE_CATALOG_DIR" ]; then
85
+ echo "Error: service-catalog package not found at $SERVICE_CATALOG_DIR" >&2
86
+ exit 1
87
+ fi
88
+
89
+ SERVICE_CATALOG_PACKAGE_NAME="${SCOPE}/service-catalog"
90
+ APP_SHELL_PACKAGE_NAME="${SCOPE}/app-shell"
91
+
92
+ TMP_DIR="$(mktemp -d)"
93
+ cleanup() {
94
+ rm -rf "$TMP_DIR"
95
+ }
96
+ trap cleanup 0 1 2 3 15
97
+
98
+ if [ -f "${APP_SHELL_DIR}/.env" ]; then
99
+ token_line="$(grep -E '^(export[[:space:]]+)?NODE_AUTH_TOKEN=' "${APP_SHELL_DIR}/.env" | tail -n 1 || true)"
100
+ if [ -n "$token_line" ]; then
101
+ token_value="$(printf '%s' "$token_line" | sed -E 's/^(export[[:space:]]+)?NODE_AUTH_TOKEN=//')"
102
+ token_value="${token_value#\"}"
103
+ token_value="${token_value%\"}"
104
+ export NODE_AUTH_TOKEN="$token_value"
105
+ fi
106
+ fi
107
+
108
+ if [ -n "${NODE_AUTH_TOKEN:-}" ]; then
109
+ AUTH_NPMRC="${TMP_DIR}/.npmrc"
110
+ {
111
+ printf "//registry.npmjs.org/:_authToken=%s\n" "$NODE_AUTH_TOKEN"
112
+ } > "$AUTH_NPMRC"
113
+ export NPM_CONFIG_USERCONFIG="$AUTH_NPMRC"
114
+ fi
115
+
116
+ if ! npm whoami >/dev/null 2>&1; then
117
+ echo "Error: npm authentication not available. Ensure NODE_AUTH_TOKEN is valid or run npm login." >&2
118
+ exit 1
119
+ fi
120
+
121
+ copy_pkg() {
122
+ from_dir="$1"
123
+ to_dir="$2"
124
+ rsync -a \
125
+ --exclude node_modules \
126
+ --exclude .env \
127
+ --exclude test-results \
128
+ --exclude .DS_Store \
129
+ "$from_dir/" "$to_dir/"
130
+ }
131
+
132
+ rewrite_manifest() {
133
+ manifest_path="$1"
134
+ package_version="$2"
135
+ package_name="$3"
136
+ service_catalog_package="${4:-}"
137
+ service_catalog_range="${5:-}"
138
+
139
+ MANIFEST_PATH="$manifest_path" \
140
+ PACKAGE_VERSION="$package_version" \
141
+ PACKAGE_NAME="$package_name" \
142
+ SERVICE_CATALOG_PACKAGE="$service_catalog_package" \
143
+ SERVICE_CATALOG_RANGE="$service_catalog_range" \
144
+ node - <<'NODE'
145
+ const fs = require('fs');
146
+ const p = process.env.MANIFEST_PATH;
147
+ const version = process.env.PACKAGE_VERSION;
148
+ const packageName = process.env.PACKAGE_NAME;
149
+ const serviceCatalogPackage = process.env.SERVICE_CATALOG_PACKAGE;
150
+ const serviceCatalogRange = process.env.SERVICE_CATALOG_RANGE;
151
+ const pkg = JSON.parse(fs.readFileSync(p, 'utf8'));
152
+ pkg.name = packageName;
153
+ pkg.version = version;
154
+ pkg.private = false;
155
+ pkg.publishConfig = { ...(pkg.publishConfig || {}), access: 'public' };
156
+ if (pkg.dependencies && pkg.dependencies['@platform/service-catalog']) {
157
+ delete pkg.dependencies['@platform/service-catalog'];
158
+ }
159
+ if (serviceCatalogPackage && serviceCatalogRange) {
160
+ pkg.dependencies = { ...(pkg.dependencies || {}), [serviceCatalogPackage]: serviceCatalogRange };
161
+ }
162
+ fs.writeFileSync(p, JSON.stringify(pkg, null, 2) + '\n');
163
+ NODE
164
+ }
165
+
166
+ SERVICE_TMP_DIR="${TMP_DIR}/service-catalog"
167
+ APP_SHELL_TMP_DIR="${TMP_DIR}/app-shell"
168
+
169
+ mkdir -p "$SERVICE_TMP_DIR" "$APP_SHELL_TMP_DIR"
170
+ copy_pkg "$SERVICE_CATALOG_DIR" "$SERVICE_TMP_DIR"
171
+ copy_pkg "$APP_SHELL_DIR" "$APP_SHELL_TMP_DIR"
172
+
173
+ rewrite_manifest "${SERVICE_TMP_DIR}/package.json" "$VERSION" "$SERVICE_CATALOG_PACKAGE_NAME"
174
+ rewrite_manifest "${APP_SHELL_TMP_DIR}/package.json" "$VERSION" "$APP_SHELL_PACKAGE_NAME" "$SERVICE_CATALOG_PACKAGE_NAME" "^${VERSION}"
175
+
176
+ publish_pkg() {
177
+ pkg_dir="$1"
178
+ pkg_name="$2"
179
+
180
+ echo "==> Publishing ${pkg_name}@${VERSION}"
181
+ (
182
+ cd "$pkg_dir"
183
+ npm pack --dry-run >/dev/null
184
+ if [ "$DRY_RUN" -eq 1 ]; then
185
+ npm publish --access public --tag "$TAG" --dry-run
186
+ else
187
+ if [ -n "$OTP" ]; then
188
+ npm publish --access public --tag "$TAG" --otp "$OTP"
189
+ else
190
+ npm publish --access public --tag "$TAG"
191
+ fi
192
+ fi
193
+ )
194
+ }
195
+
196
+ publish_pkg "$SERVICE_TMP_DIR" "$SERVICE_CATALOG_PACKAGE_NAME"
197
+ publish_pkg "$APP_SHELL_TMP_DIR" "$APP_SHELL_PACKAGE_NAME"
198
+
199
+ echo "==> Done"
200
+ echo "Published version: ${VERSION}"
201
+ echo "Scope: ${SCOPE}"
202
+ echo "Tag: ${TAG}"