@inorain_development/hotel-smarters-chat-ui 1.2.2 → 1.3.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.
- package/lib/commonjs/features/chat/components/common/calendar-icon.js +33 -0
- package/lib/commonjs/features/chat/components/common/calendar-icon.js.map +1 -0
- package/lib/commonjs/features/chat/components/common/calendar-icon.native.js +33 -0
- package/lib/commonjs/features/chat/components/common/calendar-icon.native.js.map +1 -0
- package/lib/commonjs/features/chat/components/common/cart-icon.js +36 -0
- package/lib/commonjs/features/chat/components/common/cart-icon.js.map +1 -0
- package/lib/commonjs/features/chat/components/common/chevron-icon.js +26 -0
- package/lib/commonjs/features/chat/components/common/chevron-icon.js.map +1 -0
- package/lib/commonjs/features/chat/components/common/chevron-icon.native.js +26 -0
- package/lib/commonjs/features/chat/components/common/chevron-icon.native.js.map +1 -0
- package/lib/commonjs/features/chat/components/common/plane-icon.js +23 -0
- package/lib/commonjs/features/chat/components/common/plane-icon.js.map +1 -0
- package/lib/commonjs/features/chat/components/common/plane-icon.native.js +23 -0
- package/lib/commonjs/features/chat/components/common/plane-icon.native.js.map +1 -0
- package/lib/commonjs/features/chat/components/flight/flight-card.js +130 -0
- package/lib/commonjs/features/chat/components/flight/flight-card.js.map +1 -0
- package/lib/commonjs/features/chat/components/flight/flight-card.native.js +132 -0
- package/lib/commonjs/features/chat/components/flight/flight-card.native.js.map +1 -0
- package/lib/commonjs/features/chat/components/flight/flight.js +149 -0
- package/lib/commonjs/features/chat/components/flight/flight.js.map +1 -0
- package/lib/commonjs/features/chat/components/flight/flight.model.js +6 -0
- package/lib/commonjs/features/chat/components/flight/flight.model.js.map +1 -0
- package/lib/commonjs/features/chat/components/flight/flight.native.js +151 -0
- package/lib/commonjs/features/chat/components/flight/flight.native.js.map +1 -0
- package/lib/commonjs/features/chat/components/flight/index.js +13 -0
- package/lib/commonjs/features/chat/components/flight/index.js.map +1 -0
- package/lib/commonjs/features/chat/components/flight-board/flight-board.js +154 -0
- package/lib/commonjs/features/chat/components/flight-board/flight-board.js.map +1 -0
- package/lib/commonjs/features/chat/components/flight-board/flight-board.model.js +6 -0
- package/lib/commonjs/features/chat/components/flight-board/flight-board.model.js.map +1 -0
- package/lib/commonjs/features/chat/components/flight-board/flight-board.native.js +165 -0
- package/lib/commonjs/features/chat/components/flight-board/flight-board.native.js.map +1 -0
- package/lib/commonjs/features/chat/components/flight-board/index.js +13 -0
- package/lib/commonjs/features/chat/components/flight-board/index.js.map +1 -0
- package/lib/commonjs/features/chat/components/info/info.js +41 -14
- package/lib/commonjs/features/chat/components/info/info.js.map +1 -1
- package/lib/commonjs/features/chat/components/info/info.native.js +45 -14
- package/lib/commonjs/features/chat/components/info/info.native.js.map +1 -1
- package/lib/commonjs/features/chat/components/order/index.js +20 -0
- package/lib/commonjs/features/chat/components/order/index.js.map +1 -0
- package/lib/commonjs/features/chat/components/order/order.js +171 -0
- package/lib/commonjs/features/chat/components/order/order.js.map +1 -0
- package/lib/commonjs/features/chat/components/order/order.model.js +15 -0
- package/lib/commonjs/features/chat/components/order/order.model.js.map +1 -0
- package/lib/commonjs/features/chat/components/order/order.native.js +192 -0
- package/lib/commonjs/features/chat/components/order/order.native.js.map +1 -0
- package/lib/commonjs/features/chat/components/reservation/index.js +20 -0
- package/lib/commonjs/features/chat/components/reservation/index.js.map +1 -0
- package/lib/commonjs/features/chat/components/reservation/reservation.js +164 -0
- package/lib/commonjs/features/chat/components/reservation/reservation.js.map +1 -0
- package/lib/commonjs/features/chat/components/reservation/reservation.model.js +13 -0
- package/lib/commonjs/features/chat/components/reservation/reservation.model.js.map +1 -0
- package/lib/commonjs/features/chat/components/reservation/reservation.native.js +180 -0
- package/lib/commonjs/features/chat/components/reservation/reservation.native.js.map +1 -0
- package/lib/commonjs/features/chat/model/chat.model.js +17 -1
- package/lib/commonjs/features/chat/model/chat.model.js.map +1 -1
- package/lib/commonjs/features/chat/renderer/renderer.js +26 -0
- package/lib/commonjs/features/chat/renderer/renderer.js.map +1 -1
- package/lib/commonjs/features/chat/renderer/renderer.native.js +26 -0
- package/lib/commonjs/features/chat/renderer/renderer.native.js.map +1 -1
- package/lib/commonjs/native.js +48 -0
- package/lib/commonjs/native.js.map +1 -1
- package/lib/commonjs/utils/flight.utils.js +86 -0
- package/lib/commonjs/utils/flight.utils.js.map +1 -0
- package/lib/commonjs/utils/order.utils.js +24 -0
- package/lib/commonjs/utils/order.utils.js.map +1 -0
- package/lib/commonjs/utils/reservation.utils.js +22 -0
- package/lib/commonjs/utils/reservation.utils.js.map +1 -0
- package/lib/commonjs/utils/status-badge.utils.js +75 -0
- package/lib/commonjs/utils/status-badge.utils.js.map +1 -0
- package/lib/commonjs/utils/theme.utils.js +8 -2
- package/lib/commonjs/utils/theme.utils.js.map +1 -1
- package/lib/commonjs/web.js +48 -0
- package/lib/commonjs/web.js.map +1 -1
- package/lib/module/features/chat/components/common/calendar-icon.js +29 -0
- package/lib/module/features/chat/components/common/calendar-icon.js.map +1 -0
- package/lib/module/features/chat/components/common/calendar-icon.native.js +29 -0
- package/lib/module/features/chat/components/common/calendar-icon.native.js.map +1 -0
- package/lib/module/features/chat/components/common/cart-icon.js +32 -0
- package/lib/module/features/chat/components/common/cart-icon.js.map +1 -0
- package/lib/module/features/chat/components/common/chevron-icon.js +22 -0
- package/lib/module/features/chat/components/common/chevron-icon.js.map +1 -0
- package/lib/module/features/chat/components/common/chevron-icon.native.js +22 -0
- package/lib/module/features/chat/components/common/chevron-icon.native.js.map +1 -0
- package/lib/module/features/chat/components/common/plane-icon.js +19 -0
- package/lib/module/features/chat/components/common/plane-icon.js.map +1 -0
- package/lib/module/features/chat/components/common/plane-icon.native.js +19 -0
- package/lib/module/features/chat/components/common/plane-icon.native.js.map +1 -0
- package/lib/module/features/chat/components/flight/flight-card.js +126 -0
- package/lib/module/features/chat/components/flight/flight-card.js.map +1 -0
- package/lib/module/features/chat/components/flight/flight-card.native.js +128 -0
- package/lib/module/features/chat/components/flight/flight-card.native.js.map +1 -0
- package/lib/module/features/chat/components/flight/flight.js +145 -0
- package/lib/module/features/chat/components/flight/flight.js.map +1 -0
- package/lib/module/features/chat/components/flight/flight.model.js +4 -0
- package/lib/module/features/chat/components/flight/flight.model.js.map +1 -0
- package/lib/module/features/chat/components/flight/flight.native.js +147 -0
- package/lib/module/features/chat/components/flight/flight.native.js.map +1 -0
- package/lib/module/features/chat/components/flight/index.js +4 -0
- package/lib/module/features/chat/components/flight/index.js.map +1 -0
- package/lib/module/features/chat/components/flight-board/flight-board.js +150 -0
- package/lib/module/features/chat/components/flight-board/flight-board.js.map +1 -0
- package/lib/module/features/chat/components/flight-board/flight-board.model.js +4 -0
- package/lib/module/features/chat/components/flight-board/flight-board.model.js.map +1 -0
- package/lib/module/features/chat/components/flight-board/flight-board.native.js +161 -0
- package/lib/module/features/chat/components/flight-board/flight-board.native.js.map +1 -0
- package/lib/module/features/chat/components/flight-board/index.js +4 -0
- package/lib/module/features/chat/components/flight-board/index.js.map +1 -0
- package/lib/module/features/chat/components/info/info.js +41 -14
- package/lib/module/features/chat/components/info/info.js.map +1 -1
- package/lib/module/features/chat/components/info/info.native.js +46 -15
- package/lib/module/features/chat/components/info/info.native.js.map +1 -1
- package/lib/module/features/chat/components/order/index.js +5 -0
- package/lib/module/features/chat/components/order/index.js.map +1 -0
- package/lib/module/features/chat/components/order/order.js +167 -0
- package/lib/module/features/chat/components/order/order.js.map +1 -0
- package/lib/module/features/chat/components/order/order.model.js +11 -0
- package/lib/module/features/chat/components/order/order.model.js.map +1 -0
- package/lib/module/features/chat/components/order/order.native.js +188 -0
- package/lib/module/features/chat/components/order/order.native.js.map +1 -0
- package/lib/module/features/chat/components/reservation/index.js +5 -0
- package/lib/module/features/chat/components/reservation/index.js.map +1 -0
- package/lib/module/features/chat/components/reservation/reservation.js +160 -0
- package/lib/module/features/chat/components/reservation/reservation.js.map +1 -0
- package/lib/module/features/chat/components/reservation/reservation.model.js +9 -0
- package/lib/module/features/chat/components/reservation/reservation.model.js.map +1 -0
- package/lib/module/features/chat/components/reservation/reservation.native.js +176 -0
- package/lib/module/features/chat/components/reservation/reservation.native.js.map +1 -0
- package/lib/module/features/chat/model/chat.model.js +16 -0
- package/lib/module/features/chat/model/chat.model.js.map +1 -1
- package/lib/module/features/chat/renderer/renderer.js +26 -0
- package/lib/module/features/chat/renderer/renderer.js.map +1 -1
- package/lib/module/features/chat/renderer/renderer.native.js +26 -0
- package/lib/module/features/chat/renderer/renderer.native.js.map +1 -1
- package/lib/module/native.js +7 -1
- package/lib/module/native.js.map +1 -1
- package/lib/module/utils/flight.utils.js +82 -0
- package/lib/module/utils/flight.utils.js.map +1 -0
- package/lib/module/utils/order.utils.js +20 -0
- package/lib/module/utils/order.utils.js.map +1 -0
- package/lib/module/utils/reservation.utils.js +18 -0
- package/lib/module/utils/reservation.utils.js.map +1 -0
- package/lib/module/utils/status-badge.utils.js +70 -0
- package/lib/module/utils/status-badge.utils.js.map +1 -0
- package/lib/module/utils/theme.utils.js +8 -2
- package/lib/module/utils/theme.utils.js.map +1 -1
- package/lib/module/web.js +7 -1
- package/lib/module/web.js.map +1 -1
- package/lib/typescript/commonjs/features/chat/components/common/calendar-icon.d.ts +6 -0
- package/lib/typescript/commonjs/features/chat/components/common/calendar-icon.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/common/calendar-icon.native.d.ts +6 -0
- package/lib/typescript/commonjs/features/chat/components/common/calendar-icon.native.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/common/cart-icon.d.ts +6 -0
- package/lib/typescript/commonjs/features/chat/components/common/cart-icon.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/common/chevron-icon.d.ts +6 -0
- package/lib/typescript/commonjs/features/chat/components/common/chevron-icon.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/common/chevron-icon.native.d.ts +6 -0
- package/lib/typescript/commonjs/features/chat/components/common/chevron-icon.native.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/common/plane-icon.d.ts +6 -0
- package/lib/typescript/commonjs/features/chat/components/common/plane-icon.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/common/plane-icon.native.d.ts +6 -0
- package/lib/typescript/commonjs/features/chat/components/common/plane-icon.native.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/flight/flight-card.d.ts +12 -0
- package/lib/typescript/commonjs/features/chat/components/flight/flight-card.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/flight/flight-card.native.d.ts +12 -0
- package/lib/typescript/commonjs/features/chat/components/flight/flight-card.native.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/flight/flight.d.ts +4 -0
- package/lib/typescript/commonjs/features/chat/components/flight/flight.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/flight/flight.model.d.ts +19 -0
- package/lib/typescript/commonjs/features/chat/components/flight/flight.model.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/flight/flight.native.d.ts +4 -0
- package/lib/typescript/commonjs/features/chat/components/flight/flight.native.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/flight/index.d.ts +3 -0
- package/lib/typescript/commonjs/features/chat/components/flight/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/flight-board/flight-board.d.ts +4 -0
- package/lib/typescript/commonjs/features/chat/components/flight-board/flight-board.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/flight-board/flight-board.model.d.ts +22 -0
- package/lib/typescript/commonjs/features/chat/components/flight-board/flight-board.model.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/flight-board/flight-board.native.d.ts +4 -0
- package/lib/typescript/commonjs/features/chat/components/flight-board/flight-board.native.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/flight-board/index.d.ts +3 -0
- package/lib/typescript/commonjs/features/chat/components/flight-board/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/info/info.d.ts +1 -1
- package/lib/typescript/commonjs/features/chat/components/info/info.d.ts.map +1 -1
- package/lib/typescript/commonjs/features/chat/components/info/info.model.d.ts +3 -0
- package/lib/typescript/commonjs/features/chat/components/info/info.model.d.ts.map +1 -1
- package/lib/typescript/commonjs/features/chat/components/info/info.native.d.ts +1 -1
- package/lib/typescript/commonjs/features/chat/components/info/info.native.d.ts.map +1 -1
- package/lib/typescript/commonjs/features/chat/components/order/index.d.ts +4 -0
- package/lib/typescript/commonjs/features/chat/components/order/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/order/order.d.ts +4 -0
- package/lib/typescript/commonjs/features/chat/components/order/order.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/order/order.model.d.ts +30 -0
- package/lib/typescript/commonjs/features/chat/components/order/order.model.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/order/order.native.d.ts +4 -0
- package/lib/typescript/commonjs/features/chat/components/order/order.native.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/reservation/index.d.ts +4 -0
- package/lib/typescript/commonjs/features/chat/components/reservation/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/reservation/reservation.d.ts +4 -0
- package/lib/typescript/commonjs/features/chat/components/reservation/reservation.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/reservation/reservation.model.d.ts +27 -0
- package/lib/typescript/commonjs/features/chat/components/reservation/reservation.model.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/components/reservation/reservation.native.d.ts +4 -0
- package/lib/typescript/commonjs/features/chat/components/reservation/reservation.native.d.ts.map +1 -0
- package/lib/typescript/commonjs/features/chat/model/chat.model.d.ts +17 -2
- package/lib/typescript/commonjs/features/chat/model/chat.model.d.ts.map +1 -1
- package/lib/typescript/commonjs/features/chat/renderer/renderer.d.ts +5 -1
- package/lib/typescript/commonjs/features/chat/renderer/renderer.d.ts.map +1 -1
- package/lib/typescript/commonjs/features/chat/renderer/renderer.native.d.ts +5 -1
- package/lib/typescript/commonjs/features/chat/renderer/renderer.native.d.ts.map +1 -1
- package/lib/typescript/commonjs/native.d.ts +11 -1
- package/lib/typescript/commonjs/native.d.ts.map +1 -1
- package/lib/typescript/commonjs/utils/flight.utils.d.ts +10 -0
- package/lib/typescript/commonjs/utils/flight.utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/order.utils.d.ts +7 -0
- package/lib/typescript/commonjs/utils/order.utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/reservation.utils.d.ts +7 -0
- package/lib/typescript/commonjs/utils/reservation.utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/status-badge.utils.d.ts +15 -0
- package/lib/typescript/commonjs/utils/status-badge.utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/theme.utils.d.ts +3 -0
- package/lib/typescript/commonjs/utils/theme.utils.d.ts.map +1 -1
- package/lib/typescript/commonjs/web.d.ts +11 -1
- package/lib/typescript/commonjs/web.d.ts.map +1 -1
- package/lib/typescript/module/features/chat/components/common/calendar-icon.d.ts +6 -0
- package/lib/typescript/module/features/chat/components/common/calendar-icon.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/common/calendar-icon.native.d.ts +6 -0
- package/lib/typescript/module/features/chat/components/common/calendar-icon.native.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/common/cart-icon.d.ts +6 -0
- package/lib/typescript/module/features/chat/components/common/cart-icon.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/common/chevron-icon.d.ts +6 -0
- package/lib/typescript/module/features/chat/components/common/chevron-icon.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/common/chevron-icon.native.d.ts +6 -0
- package/lib/typescript/module/features/chat/components/common/chevron-icon.native.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/common/plane-icon.d.ts +6 -0
- package/lib/typescript/module/features/chat/components/common/plane-icon.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/common/plane-icon.native.d.ts +6 -0
- package/lib/typescript/module/features/chat/components/common/plane-icon.native.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/flight/flight-card.d.ts +12 -0
- package/lib/typescript/module/features/chat/components/flight/flight-card.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/flight/flight-card.native.d.ts +12 -0
- package/lib/typescript/module/features/chat/components/flight/flight-card.native.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/flight/flight.d.ts +4 -0
- package/lib/typescript/module/features/chat/components/flight/flight.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/flight/flight.model.d.ts +19 -0
- package/lib/typescript/module/features/chat/components/flight/flight.model.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/flight/flight.native.d.ts +4 -0
- package/lib/typescript/module/features/chat/components/flight/flight.native.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/flight/index.d.ts +3 -0
- package/lib/typescript/module/features/chat/components/flight/index.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/flight-board/flight-board.d.ts +4 -0
- package/lib/typescript/module/features/chat/components/flight-board/flight-board.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/flight-board/flight-board.model.d.ts +22 -0
- package/lib/typescript/module/features/chat/components/flight-board/flight-board.model.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/flight-board/flight-board.native.d.ts +4 -0
- package/lib/typescript/module/features/chat/components/flight-board/flight-board.native.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/flight-board/index.d.ts +3 -0
- package/lib/typescript/module/features/chat/components/flight-board/index.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/info/info.d.ts +1 -1
- package/lib/typescript/module/features/chat/components/info/info.d.ts.map +1 -1
- package/lib/typescript/module/features/chat/components/info/info.model.d.ts +3 -0
- package/lib/typescript/module/features/chat/components/info/info.model.d.ts.map +1 -1
- package/lib/typescript/module/features/chat/components/info/info.native.d.ts +1 -1
- package/lib/typescript/module/features/chat/components/info/info.native.d.ts.map +1 -1
- package/lib/typescript/module/features/chat/components/order/index.d.ts +4 -0
- package/lib/typescript/module/features/chat/components/order/index.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/order/order.d.ts +4 -0
- package/lib/typescript/module/features/chat/components/order/order.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/order/order.model.d.ts +30 -0
- package/lib/typescript/module/features/chat/components/order/order.model.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/order/order.native.d.ts +4 -0
- package/lib/typescript/module/features/chat/components/order/order.native.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/reservation/index.d.ts +4 -0
- package/lib/typescript/module/features/chat/components/reservation/index.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/reservation/reservation.d.ts +4 -0
- package/lib/typescript/module/features/chat/components/reservation/reservation.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/reservation/reservation.model.d.ts +27 -0
- package/lib/typescript/module/features/chat/components/reservation/reservation.model.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/components/reservation/reservation.native.d.ts +4 -0
- package/lib/typescript/module/features/chat/components/reservation/reservation.native.d.ts.map +1 -0
- package/lib/typescript/module/features/chat/model/chat.model.d.ts +17 -2
- package/lib/typescript/module/features/chat/model/chat.model.d.ts.map +1 -1
- package/lib/typescript/module/features/chat/renderer/renderer.d.ts +5 -1
- package/lib/typescript/module/features/chat/renderer/renderer.d.ts.map +1 -1
- package/lib/typescript/module/features/chat/renderer/renderer.native.d.ts +5 -1
- package/lib/typescript/module/features/chat/renderer/renderer.native.d.ts.map +1 -1
- package/lib/typescript/module/native.d.ts +11 -1
- package/lib/typescript/module/native.d.ts.map +1 -1
- package/lib/typescript/module/utils/flight.utils.d.ts +10 -0
- package/lib/typescript/module/utils/flight.utils.d.ts.map +1 -0
- package/lib/typescript/module/utils/order.utils.d.ts +7 -0
- package/lib/typescript/module/utils/order.utils.d.ts.map +1 -0
- package/lib/typescript/module/utils/reservation.utils.d.ts +7 -0
- package/lib/typescript/module/utils/reservation.utils.d.ts.map +1 -0
- package/lib/typescript/module/utils/status-badge.utils.d.ts +15 -0
- package/lib/typescript/module/utils/status-badge.utils.d.ts.map +1 -0
- package/lib/typescript/module/utils/theme.utils.d.ts +3 -0
- package/lib/typescript/module/utils/theme.utils.d.ts.map +1 -1
- package/lib/typescript/module/web.d.ts +11 -1
- package/lib/typescript/module/web.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/features/chat/components/common/calendar-icon.native.tsx +13 -0
- package/src/features/chat/components/common/calendar-icon.tsx +13 -0
- package/src/features/chat/components/common/cart-icon.tsx +20 -0
- package/src/features/chat/components/common/chevron-icon.native.tsx +18 -0
- package/src/features/chat/components/common/chevron-icon.tsx +18 -0
- package/src/features/chat/components/common/plane-icon.native.tsx +15 -0
- package/src/features/chat/components/common/plane-icon.tsx +15 -0
- package/src/features/chat/components/flight/flight-card.native.tsx +100 -0
- package/src/features/chat/components/flight/flight-card.tsx +100 -0
- package/src/features/chat/components/flight/flight.model.ts +20 -0
- package/src/features/chat/components/flight/flight.native.tsx +131 -0
- package/src/features/chat/components/flight/flight.tsx +131 -0
- package/src/features/chat/components/flight/index.ts +2 -0
- package/src/features/chat/components/flight-board/flight-board.model.ts +23 -0
- package/src/features/chat/components/flight-board/flight-board.native.tsx +155 -0
- package/src/features/chat/components/flight-board/flight-board.tsx +160 -0
- package/src/features/chat/components/flight-board/index.ts +2 -0
- package/src/features/chat/components/info/info.model.ts +3 -0
- package/src/features/chat/components/info/info.native.tsx +47 -11
- package/src/features/chat/components/info/info.tsx +43 -10
- package/src/features/chat/components/order/index.ts +3 -0
- package/src/features/chat/components/order/order.model.ts +32 -0
- package/src/features/chat/components/order/order.native.tsx +175 -0
- package/src/features/chat/components/order/order.tsx +176 -0
- package/src/features/chat/components/reservation/index.ts +3 -0
- package/src/features/chat/components/reservation/reservation.model.ts +29 -0
- package/src/features/chat/components/reservation/reservation.native.tsx +159 -0
- package/src/features/chat/components/reservation/reservation.tsx +161 -0
- package/src/features/chat/model/chat.model.ts +16 -0
- package/src/features/chat/renderer/renderer.native.tsx +29 -1
- package/src/features/chat/renderer/renderer.tsx +29 -1
- package/src/native.ts +11 -1
- package/src/utils/flight.utils.ts +35 -0
- package/src/utils/order.utils.ts +28 -0
- package/src/utils/reservation.utils.ts +23 -0
- package/src/utils/status-badge.utils.ts +36 -0
- package/src/utils/theme.utils.ts +9 -0
- package/src/web.ts +11 -1
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { Fragment } from 'react';
|
|
2
|
+
import { Pressable, Text, View } from 'react-native';
|
|
3
|
+
import { getThemeClasses } from '../../../../utils/theme.utils';
|
|
4
|
+
import { getReservationStatusStyle } from '../../../../utils/reservation.utils';
|
|
5
|
+
import { resolveText } from '../../../../utils/i18n.utils';
|
|
6
|
+
import { useExpandableList } from '../../../../utils/use-expandable-list';
|
|
7
|
+
import { Collapsible } from '../common/collapsible.native';
|
|
8
|
+
import { CalendarIcon } from '../common/calendar-icon.native';
|
|
9
|
+
import { ChevronIcon } from '../common/chevron-icon.native';
|
|
10
|
+
import { ItemAction, Theme } from '../../model/chat.model';
|
|
11
|
+
import type { ChatComponentProps } from '../../model/chat.model';
|
|
12
|
+
import type { ReservationListItem, ReservationRow } from './reservation.model';
|
|
13
|
+
|
|
14
|
+
export function Reservation({
|
|
15
|
+
data,
|
|
16
|
+
theme = Theme.Dark,
|
|
17
|
+
language,
|
|
18
|
+
actionLabel,
|
|
19
|
+
onAction,
|
|
20
|
+
onSelect,
|
|
21
|
+
}: ChatComponentProps<ReservationListItem>) {
|
|
22
|
+
const c = getThemeClasses(theme);
|
|
23
|
+
const list = Array.isArray(data) ? data[0] : data;
|
|
24
|
+
const reservations = list?.reservations ?? [];
|
|
25
|
+
const { head, rest, expanded, hasMore, toggle } = useExpandableList(reservations);
|
|
26
|
+
|
|
27
|
+
if (!list) return null;
|
|
28
|
+
|
|
29
|
+
const onSelectRow = onSelect as ((row: ReservationRow) => void) | undefined;
|
|
30
|
+
const title = resolveText(list.title, language);
|
|
31
|
+
const subtitle = list.subtitle ? resolveText(list.subtitle, language) : undefined;
|
|
32
|
+
const totalLabel = list.totalLabel ? resolveText(list.totalLabel, language) : undefined;
|
|
33
|
+
const action = list.actionLabel
|
|
34
|
+
? resolveText(list.actionLabel, language)
|
|
35
|
+
: typeof actionLabel === 'function'
|
|
36
|
+
? actionLabel(list)
|
|
37
|
+
: actionLabel;
|
|
38
|
+
const headerStyle = getReservationStatusStyle(list.status, theme);
|
|
39
|
+
const headerStatusLabel = list.statusLabel ? resolveText(list.statusLabel, language) : headerStyle.label;
|
|
40
|
+
|
|
41
|
+
const renderRow = (row: ReservationRow) => {
|
|
42
|
+
const s = getReservationStatusStyle(row.status, theme);
|
|
43
|
+
const statusLabel = row.statusLabel ? resolveText(row.statusLabel, language) : s.label;
|
|
44
|
+
const name = resolveText(row.name, language);
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<Pressable className="flex-row items-center gap-3 py-2.5" onPress={() => onSelectRow?.(row)}>
|
|
48
|
+
<View className={`h-11 w-11 items-center justify-center rounded-xl ${c.mutedIconBg}`}>
|
|
49
|
+
<CalendarIcon size={18} color={c.mutedIconColor} />
|
|
50
|
+
</View>
|
|
51
|
+
|
|
52
|
+
<View className="flex-1 gap-1">
|
|
53
|
+
<View className="flex-row items-center justify-between gap-2">
|
|
54
|
+
<Text className={`flex-1 text-sm font-semibold ${c.title}`} numberOfLines={1}>
|
|
55
|
+
{name}
|
|
56
|
+
</Text>
|
|
57
|
+
<Text className={`text-sm font-bold ${c.price}`}>{row.price}</Text>
|
|
58
|
+
</View>
|
|
59
|
+
<View className="flex-row items-center justify-between gap-2">
|
|
60
|
+
<Text className={`flex-1 text-xs ${c.subtitle}`} numberOfLines={1}>
|
|
61
|
+
{row.date} · {row.time}
|
|
62
|
+
{row.duration ? ` · ${row.duration}` : ''}
|
|
63
|
+
</Text>
|
|
64
|
+
<View className={`rounded-full px-2 py-0.5 ${s.badgeBg}`}>
|
|
65
|
+
<Text className={`text-[11px] font-semibold ${s.badgeText}`}>{statusLabel}</Text>
|
|
66
|
+
</View>
|
|
67
|
+
</View>
|
|
68
|
+
</View>
|
|
69
|
+
</Pressable>
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<View className={`rounded-2xl border p-3.5 ${c.surface} ${c.border}`}>
|
|
75
|
+
<View className="flex-row items-center gap-3">
|
|
76
|
+
<View className={`h-11 w-11 items-center justify-center rounded-xl ${c.iconBg}`}>
|
|
77
|
+
<CalendarIcon size={20} color={c.iconColor} />
|
|
78
|
+
</View>
|
|
79
|
+
|
|
80
|
+
<View className="flex-1">
|
|
81
|
+
<Text className={`text-base font-bold ${c.title}`} numberOfLines={1}>
|
|
82
|
+
{title}
|
|
83
|
+
</Text>
|
|
84
|
+
{subtitle ? (
|
|
85
|
+
<Text className={`text-xs ${c.subtitle}`} numberOfLines={1}>
|
|
86
|
+
{subtitle}
|
|
87
|
+
</Text>
|
|
88
|
+
) : null}
|
|
89
|
+
</View>
|
|
90
|
+
|
|
91
|
+
<View className={`rounded-full px-2.5 py-1 ${headerStyle.badgeBg}`}>
|
|
92
|
+
<Text className={`text-xs font-semibold ${headerStyle.badgeText}`}>{headerStatusLabel}</Text>
|
|
93
|
+
</View>
|
|
94
|
+
</View>
|
|
95
|
+
|
|
96
|
+
<View className={`my-3 h-px ${c.divider}`} />
|
|
97
|
+
|
|
98
|
+
{head.map((row, index) => (
|
|
99
|
+
<Fragment key={row.id}>
|
|
100
|
+
{index > 0 ? <View className={`h-px ${c.divider}`} /> : null}
|
|
101
|
+
{renderRow(row)}
|
|
102
|
+
</Fragment>
|
|
103
|
+
))}
|
|
104
|
+
|
|
105
|
+
{hasMore ? (
|
|
106
|
+
<Collapsible expanded={expanded}>
|
|
107
|
+
{rest.map((row) => (
|
|
108
|
+
<Fragment key={row.id}>
|
|
109
|
+
<View className={`h-px ${c.divider}`} />
|
|
110
|
+
{renderRow(row)}
|
|
111
|
+
</Fragment>
|
|
112
|
+
))}
|
|
113
|
+
</Collapsible>
|
|
114
|
+
) : null}
|
|
115
|
+
|
|
116
|
+
{hasMore ? (
|
|
117
|
+
<Pressable onPress={toggle} className="mt-1 flex-row items-center justify-between gap-2 py-2">
|
|
118
|
+
<View className="flex-row items-center gap-2">
|
|
119
|
+
<View className={`h-7 w-7 items-center justify-center rounded-full ${c.iconBg}`}>
|
|
120
|
+
<Text className={`text-xs font-semibold ${c.iconText}`}>+{rest.length}</Text>
|
|
121
|
+
</View>
|
|
122
|
+
<Text className={`text-sm ${c.subtitle}`}>
|
|
123
|
+
{expanded
|
|
124
|
+
? `Showing all ${reservations.length} requests`
|
|
125
|
+
: `Showing ${head.length} of ${reservations.length} requests`}
|
|
126
|
+
</Text>
|
|
127
|
+
</View>
|
|
128
|
+
<View className="flex-row items-center gap-1">
|
|
129
|
+
<Text className={`text-sm font-semibold ${c.iconText}`}>{expanded ? 'Show less' : 'View all'}</Text>
|
|
130
|
+
<View className={expanded ? 'rotate-180' : undefined}>
|
|
131
|
+
<ChevronIcon size={14} color={c.iconColor} />
|
|
132
|
+
</View>
|
|
133
|
+
</View>
|
|
134
|
+
</Pressable>
|
|
135
|
+
) : null}
|
|
136
|
+
|
|
137
|
+
{list.total || action ? (
|
|
138
|
+
<>
|
|
139
|
+
<View className={`my-3 h-px ${c.divider}`} />
|
|
140
|
+
<View className="flex-row items-center justify-between gap-3">
|
|
141
|
+
<View>
|
|
142
|
+
{totalLabel ? <Text className={`text-xs ${c.subtitle}`}>{totalLabel}</Text> : null}
|
|
143
|
+
{list.total ? <Text className={`text-lg font-bold ${c.title}`}>{list.total}</Text> : null}
|
|
144
|
+
</View>
|
|
145
|
+
|
|
146
|
+
{action ? (
|
|
147
|
+
<Pressable
|
|
148
|
+
onPress={() => onAction?.(list, ItemAction.Manage)}
|
|
149
|
+
className="rounded-xl bg-indigo-500 px-4 py-2"
|
|
150
|
+
>
|
|
151
|
+
<Text className="text-sm font-semibold text-white">{action}</Text>
|
|
152
|
+
</Pressable>
|
|
153
|
+
) : null}
|
|
154
|
+
</View>
|
|
155
|
+
</>
|
|
156
|
+
) : null}
|
|
157
|
+
</View>
|
|
158
|
+
);
|
|
159
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { Fragment } from 'react';
|
|
2
|
+
import { getThemeClasses } from '../../../../utils/theme.utils';
|
|
3
|
+
import { getReservationStatusStyle } from '../../../../utils/reservation.utils';
|
|
4
|
+
import { resolveText } from '../../../../utils/i18n.utils';
|
|
5
|
+
import { useExpandableList } from '../../../../utils/use-expandable-list';
|
|
6
|
+
import { Collapsible } from '../common/collapsible';
|
|
7
|
+
import { CalendarIcon } from '../common/calendar-icon';
|
|
8
|
+
import { ChevronIcon } from '../common/chevron-icon';
|
|
9
|
+
import { ItemAction, Theme } from '../../model/chat.model';
|
|
10
|
+
import type { ChatComponentProps } from '../../model/chat.model';
|
|
11
|
+
import type { ReservationListItem, ReservationRow } from './reservation.model';
|
|
12
|
+
|
|
13
|
+
export function Reservation({
|
|
14
|
+
data,
|
|
15
|
+
theme = Theme.Dark,
|
|
16
|
+
language,
|
|
17
|
+
actionLabel,
|
|
18
|
+
onAction,
|
|
19
|
+
onSelect,
|
|
20
|
+
}: ChatComponentProps<ReservationListItem>) {
|
|
21
|
+
const c = getThemeClasses(theme);
|
|
22
|
+
const list = Array.isArray(data) ? data[0] : data;
|
|
23
|
+
const reservations = list?.reservations ?? [];
|
|
24
|
+
const { head, rest, expanded, hasMore, toggle } = useExpandableList(reservations);
|
|
25
|
+
|
|
26
|
+
if (!list) return null;
|
|
27
|
+
|
|
28
|
+
const onSelectRow = onSelect as ((row: ReservationRow) => void) | undefined;
|
|
29
|
+
const title = resolveText(list.title, language);
|
|
30
|
+
const subtitle = list.subtitle ? resolveText(list.subtitle, language) : undefined;
|
|
31
|
+
const totalLabel = list.totalLabel ? resolveText(list.totalLabel, language) : undefined;
|
|
32
|
+
const action = list.actionLabel
|
|
33
|
+
? resolveText(list.actionLabel, language)
|
|
34
|
+
: typeof actionLabel === 'function'
|
|
35
|
+
? actionLabel(list)
|
|
36
|
+
: actionLabel;
|
|
37
|
+
const headerStyle = getReservationStatusStyle(list.status, theme);
|
|
38
|
+
const headerStatusLabel = list.statusLabel ? resolveText(list.statusLabel, language) : headerStyle.label;
|
|
39
|
+
|
|
40
|
+
const renderRow = (row: ReservationRow) => {
|
|
41
|
+
const s = getReservationStatusStyle(row.status, theme);
|
|
42
|
+
const statusLabel = row.statusLabel ? resolveText(row.statusLabel, language) : s.label;
|
|
43
|
+
const name = resolveText(row.name, language);
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<button
|
|
47
|
+
type="button"
|
|
48
|
+
className="flex w-full items-center gap-3 py-2.5 text-left"
|
|
49
|
+
onClick={() => onSelectRow?.(row)}
|
|
50
|
+
>
|
|
51
|
+
<div className={`flex h-11 w-11 shrink-0 items-center justify-center rounded-xl ${c.mutedIconBg}`}>
|
|
52
|
+
<CalendarIcon size={18} color={c.mutedIconColor} />
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<div className="flex min-w-0 flex-1 flex-col gap-1">
|
|
56
|
+
<div className="flex items-center justify-between gap-2">
|
|
57
|
+
<span className={`truncate text-sm font-semibold ${c.title}`}>{name}</span>
|
|
58
|
+
<span className={`shrink-0 text-sm font-bold ${c.price}`}>{row.price}</span>
|
|
59
|
+
</div>
|
|
60
|
+
<div className="flex items-center justify-between gap-2">
|
|
61
|
+
<span className={`truncate text-xs ${c.subtitle}`}>
|
|
62
|
+
{row.date} · {row.time}
|
|
63
|
+
{row.duration ? ` · ${row.duration}` : ''}
|
|
64
|
+
</span>
|
|
65
|
+
<span className={`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-semibold ${s.badgeBg} ${s.badgeText}`}>
|
|
66
|
+
{statusLabel}
|
|
67
|
+
</span>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
</button>
|
|
71
|
+
);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<div className={`rounded-2xl border p-3.5 ${c.surface} ${c.border}`}>
|
|
76
|
+
<div className="flex items-center gap-3">
|
|
77
|
+
<div className={`flex h-11 w-11 shrink-0 items-center justify-center rounded-xl ${c.iconBg}`}>
|
|
78
|
+
<CalendarIcon size={20} color={c.iconColor} />
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
<div className="flex min-w-0 flex-1 flex-col">
|
|
82
|
+
<span className={`truncate text-base font-bold ${c.title}`}>{title}</span>
|
|
83
|
+
{subtitle ? <span className={`truncate text-xs ${c.subtitle}`}>{subtitle}</span> : null}
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
<span
|
|
87
|
+
className={`shrink-0 rounded-full px-2.5 py-1 text-xs font-semibold ${headerStyle.badgeBg} ${headerStyle.badgeText}`}
|
|
88
|
+
>
|
|
89
|
+
{headerStatusLabel}
|
|
90
|
+
</span>
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
<div className={`my-3 h-px ${c.divider}`} />
|
|
94
|
+
|
|
95
|
+
{head.map((row, index) => (
|
|
96
|
+
<Fragment key={row.id}>
|
|
97
|
+
{index > 0 ? <div className={`h-px ${c.divider}`} /> : null}
|
|
98
|
+
{renderRow(row)}
|
|
99
|
+
</Fragment>
|
|
100
|
+
))}
|
|
101
|
+
|
|
102
|
+
{hasMore ? (
|
|
103
|
+
<Collapsible expanded={expanded}>
|
|
104
|
+
{rest.map((row) => (
|
|
105
|
+
<Fragment key={row.id}>
|
|
106
|
+
<div className={`h-px ${c.divider}`} />
|
|
107
|
+
{renderRow(row)}
|
|
108
|
+
</Fragment>
|
|
109
|
+
))}
|
|
110
|
+
</Collapsible>
|
|
111
|
+
) : null}
|
|
112
|
+
|
|
113
|
+
{hasMore ? (
|
|
114
|
+
<button
|
|
115
|
+
type="button"
|
|
116
|
+
onClick={toggle}
|
|
117
|
+
className={`mt-1 flex w-full items-center justify-between gap-2 rounded-xl py-2`}
|
|
118
|
+
>
|
|
119
|
+
<div className="flex items-center gap-2">
|
|
120
|
+
<span className={`flex h-7 w-7 items-center justify-center rounded-full text-xs font-semibold ${c.iconBg} ${c.iconText}`}>
|
|
121
|
+
+{rest.length}
|
|
122
|
+
</span>
|
|
123
|
+
<span className={`text-sm ${c.subtitle}`}>
|
|
124
|
+
{expanded
|
|
125
|
+
? `Showing all ${reservations.length} requests`
|
|
126
|
+
: `Showing ${head.length} of ${reservations.length} requests`}
|
|
127
|
+
</span>
|
|
128
|
+
</div>
|
|
129
|
+
<span className={`flex shrink-0 items-center gap-1 text-sm font-semibold ${c.iconText}`}>
|
|
130
|
+
{expanded ? 'Show less' : 'View all'}
|
|
131
|
+
<span className={`transition-transform ${expanded ? 'rotate-180' : ''}`}>
|
|
132
|
+
<ChevronIcon size={14} color="currentColor" />
|
|
133
|
+
</span>
|
|
134
|
+
</span>
|
|
135
|
+
</button>
|
|
136
|
+
) : null}
|
|
137
|
+
|
|
138
|
+
{list.total || action ? (
|
|
139
|
+
<>
|
|
140
|
+
<div className={`my-3 h-px ${c.divider}`} />
|
|
141
|
+
<div className="flex items-center justify-between gap-3">
|
|
142
|
+
<div className="flex flex-col">
|
|
143
|
+
{totalLabel ? <span className={`text-xs ${c.subtitle}`}>{totalLabel}</span> : null}
|
|
144
|
+
{list.total ? <span className={`text-lg font-bold ${c.title}`}>{list.total}</span> : null}
|
|
145
|
+
</div>
|
|
146
|
+
|
|
147
|
+
{action ? (
|
|
148
|
+
<button
|
|
149
|
+
type="button"
|
|
150
|
+
onClick={() => onAction?.(list, ItemAction.Manage)}
|
|
151
|
+
className="rounded-xl bg-indigo-500 px-4 py-2 text-sm font-semibold text-white"
|
|
152
|
+
>
|
|
153
|
+
{action}
|
|
154
|
+
</button>
|
|
155
|
+
) : null}
|
|
156
|
+
</div>
|
|
157
|
+
</>
|
|
158
|
+
) : null}
|
|
159
|
+
</div>
|
|
160
|
+
);
|
|
161
|
+
}
|
|
@@ -14,10 +14,26 @@ export enum ComponentType {
|
|
|
14
14
|
Event = 'event',
|
|
15
15
|
EventList = 'eventList',
|
|
16
16
|
Info = 'info',
|
|
17
|
+
Flight = 'flight',
|
|
18
|
+
FlightList = 'flightList',
|
|
19
|
+
FlightBoard = 'flightBoard',
|
|
20
|
+
Order = 'order',
|
|
21
|
+
Reservation = 'reservation',
|
|
22
|
+
ReservationList = 'reservationList',
|
|
17
23
|
}
|
|
18
24
|
|
|
19
25
|
export enum ItemAction {
|
|
20
26
|
Add = 'add',
|
|
27
|
+
Manage = 'manage',
|
|
28
|
+
Track = 'track',
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export enum FlightStatus {
|
|
32
|
+
OnTime = 'onTime',
|
|
33
|
+
Delayed = 'delayed',
|
|
34
|
+
Boarding = 'boarding',
|
|
35
|
+
Landed = 'landed',
|
|
36
|
+
Cancelled = 'cancelled',
|
|
21
37
|
}
|
|
22
38
|
|
|
23
39
|
export type ActionHandler<TItem = unknown> = (item: TItem, action?: ItemAction) => void;
|
|
@@ -2,15 +2,31 @@ import { Product } from '../components/product/product.native';
|
|
|
2
2
|
import { Service } from '../components/service/service.native';
|
|
3
3
|
import { Event } from '../components/event/event.native';
|
|
4
4
|
import { Info } from '../components/info/info.native';
|
|
5
|
+
import { Flight } from '../components/flight/flight.native';
|
|
6
|
+
import { FlightBoard } from '../components/flight-board/flight-board.native';
|
|
7
|
+
import { Order } from '../components/order/order.native';
|
|
8
|
+
import { Reservation } from '../components/reservation/reservation.native';
|
|
5
9
|
import type { ProductItem } from '../components/product/product.model';
|
|
6
10
|
import type { ServiceItem } from '../components/service/service.model';
|
|
7
11
|
import type { EventItem } from '../components/event/event.model';
|
|
8
12
|
import type { InfoItem } from '../components/info/info.model';
|
|
13
|
+
import type { FlightItem } from '../components/flight/flight.model';
|
|
14
|
+
import type { FlightBoardItem } from '../components/flight-board/flight-board.model';
|
|
15
|
+
import type { OrderListItem } from '../components/order/order.model';
|
|
16
|
+
import type { ReservationListItem } from '../components/reservation/reservation.model';
|
|
9
17
|
import { ComponentType } from '../model/chat.model';
|
|
10
18
|
import type { ChatComponentProps } from '../model/chat.model';
|
|
11
19
|
|
|
12
20
|
export function ChatComponentRenderer<
|
|
13
|
-
TItem extends
|
|
21
|
+
TItem extends
|
|
22
|
+
| ProductItem
|
|
23
|
+
| ServiceItem
|
|
24
|
+
| EventItem
|
|
25
|
+
| InfoItem
|
|
26
|
+
| FlightItem
|
|
27
|
+
| FlightBoardItem
|
|
28
|
+
| OrderListItem
|
|
29
|
+
| ReservationListItem,
|
|
14
30
|
>({ type, ...rest }: ChatComponentProps<TItem>) {
|
|
15
31
|
switch (type) {
|
|
16
32
|
case ComponentType.Product:
|
|
@@ -24,6 +40,18 @@ export function ChatComponentRenderer<
|
|
|
24
40
|
return <Event type={type} {...(rest as unknown as Omit<ChatComponentProps<EventItem>, 'type'>)} />;
|
|
25
41
|
case ComponentType.Info:
|
|
26
42
|
return <Info type={type} {...(rest as unknown as Omit<ChatComponentProps<InfoItem>, 'type'>)} />;
|
|
43
|
+
case ComponentType.Flight:
|
|
44
|
+
case ComponentType.FlightList:
|
|
45
|
+
return <Flight type={type} {...(rest as unknown as Omit<ChatComponentProps<FlightItem>, 'type'>)} />;
|
|
46
|
+
case ComponentType.FlightBoard:
|
|
47
|
+
return <FlightBoard type={type} {...(rest as unknown as Omit<ChatComponentProps<FlightBoardItem>, 'type'>)} />;
|
|
48
|
+
case ComponentType.Order:
|
|
49
|
+
return <Order type={type} {...(rest as unknown as Omit<ChatComponentProps<OrderListItem>, 'type'>)} />;
|
|
50
|
+
case ComponentType.Reservation:
|
|
51
|
+
case ComponentType.ReservationList:
|
|
52
|
+
return (
|
|
53
|
+
<Reservation type={type} {...(rest as unknown as Omit<ChatComponentProps<ReservationListItem>, 'type'>)} />
|
|
54
|
+
);
|
|
27
55
|
default:
|
|
28
56
|
return null;
|
|
29
57
|
}
|
|
@@ -2,15 +2,31 @@ import { Product } from '../components/product/product';
|
|
|
2
2
|
import { Service } from '../components/service/service';
|
|
3
3
|
import { Event } from '../components/event/event';
|
|
4
4
|
import { Info } from '../components/info/info';
|
|
5
|
+
import { Flight } from '../components/flight/flight';
|
|
6
|
+
import { FlightBoard } from '../components/flight-board/flight-board';
|
|
7
|
+
import { Order } from '../components/order/order';
|
|
8
|
+
import { Reservation } from '../components/reservation/reservation';
|
|
5
9
|
import type { ProductItem } from '../components/product/product.model';
|
|
6
10
|
import type { ServiceItem } from '../components/service/service.model';
|
|
7
11
|
import type { EventItem } from '../components/event/event.model';
|
|
8
12
|
import type { InfoItem } from '../components/info/info.model';
|
|
13
|
+
import type { FlightItem } from '../components/flight/flight.model';
|
|
14
|
+
import type { FlightBoardItem } from '../components/flight-board/flight-board.model';
|
|
15
|
+
import type { OrderListItem } from '../components/order/order.model';
|
|
16
|
+
import type { ReservationListItem } from '../components/reservation/reservation.model';
|
|
9
17
|
import { ComponentType } from '../model/chat.model';
|
|
10
18
|
import type { ChatComponentProps } from '../model/chat.model';
|
|
11
19
|
|
|
12
20
|
export function ChatComponentRenderer<
|
|
13
|
-
TItem extends
|
|
21
|
+
TItem extends
|
|
22
|
+
| ProductItem
|
|
23
|
+
| ServiceItem
|
|
24
|
+
| EventItem
|
|
25
|
+
| InfoItem
|
|
26
|
+
| FlightItem
|
|
27
|
+
| FlightBoardItem
|
|
28
|
+
| OrderListItem
|
|
29
|
+
| ReservationListItem,
|
|
14
30
|
>({ type, ...rest }: ChatComponentProps<TItem>) {
|
|
15
31
|
switch (type) {
|
|
16
32
|
case ComponentType.Product:
|
|
@@ -24,6 +40,18 @@ export function ChatComponentRenderer<
|
|
|
24
40
|
return <Event type={type} {...(rest as unknown as Omit<ChatComponentProps<EventItem>, 'type'>)} />;
|
|
25
41
|
case ComponentType.Info:
|
|
26
42
|
return <Info type={type} {...(rest as unknown as Omit<ChatComponentProps<InfoItem>, 'type'>)} />;
|
|
43
|
+
case ComponentType.Flight:
|
|
44
|
+
case ComponentType.FlightList:
|
|
45
|
+
return <Flight type={type} {...(rest as unknown as Omit<ChatComponentProps<FlightItem>, 'type'>)} />;
|
|
46
|
+
case ComponentType.FlightBoard:
|
|
47
|
+
return <FlightBoard type={type} {...(rest as unknown as Omit<ChatComponentProps<FlightBoardItem>, 'type'>)} />;
|
|
48
|
+
case ComponentType.Order:
|
|
49
|
+
return <Order type={type} {...(rest as unknown as Omit<ChatComponentProps<OrderListItem>, 'type'>)} />;
|
|
50
|
+
case ComponentType.Reservation:
|
|
51
|
+
case ComponentType.ReservationList:
|
|
52
|
+
return (
|
|
53
|
+
<Reservation type={type} {...(rest as unknown as Omit<ChatComponentProps<ReservationListItem>, 'type'>)} />
|
|
54
|
+
);
|
|
27
55
|
default:
|
|
28
56
|
return null;
|
|
29
57
|
}
|
package/src/native.ts
CHANGED
|
@@ -2,14 +2,24 @@ export { Product } from './features/chat/components/product/product.native';
|
|
|
2
2
|
export { Service } from './features/chat/components/service/service.native';
|
|
3
3
|
export { Event } from './features/chat/components/event/event.native';
|
|
4
4
|
export { Info } from './features/chat/components/info/info.native';
|
|
5
|
+
export { Flight } from './features/chat/components/flight/flight.native';
|
|
6
|
+
export { FlightBoard } from './features/chat/components/flight-board/flight-board.native';
|
|
7
|
+
export { Order } from './features/chat/components/order/order.native';
|
|
8
|
+
export { Reservation } from './features/chat/components/reservation/reservation.native';
|
|
5
9
|
export { ChatComponentRenderer } from './features/chat/renderer/renderer.native';
|
|
6
10
|
export { ChatMessageRenderer } from './features/chat/message/message.native';
|
|
7
11
|
export { parseMessage } from './features/chat/message/message.logic';
|
|
8
|
-
export { ComponentType, ItemAction, Theme } from './features/chat/model/chat.model';
|
|
12
|
+
export { ComponentType, ItemAction, Theme, FlightStatus } from './features/chat/model/chat.model';
|
|
13
|
+
export { OrderStatus } from './features/chat/components/order/order.model';
|
|
14
|
+
export { ReservationStatus } from './features/chat/components/reservation/reservation.model';
|
|
9
15
|
export type { ProductItem } from './features/chat/components/product/product.model';
|
|
10
16
|
export type { ServiceItem } from './features/chat/components/service/service.model';
|
|
11
17
|
export type { EventItem } from './features/chat/components/event/event.model';
|
|
12
18
|
export type { InfoItem } from './features/chat/components/info/info.model';
|
|
19
|
+
export type { FlightItem, Airport } from './features/chat/components/flight/flight.model';
|
|
20
|
+
export type { FlightBoardItem, FlightRow } from './features/chat/components/flight-board/flight-board.model';
|
|
21
|
+
export type { OrderListItem, OrderRow } from './features/chat/components/order/order.model';
|
|
22
|
+
export type { ReservationListItem, ReservationRow } from './features/chat/components/reservation/reservation.model';
|
|
13
23
|
export type {
|
|
14
24
|
ChatMessage,
|
|
15
25
|
ChatMessageProps,
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { FlightStatus, Theme } from '../features/chat/model/chat.model';
|
|
2
|
+
|
|
3
|
+
export interface FlightStatusStyle {
|
|
4
|
+
dot: string;
|
|
5
|
+
badgeBg: string;
|
|
6
|
+
badgeText: string;
|
|
7
|
+
showDot: boolean;
|
|
8
|
+
label: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
type StatusMap = Record<FlightStatus, FlightStatusStyle>;
|
|
12
|
+
|
|
13
|
+
const DARK: StatusMap = {
|
|
14
|
+
[FlightStatus.OnTime]: { dot: 'bg-emerald-400', badgeBg: 'bg-emerald-500/15', badgeText: 'text-emerald-400', showDot: true, label: 'On time' },
|
|
15
|
+
[FlightStatus.Delayed]: { dot: 'bg-amber-400', badgeBg: 'bg-amber-500/15', badgeText: 'text-amber-400', showDot: false, label: 'Delayed' },
|
|
16
|
+
[FlightStatus.Boarding]: { dot: 'bg-indigo-300', badgeBg: 'bg-indigo-500/25', badgeText: 'text-indigo-300', showDot: false, label: 'Boarding' },
|
|
17
|
+
[FlightStatus.Landed]: { dot: 'bg-sky-400', badgeBg: 'bg-sky-500/15', badgeText: 'text-sky-400', showDot: true, label: 'Landed' },
|
|
18
|
+
[FlightStatus.Cancelled]: { dot: 'bg-red-400', badgeBg: 'bg-red-500/15', badgeText: 'text-red-400', showDot: false, label: 'Cancelled' },
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const LIGHT: StatusMap = {
|
|
22
|
+
[FlightStatus.OnTime]: { dot: 'bg-emerald-500', badgeBg: 'bg-emerald-500/15', badgeText: 'text-emerald-600', showDot: true, label: 'On time' },
|
|
23
|
+
[FlightStatus.Delayed]: { dot: 'bg-amber-500', badgeBg: 'bg-amber-500/20', badgeText: 'text-amber-600', showDot: false, label: 'Delayed' },
|
|
24
|
+
[FlightStatus.Boarding]: { dot: 'bg-indigo-500', badgeBg: 'bg-indigo-500/15', badgeText: 'text-indigo-600', showDot: false, label: 'Boarding' },
|
|
25
|
+
[FlightStatus.Landed]: { dot: 'bg-sky-500', badgeBg: 'bg-sky-500/15', badgeText: 'text-sky-600', showDot: true, label: 'Landed' },
|
|
26
|
+
[FlightStatus.Cancelled]: { dot: 'bg-red-500', badgeBg: 'bg-red-500/15', badgeText: 'text-red-600', showDot: false, label: 'Cancelled' },
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export function getFlightStatusStyle(
|
|
30
|
+
status: FlightStatus = FlightStatus.OnTime,
|
|
31
|
+
theme: Theme = Theme.Dark,
|
|
32
|
+
): FlightStatusStyle {
|
|
33
|
+
const map = theme === Theme.Light ? LIGHT : DARK;
|
|
34
|
+
return map[status] ?? map[FlightStatus.OnTime];
|
|
35
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Theme } from '../features/chat/model/chat.model';
|
|
2
|
+
import { OrderStatus } from '../features/chat/components/order/order.model';
|
|
3
|
+
import { getStatusBadgeStyle, StatusTone } from './status-badge.utils';
|
|
4
|
+
import type { StatusBadgeStyle } from './status-badge.utils';
|
|
5
|
+
|
|
6
|
+
const LABEL: Record<OrderStatus, string> = {
|
|
7
|
+
[OrderStatus.Pending]: 'Pending',
|
|
8
|
+
[OrderStatus.Preparing]: 'Preparing',
|
|
9
|
+
[OrderStatus.Accepted]: 'Accepted',
|
|
10
|
+
[OrderStatus.Rejected]: 'Rejected',
|
|
11
|
+
[OrderStatus.Delivered]: 'Delivered',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export function getOrderStatusStyle(
|
|
15
|
+
status: OrderStatus = OrderStatus.Pending,
|
|
16
|
+
theme: Theme = Theme.Dark,
|
|
17
|
+
): StatusBadgeStyle & { label: string } {
|
|
18
|
+
const tone =
|
|
19
|
+
status === OrderStatus.Accepted || status === OrderStatus.Delivered
|
|
20
|
+
? StatusTone.Success
|
|
21
|
+
: status === OrderStatus.Rejected
|
|
22
|
+
? StatusTone.Danger
|
|
23
|
+
: status === OrderStatus.Preparing
|
|
24
|
+
? StatusTone.Info
|
|
25
|
+
: StatusTone.Pending;
|
|
26
|
+
|
|
27
|
+
return { ...getStatusBadgeStyle(tone, theme), label: LABEL[status] ?? LABEL[OrderStatus.Pending] };
|
|
28
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Theme } from '../features/chat/model/chat.model';
|
|
2
|
+
import { ReservationStatus } from '../features/chat/components/reservation/reservation.model';
|
|
3
|
+
import { getStatusBadgeStyle, StatusTone } from './status-badge.utils';
|
|
4
|
+
import type { StatusBadgeStyle } from './status-badge.utils';
|
|
5
|
+
|
|
6
|
+
const LABEL: Record<ReservationStatus, string> = {
|
|
7
|
+
[ReservationStatus.Pending]: 'Pending',
|
|
8
|
+
[ReservationStatus.Confirmed]: 'Confirmed',
|
|
9
|
+
[ReservationStatus.Cancelled]: 'Cancelled',
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export function getReservationStatusStyle(
|
|
13
|
+
status: ReservationStatus = ReservationStatus.Pending,
|
|
14
|
+
theme: Theme = Theme.Dark,
|
|
15
|
+
): StatusBadgeStyle & { label: string } {
|
|
16
|
+
const tone = status === ReservationStatus.Confirmed
|
|
17
|
+
? StatusTone.Success
|
|
18
|
+
: status === ReservationStatus.Cancelled
|
|
19
|
+
? StatusTone.Danger
|
|
20
|
+
: StatusTone.Pending;
|
|
21
|
+
|
|
22
|
+
return { ...getStatusBadgeStyle(tone, theme), label: LABEL[status] ?? LABEL[ReservationStatus.Pending] };
|
|
23
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Theme } from '../features/chat/model/chat.model';
|
|
2
|
+
|
|
3
|
+
export enum StatusTone {
|
|
4
|
+
Pending = 'pending',
|
|
5
|
+
Success = 'success',
|
|
6
|
+
Danger = 'danger',
|
|
7
|
+
Info = 'info',
|
|
8
|
+
Neutral = 'neutral',
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface StatusBadgeStyle {
|
|
12
|
+
badgeBg: string;
|
|
13
|
+
badgeText: string;
|
|
14
|
+
dot: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const DARK: Record<StatusTone, StatusBadgeStyle> = {
|
|
18
|
+
[StatusTone.Pending]: { badgeBg: 'bg-amber-500/15', badgeText: 'text-amber-400', dot: 'bg-amber-400' },
|
|
19
|
+
[StatusTone.Success]: { badgeBg: 'bg-emerald-500/15', badgeText: 'text-emerald-400', dot: 'bg-emerald-400' },
|
|
20
|
+
[StatusTone.Danger]: { badgeBg: 'bg-red-500/15', badgeText: 'text-red-400', dot: 'bg-red-400' },
|
|
21
|
+
[StatusTone.Info]: { badgeBg: 'bg-indigo-500/25', badgeText: 'text-indigo-300', dot: 'bg-indigo-300' },
|
|
22
|
+
[StatusTone.Neutral]: { badgeBg: 'bg-white/10', badgeText: 'text-neutral-300', dot: 'bg-neutral-400' },
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const LIGHT: Record<StatusTone, StatusBadgeStyle> = {
|
|
26
|
+
[StatusTone.Pending]: { badgeBg: 'bg-amber-500/20', badgeText: 'text-amber-600', dot: 'bg-amber-500' },
|
|
27
|
+
[StatusTone.Success]: { badgeBg: 'bg-emerald-500/15', badgeText: 'text-emerald-600', dot: 'bg-emerald-500' },
|
|
28
|
+
[StatusTone.Danger]: { badgeBg: 'bg-red-500/15', badgeText: 'text-red-600', dot: 'bg-red-500' },
|
|
29
|
+
[StatusTone.Info]: { badgeBg: 'bg-indigo-500/15', badgeText: 'text-indigo-600', dot: 'bg-indigo-500' },
|
|
30
|
+
[StatusTone.Neutral]: { badgeBg: 'bg-slate-200', badgeText: 'text-neutral-600', dot: 'bg-slate-400' },
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export function getStatusBadgeStyle(tone: StatusTone, theme: Theme = Theme.Dark): StatusBadgeStyle {
|
|
34
|
+
const map = theme === Theme.Light ? LIGHT : DARK;
|
|
35
|
+
return map[tone] ?? map[StatusTone.Neutral];
|
|
36
|
+
}
|
package/src/utils/theme.utils.ts
CHANGED
|
@@ -13,6 +13,9 @@ export interface ThemeClasses {
|
|
|
13
13
|
iconBg: string;
|
|
14
14
|
iconText: string;
|
|
15
15
|
iconColor: string;
|
|
16
|
+
mutedIconBg: string;
|
|
17
|
+
mutedIconColor: string;
|
|
18
|
+
dashLine: string;
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
const DARK: ThemeClasses = {
|
|
@@ -28,6 +31,9 @@ const DARK: ThemeClasses = {
|
|
|
28
31
|
iconBg: 'bg-indigo-500/20',
|
|
29
32
|
iconText: 'text-indigo-300',
|
|
30
33
|
iconColor: '#a5b4fc',
|
|
34
|
+
mutedIconBg: 'bg-white/5',
|
|
35
|
+
mutedIconColor: '#82849a',
|
|
36
|
+
dashLine: 'border-neutral-700',
|
|
31
37
|
};
|
|
32
38
|
|
|
33
39
|
const LIGHT: ThemeClasses = {
|
|
@@ -43,6 +49,9 @@ const LIGHT: ThemeClasses = {
|
|
|
43
49
|
iconBg: 'bg-indigo-500/15',
|
|
44
50
|
iconText: 'text-indigo-500',
|
|
45
51
|
iconColor: '#6366f1',
|
|
52
|
+
mutedIconBg: 'bg-slate-200',
|
|
53
|
+
mutedIconColor: '#64748b',
|
|
54
|
+
dashLine: 'border-slate-300',
|
|
46
55
|
};
|
|
47
56
|
|
|
48
57
|
export function getThemeClasses(theme: Theme = Theme.Dark): ThemeClasses {
|
package/src/web.ts
CHANGED
|
@@ -2,14 +2,24 @@ export { Product } from './features/chat/components/product/product';
|
|
|
2
2
|
export { Service } from './features/chat/components/service/service';
|
|
3
3
|
export { Event } from './features/chat/components/event/event';
|
|
4
4
|
export { Info } from './features/chat/components/info/info';
|
|
5
|
+
export { Flight } from './features/chat/components/flight/flight';
|
|
6
|
+
export { FlightBoard } from './features/chat/components/flight-board/flight-board';
|
|
7
|
+
export { Order } from './features/chat/components/order/order';
|
|
8
|
+
export { Reservation } from './features/chat/components/reservation/reservation';
|
|
5
9
|
export { ChatComponentRenderer } from './features/chat/renderer/renderer';
|
|
6
10
|
export { ChatMessageRenderer } from './features/chat/message/message';
|
|
7
11
|
export { parseMessage } from './features/chat/message/message.logic';
|
|
8
|
-
export { ComponentType, ItemAction, Theme } from './features/chat/model/chat.model';
|
|
12
|
+
export { ComponentType, ItemAction, Theme, FlightStatus } from './features/chat/model/chat.model';
|
|
13
|
+
export { OrderStatus } from './features/chat/components/order/order.model';
|
|
14
|
+
export { ReservationStatus } from './features/chat/components/reservation/reservation.model';
|
|
9
15
|
export type { ProductItem } from './features/chat/components/product/product.model';
|
|
10
16
|
export type { ServiceItem } from './features/chat/components/service/service.model';
|
|
11
17
|
export type { EventItem } from './features/chat/components/event/event.model';
|
|
12
18
|
export type { InfoItem } from './features/chat/components/info/info.model';
|
|
19
|
+
export type { FlightItem, Airport } from './features/chat/components/flight/flight.model';
|
|
20
|
+
export type { FlightBoardItem, FlightRow } from './features/chat/components/flight-board/flight-board.model';
|
|
21
|
+
export type { OrderListItem, OrderRow } from './features/chat/components/order/order.model';
|
|
22
|
+
export type { ReservationListItem, ReservationRow } from './features/chat/components/reservation/reservation.model';
|
|
13
23
|
export type {
|
|
14
24
|
ChatMessage,
|
|
15
25
|
ChatMessageProps,
|