@fayz-ai/pos 0.20.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 (52) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +44 -0
  3. package/dist/app/config.d.ts +238 -0
  4. package/dist/app/config.d.ts.map +1 -0
  5. package/dist/index.d.ts +24 -0
  6. package/dist/index.d.ts.map +1 -0
  7. package/dist/index.js +2638 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/keyboard/index.d.ts +3 -0
  10. package/dist/keyboard/index.d.ts.map +1 -0
  11. package/dist/lib/haptics.d.ts +3 -0
  12. package/dist/lib/haptics.d.ts.map +1 -0
  13. package/dist/lib/useSwipeAway.d.ts +18 -0
  14. package/dist/lib/useSwipeAway.d.ts.map +1 -0
  15. package/dist/screen/DeliveryBoard.d.ts +12 -0
  16. package/dist/screen/DeliveryBoard.d.ts.map +1 -0
  17. package/dist/screen/DispatchRail.d.ts +13 -0
  18. package/dist/screen/DispatchRail.d.ts.map +1 -0
  19. package/dist/screen/IdentitySheet.d.ts +7 -0
  20. package/dist/screen/IdentitySheet.d.ts.map +1 -0
  21. package/dist/screen/ModifierSheet.d.ts +13 -0
  22. package/dist/screen/ModifierSheet.d.ts.map +1 -0
  23. package/dist/screen/Notice.d.ts +21 -0
  24. package/dist/screen/Notice.d.ts.map +1 -0
  25. package/dist/screen/OpenTableSheet.d.ts +13 -0
  26. package/dist/screen/OpenTableSheet.d.ts.map +1 -0
  27. package/dist/screen/PinSheet.d.ts +9 -0
  28. package/dist/screen/PinSheet.d.ts.map +1 -0
  29. package/dist/screen/PosScreen.d.ts +96 -0
  30. package/dist/screen/PosScreen.d.ts.map +1 -0
  31. package/dist/screen/ReservationsView.d.ts +11 -0
  32. package/dist/screen/ReservationsView.d.ts.map +1 -0
  33. package/dist/screen/ShortcutsOverlay.d.ts +6 -0
  34. package/dist/screen/ShortcutsOverlay.d.ts.map +1 -0
  35. package/dist/screen/SplitSheet.d.ts +9 -0
  36. package/dist/screen/SplitSheet.d.ts.map +1 -0
  37. package/dist/screen/TicketRail.d.ts +36 -0
  38. package/dist/screen/TicketRail.d.ts.map +1 -0
  39. package/dist/screen/money.d.ts +11 -0
  40. package/dist/screen/money.d.ts.map +1 -0
  41. package/dist/screen/session.d.ts +105 -0
  42. package/dist/screen/session.d.ts.map +1 -0
  43. package/dist/screen/views.d.ts +51 -0
  44. package/dist/screen/views.d.ts.map +1 -0
  45. package/dist/styles.css +1664 -0
  46. package/dist/theme/index.d.ts +2 -0
  47. package/dist/theme/index.d.ts.map +1 -0
  48. package/dist/theme/index.js +53 -0
  49. package/dist/theme/index.js.map +1 -0
  50. package/dist/theme/tokens.d.ts +62 -0
  51. package/dist/theme/tokens.d.ts.map +1 -0
  52. package/package.json +61 -0
