pgo-uiux2 1.0.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 (180) hide show
  1. package/.env +1 -0
  2. package/.env.production +1 -0
  3. package/.prettierrc +13 -0
  4. package/.vscode/extensions.json +3 -0
  5. package/BUTTON_GUIDE.md +257 -0
  6. package/README.md +49 -0
  7. package/THEME_REFERENCE.md +310 -0
  8. package/eslint.config.ts +27 -0
  9. package/index.html +13 -0
  10. package/package.json +85 -0
  11. package/public/favicon.ico +0 -0
  12. package/src/App.vue +368 -0
  13. package/src/assets/fonts/Faruma.ttf +0 -0
  14. package/src/components/examples/AppBarExample.vue +101 -0
  15. package/src/components/examples/AvatarExample.vue +47 -0
  16. package/src/components/examples/BannerExample.vue +287 -0
  17. package/src/components/examples/BaseInputExample.vue +25 -0
  18. package/src/components/examples/BreadcrumbExample.vue +53 -0
  19. package/src/components/examples/CardExample.vue +77 -0
  20. package/src/components/examples/ChipExample.vue +225 -0
  21. package/src/components/examples/DatePickerExample.vue +31 -0
  22. package/src/components/examples/DropdownExample.vue +84 -0
  23. package/src/components/examples/EditorExample.vue +200 -0
  24. package/src/components/examples/ExpansionPanelExample.vue +42 -0
  25. package/src/components/examples/FileUploadExample.vue +40 -0
  26. package/src/components/examples/FormExample.vue +121 -0
  27. package/src/components/examples/HugeTest.vue +8 -0
  28. package/src/components/examples/LayoutContainerExample.vue +80 -0
  29. package/src/components/examples/ModalExample.vue +82 -0
  30. package/src/components/examples/NavDrawerExample.vue +170 -0
  31. package/src/components/examples/NumberFieldExample.vue +145 -0
  32. package/src/components/examples/RadioButtonExample.vue +161 -0
  33. package/src/components/examples/SearchExample.vue +322 -0
  34. package/src/components/examples/SelectExample.vue +121 -0
  35. package/src/components/examples/StackedTableViewExample.vue +53 -0
  36. package/src/components/examples/TabExample.vue +336 -0
  37. package/src/components/examples/TableExample.vue +228 -0
  38. package/src/components/examples/TextFieldExample.vue +181 -0
  39. package/src/components/examples/TextareaExample.vue +173 -0
  40. package/src/components/examples/ThemeToggle.vue +50 -0
  41. package/src/components/examples/TimelineExample.vue +66 -0
  42. package/src/components/examples/TipTapEditorExample.vue +20 -0
  43. package/src/components/examples/TooltipExample.vue +53 -0
  44. package/src/components/examples/VueDatePickerShowcase.vue +214 -0
  45. package/src/components/examples/_DatePickerExample.vue +33 -0
  46. package/src/components/examples/__FormExample.vue +77 -0
  47. package/src/components/index.ts +25 -0
  48. package/src/components/pgo/AppBar.vue +347 -0
  49. package/src/components/pgo/Avatar.vue +139 -0
  50. package/src/components/pgo/Banner.vue +300 -0
  51. package/src/components/pgo/Breadcrumb.vue +101 -0
  52. package/src/components/pgo/Button.vue +171 -0
  53. package/src/components/pgo/Card.vue +178 -0
  54. package/src/components/pgo/ConfirmationModel.vue +32 -0
  55. package/src/components/pgo/DataTable.vue +845 -0
  56. package/src/components/pgo/DatePicker/CalendarPanel.vue +43 -0
  57. package/src/components/pgo/DatePicker/__DatePicker.vue +122 -0
  58. package/src/components/pgo/DatePicker/types.ts +11 -0
  59. package/src/components/pgo/DatePicker/useCalendar.ts +39 -0
  60. package/src/components/pgo/DatePicker/useDatePicker.ts +31 -0
  61. package/src/components/pgo/Deprecated/ToastContainer.vue +51 -0
  62. package/src/components/pgo/Deprecated/ToastItem.vue +55 -0
  63. package/src/components/pgo/Dropdown.vue +296 -0
  64. package/src/components/pgo/DropdownItem.vue +40 -0
  65. package/src/components/pgo/Editor.vue +511 -0
  66. package/src/components/pgo/ExpansionPanel.vue +185 -0
  67. package/src/components/pgo/Footer.vue +39 -0
  68. package/src/components/pgo/HeroIcon.vue +124 -0
  69. package/src/components/pgo/InputSearch.vue +194 -0
  70. package/src/components/pgo/LayoutContainer.vue +104 -0
  71. package/src/components/pgo/Main.vue +37 -0
  72. package/src/components/pgo/Modal.vue +273 -0
  73. package/src/components/pgo/NavDrawer.vue +127 -0
  74. package/src/components/pgo/NavDrawerItem.vue +161 -0
  75. package/src/components/pgo/NavigationDrawer.vue +849 -0
  76. package/src/components/pgo/OLDNavDrawer.vue +661 -0
  77. package/src/components/pgo/OldAppBar.vue +223 -0
  78. package/src/components/pgo/PApp.vue +102 -0
  79. package/src/components/pgo/Pagination.vue +242 -0
  80. package/src/components/pgo/Search copy.vue +310 -0
  81. package/src/components/pgo/Search.vue +411 -0
  82. package/src/components/pgo/StackedTableView.vue +167 -0
  83. package/src/components/pgo/Tab.vue +617 -0
  84. package/src/components/pgo/TestInput.vue +395 -0
  85. package/src/components/pgo/Timeline.vue +367 -0
  86. package/src/components/pgo/TimelineItem.vue +80 -0
  87. package/src/components/pgo/TipTapEditor.vue +315 -0
  88. package/src/components/pgo/Tooltip.NOTES.md +12 -0
  89. package/src/components/pgo/Tooltip.PROPS.md +21 -0
  90. package/src/components/pgo/Tooltip.vue +281 -0
  91. package/src/components/pgo/base/Base.vue +444 -0
  92. package/src/components/pgo/buttons/Chip.vue +324 -0
  93. package/src/components/pgo/buttons/ChipGroup.vue +224 -0
  94. package/src/components/pgo/buttons/Radio.vue +424 -0
  95. package/src/components/pgo/filters/FilterSection.vue +188 -0
  96. package/src/components/pgo/filters/Searchbar.vue +216 -0
  97. package/src/components/pgo/forms/DynamicForm.vue +45 -0
  98. package/src/components/pgo/forms/Form.vue +132 -0
  99. package/src/components/pgo/index.ts +15 -0
  100. package/src/components/pgo/inputs/Checkbox.vue +320 -0
  101. package/src/components/pgo/inputs/DatePicker.vue +395 -0
  102. package/src/components/pgo/inputs/FileUpload.vue +326 -0
  103. package/src/components/pgo/inputs/NumberField.vue +243 -0
  104. package/src/components/pgo/inputs/Radio.vue +162 -0
  105. package/src/components/pgo/inputs/RadioGroup.vue +188 -0
  106. package/src/components/pgo/inputs/Select.vue +535 -0
  107. package/src/components/pgo/inputs/TextField.vue +194 -0
  108. package/src/components/pgo/inputs/Textarea.vue +181 -0
  109. package/src/main.js +12 -0
  110. package/src/pgo-components/_index.js +31 -0
  111. package/src/pgo-components/assets/fonts/Faruma.ttf +0 -0
  112. package/src/pgo-components/assets/fonts/logo.png +0 -0
  113. package/src/pgo-components/composables/useTheme.js +10 -0
  114. package/src/pgo-components/directives/tooltip-directive.ts +393 -0
  115. package/src/pgo-components/index.js +96 -0
  116. package/src/pgo-components/lib/componentConfig.js +147 -0
  117. package/src/pgo-components/lib/core/composables/_useCalendar.ts +127 -0
  118. package/src/pgo-components/lib/core/composables/useDefaults.ts +15 -0
  119. package/src/pgo-components/lib/core/composables/useLanguageSelect.js +0 -0
  120. package/src/pgo-components/lib/core/composables/useRtl.ts +12 -0
  121. package/src/pgo-components/lib/core/defaults/createDefaults.ts +5 -0
  122. package/src/pgo-components/lib/core/defaults/defaults.ts +7 -0
  123. package/src/pgo-components/lib/core/rtl/rtl.ts +3 -0
  124. package/src/pgo-components/lib/core/rtl/setRtl.ts +19 -0
  125. package/src/pgo-components/lib/drawerState.ts +3 -0
  126. package/src/pgo-components/lib/i18n/defaultLables.js +71 -0
  127. package/src/pgo-components/lib/i18n/i18nPlugin.js +52 -0
  128. package/src/pgo-components/lib/i18n/useI18n.js +35 -0
  129. package/src/pgo-components/lib/index.ts +38 -0
  130. package/src/pgo-components/pages/Component.vue +7 -0
  131. package/src/pgo-components/pages/ComponentRenderer.vue +85 -0
  132. package/src/pgo-components/pages/Home.vue +130 -0
  133. package/src/pgo-components/pages/ListView.vue +370 -0
  134. package/src/pgo-components/pages/Page1.vue +296 -0
  135. package/src/pgo-components/pages/_Page1.vue +180 -0
  136. package/src/pgo-components/plugins/SnackBar.vue +251 -0
  137. package/src/pgo-components/plugins/SnackBarContainer.vue +53 -0
  138. package/src/pgo-components/plugins/SnackBarPlugin.ts +136 -0
  139. package/src/pgo-components/plugins/theme-plugin.js +114 -0
  140. package/src/pgo-components/plugins/types.ts +46 -0
  141. package/src/pgo-components/plugins/useSnackBar.js +11 -0
  142. package/src/pgo-components/plugins/useSnackBar.ts +21 -0
  143. package/src/pgo-components/plugins/validation-plugin.js +11 -0
  144. package/src/pgo-components/services/Entry.json +813 -0
  145. package/src/pgo-components/services/axios.js +54 -0
  146. package/src/pgo-components/services/data.json +90 -0
  147. package/src/pgo-components/services/person.json +260 -0
  148. package/src/pgo-components/services/toast.ts +44 -0
  149. package/src/pgo-components/styles/global.css +234 -0
  150. package/src/pgo-components/styles/reset.css +96 -0
  151. package/src/pgo-components/styles/tokens.css +18 -0
  152. package/src/pgo-components/styles/utilities/border-radius.css +57 -0
  153. package/src/pgo-components/styles/utilities/borders.css +85 -0
  154. package/src/pgo-components/styles/utilities/colors.css +38 -0
  155. package/src/pgo-components/styles/utilities/cursor.css +19 -0
  156. package/src/pgo-components/styles/utilities/display.css +78 -0
  157. package/src/pgo-components/styles/utilities/elevation.css +33 -0
  158. package/src/pgo-components/styles/utilities/flex.css +403 -0
  159. package/src/pgo-components/styles/utilities/float.css +41 -0
  160. package/src/pgo-components/styles/utilities/hover.css +9 -0
  161. package/src/pgo-components/styles/utilities/index.css +18 -0
  162. package/src/pgo-components/styles/utilities/opacity.css +27 -0
  163. package/src/pgo-components/styles/utilities/overflow.css +26 -0
  164. package/src/pgo-components/styles/utilities/palette.css +515 -0
  165. package/src/pgo-components/styles/utilities/position.css +14 -0
  166. package/src/pgo-components/styles/utilities/sizing.css +70 -0
  167. package/src/pgo-components/styles/utilities/spacing.css +578 -0
  168. package/src/pgo-components/styles/utilities/transitions.css +58 -0
  169. package/src/pgo-components/styles/utilities/typography.css +91 -0
  170. package/src/pgo-components/styles/utilities/z-index.css +11 -0
  171. package/src/pgo-components/tokens/index.js +337 -0
  172. package/src/router/index.js +88 -0
  173. package/src/shims-vue.d.ts +14 -0
  174. package/src/validations/validationRules.js +50 -0
  175. package/tailwind.config.js +73 -0
  176. package/test.php +5 -0
  177. package/tsconfig.json +25 -0
  178. package/ui +31 -0
  179. package/ui.pgo.mv.conf +18 -0
  180. package/vite.config.js +42 -0
@@ -0,0 +1,114 @@
1
+ import { reactive, readonly } from 'vue'
2
+ import { themes } from '../tokens/index.js'
3
+
4
+ const LOCAL_KEY = 'vts:theme'
5
+ const MEDIA = typeof window !== 'undefined' && window.matchMedia ? window.matchMedia('(prefers-color-scheme: dark)') : null
6
+
7
+ function flattenTokens(obj, prefix = '') {
8
+ const out = {}
9
+ for (const k in obj) {
10
+ const val = obj[k]
11
+ const name = prefix ? `${prefix}-${k}` : k
12
+ if (val && typeof val === 'object') Object.assign(out, flattenTokens(val, name))
13
+ else out[name] = val
14
+ }
15
+ return out
16
+ }
17
+
18
+ export function createThemePlugin({
19
+ themes: themeMap = themes,
20
+ defaultTheme = 'default',
21
+ defaultVariant = 'system' // supports 'light' | 'dark' | 'system'
22
+ } = {}) {
23
+ const state = reactive({
24
+ theme: defaultTheme,
25
+ variant: defaultVariant // 'system' or 'light' or 'dark'
26
+ })
27
+
28
+ function resolveVariant(variant) {
29
+ if (variant === 'system') {
30
+ if (MEDIA) return MEDIA.matches ? 'dark' : 'light'
31
+ return 'light'
32
+ }
33
+ return variant
34
+ }
35
+
36
+ function applyCssVars(themeName, resolvedVariant) {
37
+ const tokens = themeMap?.[themeName]?.[resolvedVariant]
38
+ if (!tokens) {
39
+ console.warn(`[vts] No tokens for ${themeName}/${resolvedVariant}`)
40
+ return
41
+ }
42
+ // also set a data-theme attribute for convenience/scoping
43
+ document.documentElement.setAttribute('data-theme', `${themeName}--${resolvedVariant}`)
44
+ // write CSS variables
45
+ const flat = flattenTokens(tokens)
46
+ Object.entries(flat).forEach(([k, v]) => {
47
+ if (v == null) return
48
+ const varName = `--vts-${k}`
49
+ document.documentElement.style.setProperty(varName, String(v))
50
+
51
+ // automatic component alias for component-level tokens
52
+ if (/^[a-z][a-zA-Z0-9]+-/.test(k)) {
53
+ const kebab = k.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase()
54
+ document.documentElement.style.setProperty(`--${kebab}`, `var(--vts-${k})`)
55
+ }
56
+ })
57
+ }
58
+
59
+
60
+
61
+ function setTheme(themeName, variantName = defaultVariant, { persist = true } = {}) {
62
+ if (!themeMap[themeName]) {
63
+ throw new Error(`[vts] Unknown theme "${themeName}"`)
64
+ }
65
+ state.theme = themeName
66
+ state.variant = variantName
67
+ const resolved = resolveVariant(variantName)
68
+ applyCssVars(themeName, resolved)
69
+ if (persist) {
70
+ try {
71
+ localStorage.setItem(LOCAL_KEY, JSON.stringify({ theme: themeName, variant: variantName }))
72
+ } catch {}
73
+ }
74
+ }
75
+
76
+ // initialize
77
+ ;(function init() {
78
+ try {
79
+ const stored = JSON.parse(localStorage.getItem(LOCAL_KEY) || 'null')
80
+ if (stored?.theme) setTheme(stored.theme, stored.variant ?? defaultVariant, { persist: false })
81
+ else setTheme(defaultTheme, defaultVariant, { persist: false })
82
+ } catch (e) {
83
+ setTheme(defaultTheme, defaultVariant, { persist: false })
84
+ }
85
+
86
+ if (MEDIA) {
87
+ MEDIA.addEventListener('change', () => {
88
+ if (state.variant === 'system') {
89
+ const resolved = resolveVariant('system')
90
+ applyCssVars(state.theme, resolved)
91
+ }
92
+ })
93
+ }
94
+ })()
95
+
96
+ return {
97
+ install(app) {
98
+ app.provide('vts-theme', readonly(state))
99
+ app.config.globalProperties.$vts = {
100
+ get theme() {
101
+ return state.theme
102
+ },
103
+ get variant() {
104
+ return state.variant
105
+ },
106
+ setTheme
107
+ }
108
+ },
109
+ setTheme,
110
+ state: readonly(state),
111
+ themes: themeMap,
112
+ resolveVariant
113
+ }
114
+ }
@@ -0,0 +1,46 @@
1
+ export type Variant = 'default' | 'success' | 'error' | 'warning' | 'info'
2
+
3
+ export interface SnackAction {
4
+ label: string
5
+ onClick?: (payload?: any) => void
6
+ }
7
+
8
+ export interface SnackOptions {
9
+ id?: string
10
+ message?: string
11
+ variant?: Variant
12
+ timeout?: number
13
+ actions?: SnackAction[]
14
+ position?: string
15
+ transition?: string
16
+ closeOnClick?: boolean
17
+ pauseOnHover?: boolean
18
+ mode?: 'stack' | 'queue'
19
+ onClose?: () => void
20
+ color?: string
21
+ icon?: any
22
+ rtl?: boolean
23
+ meta?: any
24
+ }
25
+
26
+ export interface SnackInternal
27
+ extends Required<
28
+ Pick<
29
+ SnackOptions,
30
+ | 'id'
31
+ | 'message'
32
+ | 'variant'
33
+ | 'timeout'
34
+ | 'actions'
35
+ | 'position'
36
+ | 'transition'
37
+ | 'closeOnClick'
38
+ | 'pauseOnHover'
39
+ | 'mode'
40
+ | 'onClose'
41
+ | 'color'
42
+ | 'icon'
43
+ | 'rtl'
44
+ | 'meta'
45
+ >
46
+ > {}
@@ -0,0 +1,11 @@
1
+ import { inject } from 'vue'
2
+
3
+ export function useSnackBar() {
4
+ const snackbar = inject('snackbar')
5
+
6
+ if (!snackbar) {
7
+ throw new Error('[useSnackBar] SnackBar plugin not installed')
8
+ }
9
+
10
+ return snackbar
11
+ }
@@ -0,0 +1,21 @@
1
+ import { inject } from 'vue'
2
+ import type { SnackOptions } from './types.ts'
3
+
4
+ export function useSnackBar() {
5
+ const api = inject('snackbar') as any
6
+
7
+ if (!api) {
8
+ throw new Error('[useSnackBar] SnackBar plugin not installed')
9
+ }
10
+
11
+ return api as {
12
+ show: (o: SnackOptions) => string
13
+ success: (m: string | SnackOptions, o?: Partial<SnackOptions>) => string
14
+ error: (m: string | SnackOptions, o?: Partial<SnackOptions>) => string
15
+ info: (m: string | SnackOptions, o?: Partial<SnackOptions>) => string
16
+ warning: (m: string | SnackOptions, o?: Partial<SnackOptions>) => string
17
+ close: (id?: string) => void
18
+ clear: () => void
19
+ state: any
20
+ }
21
+ }
@@ -0,0 +1,11 @@
1
+ import validationRules from '../../validations/validationRules'
2
+
3
+ export default {
4
+ install(app) {
5
+ // Make validation rules available globally via $rules
6
+ app.config.globalProperties.$rules = validationRules
7
+
8
+ // Also provide them for Composition API
9
+ app.provide('validationRules', validationRules)
10
+ }
11
+ }