@@ -0,0 +1,2 @@
1
+ export { touch, surface, text, tone, status, radius, typeScale, TOUCH_MIN_PX } from './tokens';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA"}
@@ -0,0 +1,53 @@
1
+ // src/theme/tokens.ts
2
+ var TOUCH_MIN_PX = 72;
3
+ var touch = {
4
+ /** Anything tappable during service. */
5
+ min: `${TOUCH_MIN_PX}px`,
6
+ /** Primary targets: catalogue cards, position cards, the close-bill CTA. */
7
+ comfortable: "88px",
8
+ /** Gap that keeps two adjacent targets from being one fat-finger target. */
9
+ gap: "12px"
10
+ };
11
+ var surface = {
12
+ canvas: "#0B0B0C",
13
+ raised: "#161618",
14
+ sunken: "#101012",
15
+ border: "#232326"
16
+ };
17
+ var text = {
18
+ primary: "#F5F5F6",
19
+ secondary: "#9A9AA0",
20
+ /** On a pastel fill — pastels are light, so their text is near-black. */
21
+ onTone: "#141416"
22
+ };
23
+ var tone = {
24
+ mint: "#C8E6D5",
25
+ lilac: "#E2D4F0",
26
+ sky: "#CBE3F2",
27
+ periwinkle: "#D6D9F5",
28
+ blush: "#F7C9DA",
29
+ sand: "#E6DED6",
30
+ teal: "#BFE8DC",
31
+ rose: "#F2CBCB"
32
+ };
33
+ var status = {
34
+ free: { accent: "#2E7D53", label: "Livre" },
35
+ occupied: { accent: "#C9852B", label: "Ocupada" },
36
+ bill_requested: { accent: "#2F6FB5", label: "Conta pedida" },
37
+ attention: { accent: "#C0392B", label: "Aten\xE7\xE3o" }
38
+ };
39
+ var radius = {
40
+ card: "18px",
41
+ control: "14px",
42
+ pill: "999px"
43
+ };
44
+ var typeScale = {
45
+ total: "40px",
46
+ heading: "24px",
47
+ body: "17px",
48
+ caption: "14px"
49
+ };
50
+
51
+ export { TOUCH_MIN_PX, radius, status, surface, text, tone, touch, typeScale };
52
+ //# sourceMappingURL=index.js.map
53
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/theme/tokens.ts"],"names":[],"mappings":";AAgBO,IAAM,YAAA,GAAe;AAErB,IAAM,KAAA,GAAQ;AAAA;AAAA,EAEnB,GAAA,EAAK,GAAG,YAAY,CAAA,EAAA,CAAA;AAAA;AAAA,EAEpB,WAAA,EAAa,MAAA;AAAA;AAAA,EAEb,GAAA,EAAK;AACP;AAEO,IAAM,OAAA,GAAU;AAAA,EACrB,MAAA,EAAQ,SAAA;AAAA,EACR,MAAA,EAAQ,SAAA;AAAA,EACR,MAAA,EAAQ,SAAA;AAAA,EACR,MAAA,EAAQ;AACV;AAEO,IAAM,IAAA,GAAO;AAAA,EAClB,OAAA,EAAS,SAAA;AAAA,EACT,SAAA,EAAW,SAAA;AAAA;AAAA,EAEX,MAAA,EAAQ;AACV;AAGO,IAAM,IAAA,GAAgC;AAAA,EAC3C,IAAA,EAAM,SAAA;AAAA,EACN,KAAA,EAAO,SAAA;AAAA,EACP,GAAA,EAAK,SAAA;AAAA,EACL,UAAA,EAAY,SAAA;AAAA,EACZ,KAAA,EAAO,SAAA;AAAA,EACP,IAAA,EAAM,SAAA;AAAA,EACN,IAAA,EAAM,SAAA;AAAA,EACN,IAAA,EAAM;AACR;AAQO,IAAM,MAAA,GAAS;AAAA,EACpB,IAAA,EAAM,EAAE,MAAA,EAAQ,SAAA,EAAW,OAAO,OAAA,EAAQ;AAAA,EAC1C,QAAA,EAAU,EAAE,MAAA,EAAQ,SAAA,EAAW,OAAO,SAAA,EAAU;AAAA,EAChD,cAAA,EAAgB,EAAE,MAAA,EAAQ,SAAA,EAAW,OAAO,cAAA,EAAe;AAAA,EAC3D,SAAA,EAAW,EAAE,MAAA,EAAQ,SAAA,EAAW,OAAO,eAAA;AACzC;AAEO,IAAM,MAAA,GAAS;AAAA,EACpB,IAAA,EAAM,MAAA;AAAA,EACN,OAAA,EAAS,MAAA;AAAA,EACT,IAAA,EAAM;AACR;AAGO,IAAM,SAAA,GAAY;AAAA,EACvB,KAAA,EAAO,MAAA;AAAA,EACP,OAAA,EAAS,MAAA;AAAA,EACT,IAAA,EAAM,MAAA;AAAA,EACN,OAAA,EAAS;AACX","file":"index.js","sourcesContent":["// ---------------------------------------------------------------------------\n// POS design tokens.\n//\n// Two rules this file exists to enforce:\n//\n// 1. Touch size is a token, not a per-component choice. A 19mm target is the\n// floor for anything the operator hits during service; components read\n// `touch.*` instead of picking their own padding.\n// 2. The pastel scale is CATEGORY identity. Position status has its own axis\n// (`status.*`) built from saturation + icon + text. Painting a status with a\n// category pastel is the one mistake the CosyPOS reference invites.\n// ---------------------------------------------------------------------------\n\nimport type { PosTone } from '../app/config'\n\n/** ~19mm at a typical 96dpi touchscreen, rounded to a round number of pixels. */\nexport const TOUCH_MIN_PX = 72\n\nexport const touch = {\n /** Anything tappable during service. */\n min: `${TOUCH_MIN_PX}px`,\n /** Primary targets: catalogue cards, position cards, the close-bill CTA. */\n comfortable: '88px',\n /** Gap that keeps two adjacent targets from being one fat-finger target. */\n gap: '12px',\n} as const\n\nexport const surface = {\n canvas: '#0B0B0C',\n raised: '#161618',\n sunken: '#101012',\n border: '#232326',\n} as const\n\nexport const text = {\n primary: '#F5F5F6',\n secondary: '#9A9AA0',\n /** On a pastel fill — pastels are light, so their text is near-black. */\n onTone: '#141416',\n} as const\n\n/** Category identity. Assigned per category by data; never derived from status. */\nexport const tone: Record<PosTone, string> = {\n mint: '#C8E6D5',\n lilac: '#E2D4F0',\n sky: '#CBE3F2',\n periwinkle: '#D6D9F5',\n blush: '#F7C9DA',\n sand: '#E6DED6',\n teal: '#BFE8DC',\n rose: '#F2CBCB',\n}\n\n/**\n * Position status. Deliberately a different language from `tone`: saturated\n * accents rather than pastels, and every consumer must pair them with an icon\n * and a word — colour alone fails the operator who is colour-blind and the\n * screen that is washed out by afternoon sun.\n */\nexport const status = {\n free: { accent: '#2E7D53', label: 'Livre' },\n occupied: { accent: '#C9852B', label: 'Ocupada' },\n bill_requested: { accent: '#2F6FB5', label: 'Conta pedida' },\n attention: { accent: '#C0392B', label: 'Atenção' },\n} as const\n\nexport const radius = {\n card: '18px',\n control: '14px',\n pill: '999px',\n} as const\n\n/** Money and totals want to read from a metre away; body text does not. */\nexport const typeScale = {\n total: '40px',\n heading: '24px',\n body: '17px',\n caption: '14px',\n} as const\n"]}
@@ -0,0 +1,62 @@
1
+ import type { PosTone } from '../app/config';
2
+ /** ~19mm at a typical 96dpi touchscreen, rounded to a round number of pixels. */
3
+ export declare const TOUCH_MIN_PX = 72;
4
+ export declare const touch: {
5
+ /** Anything tappable during service. */
6
+ readonly min: "72px";
7
+ /** Primary targets: catalogue cards, position cards, the close-bill CTA. */
8
+ readonly comfortable: "88px";
9
+ /** Gap that keeps two adjacent targets from being one fat-finger target. */
10
+ readonly gap: "12px";
11
+ };
12
+ export declare const surface: {
13
+ readonly canvas: "#0B0B0C";
14
+ readonly raised: "#161618";
15
+ readonly sunken: "#101012";
16
+ readonly border: "#232326";
17
+ };
18
+ export declare const text: {
19
+ readonly primary: "#F5F5F6";
20
+ readonly secondary: "#9A9AA0";
21
+ /** On a pastel fill — pastels are light, so their text is near-black. */
22
+ readonly onTone: "#141416";
23
+ };
24
+ /** Category identity. Assigned per category by data; never derived from status. */
25
+ export declare const tone: Record<PosTone, string>;
26
+ /**
27
+ * Position status. Deliberately a different language from `tone`: saturated
28
+ * accents rather than pastels, and every consumer must pair them with an icon
29
+ * and a word — colour alone fails the operator who is colour-blind and the
30
+ * screen that is washed out by afternoon sun.
31
+ */
32
+ export declare const status: {
33
+ readonly free: {
34
+ readonly accent: "#2E7D53";
35
+ readonly label: "Livre";
36
+ };
37
+ readonly occupied: {
38
+ readonly accent: "#C9852B";
39
+ readonly label: "Ocupada";
40
+ };
41
+ readonly bill_requested: {
42
+ readonly accent: "#2F6FB5";
43
+ readonly label: "Conta pedida";
44
+ };
45
+ readonly attention: {
46
+ readonly accent: "#C0392B";
47
+ readonly label: "Atenção";
48
+ };
49
+ };
50
+ export declare const radius: {
51
+ readonly card: "18px";
52
+ readonly control: "14px";
53
+ readonly pill: "999px";
54
+ };
55
+ /** Money and totals want to read from a metre away; body text does not. */
56
+ export declare const typeScale: {
57
+ readonly total: "40px";
58
+ readonly heading: "24px";
59
+ readonly body: "17px";
60
+ readonly caption: "14px";
61
+ };
62
+ //# sourceMappingURL=tokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/theme/tokens.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAE5C,iFAAiF;AACjF,eAAO,MAAM,YAAY,KAAK,CAAA;AAE9B,eAAO,MAAM,KAAK;IAChB,wCAAwC;;IAExC,4EAA4E;;IAE5E,4EAA4E;;CAEpE,CAAA;AAEV,eAAO,MAAM,OAAO;;;;;CAKV,CAAA;AAEV,eAAO,MAAM,IAAI;;;IAGf,yEAAyE;;CAEjE,CAAA;AAEV,mFAAmF;AACnF,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CASxC,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;CAKT,CAAA;AAEV,eAAO,MAAM,MAAM;;;;CAIT,CAAA;AAEV,2EAA2E;AAC3E,eAAO,MAAM,SAAS;;;;;CAKZ,CAAA"}
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@fayz-ai/pos",
3
+ "fayz": {
4
+ "status": "preview"
5
+ },
6
+ "version": "0.20.0",
7
+ "publishConfig": {
8
+ "access": "public"
9
+ },
10
+ "description": "Fayz SDK POS layer — the operator surface: one page, touch and keyboard, parameterised per vertical",
11
+ "type": "module",
12
+ "sideEffects": [
13
+ "**/*.css"
14
+ ],
15
+ "main": "./dist/index.js",
16
+ "module": "./dist/index.js",
17
+ "types": "./dist/index.d.ts",
18
+ "exports": {
19
+ ".": {
20
+ "types": "./dist/index.d.ts",
21
+ "import": "./dist/index.js"
22
+ },
23
+ "./theme": {
24
+ "types": "./dist/theme/index.d.ts",
25
+ "import": "./dist/theme/index.js"
26
+ },
27
+ "./styles.css": "./dist/styles.css"
28
+ },
29
+ "files": [
30
+ "dist"
31
+ ],
32
+ "peerDependencies": {
33
+ "lucide-react": ">=0.400.0 <1.0.0",
34
+ "react": "^18.0.0 || ^19.0.0",
35
+ "react-dom": "^18.0.0 || ^19.0.0",
36
+ "zustand": "^4.5.0 || ^5.0.0"
37
+ },
38
+ "dependencies": {
39
+ "@fayz-ai/core": "^0.22.0"
40
+ },
41
+ "devDependencies": {
42
+ "@types/react": "^18.3.0",
43
+ "@types/react-dom": "^18.3.0",
44
+ "happy-dom": "^20.11.2",
45
+ "lucide-react": "^0.400.0",
46
+ "react": "^18.3.0",
47
+ "react-dom": "^18.3.0",
48
+ "tsup": "^8.2.0",
49
+ "typescript": "^5.5.0",
50
+ "vitest": "^4.1.5",
51
+ "zustand": "^4.5.0"
52
+ },
53
+ "license": "MIT",
54
+ "scripts": {
55
+ "build": "tsup && mkdir -p dist && cp src/styles.css dist/styles.css && tsc -b --force",
56
+ "dev": "tsup --watch",
57
+ "typecheck": "tsc -b tsconfig.test.json",
58
+ "test": "vitest run",
59
+ "clean": "rm -rf dist .tsbuildinfo"
60
+ }
61
+ }